Make work checkpoints with slots instead of intents

Hi, I have this:

- story: ticket_not_found_1
  steps:
  - checkpoint: ingresar_ticket
  - action: utter_indique_ticket
  - action: ticket_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - action: action_utter_toanswer_consulta_ticket     ## Quitar el action_ posteriormente.
  - slot_was_set:
    - error: true
  - action: utter_no_encuentra_ticket
  - action: action_reset_yes_no_form
  - intent: deny
  - action: utter_cierre_estandar
  - action: action_terminar_conversacion


- story: ticket_not_found_2
  steps:
  - checkpoint: ingresar_ticket
  - action: utter_indique_ticket
  - action: ticket_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - action: action_utter_toanswer_consulta_ticket     ## Quitar el action_ posteriormente.
  - slot_was_set:
    - error: true
  - action: utter_no_encuentra_ticket
  - action: action_reset_yes_no_form
  - intent: affirm
  - checkpoint: ingresar_ticket

and it works ok, when I “yes” or “no” in the last question it ends or it repeats, as expected. The problem is I need to do this:

- story: ticket_not_found_1
  steps:
  - checkpoint: ingresar_ticket
  - action: utter_indique_ticket
  - action: ticket_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - action: action_utter_toanswer_consulta_ticket     ## Quitar el action_ posteriormente.
  - slot_was_set:
    - error: true
  - action: utter_no_encuentra_ticket
  - action: action_reset_yes_no_form
  - action: yes_no_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - slot_was_set:
    - yes_no: no
  - action: utter_cierre_estandar
  - action: action_terminar_conversacion


- story: ticket_not_found_2
  steps:
  - checkpoint: ingresar_ticket
  - action: utter_indique_ticket
  - action: ticket_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - action: action_utter_toanswer_consulta_ticket     ## Quitar el action_ posteriormente.
  - slot_was_set:
    - error: true
  - action: utter_no_encuentra_ticket
  - action: action_reset_yes_no_form
  - action: yes_no_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - slot_was_set:
    - yes_no: yes
  - action: utter_quiere_cobrar_garantia

decide the path with a form and a slot instead of an intent. It doesn’t work, it goes to fallback after I answer the form.

Do checkpoints work with slots? or should I try another stuff? My main problem is that when I say “yes” I’m saying “I want to try again”, and when I say “no” it should end.

Thanks in advice

You can definitely do what you are trying to do with forms, and save the result in a slot.

It seems that the problem is in the structure of your code. You should indicate which Slot you are asking for and what value it has been set to, before ending the form.

By putting the following lines of code:

  - slot_was_set:
    - requested_slot: null
  - active_loop: null

you are indicating that the form has finished, but you have not indicated what values have been set before finishing the form. That structure might work in rules, but not in stories.

As I see it, the correct code would be as follows:

- story: ticket_not_found_1
  steps:
  - checkpoint: ingresar_ticket
  - action: utter_indique_ticket
  - action: ticket_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - action: action_utter_toanswer_consulta_ticket     ## Quitar el action_ posteriormente.
  - slot_was_set:
    - error: true
  - action: utter_no_encuentra_ticket
  - action: action_reset_yes_no_form
  - action: yes_no_form
  - active_loop: yes_no_form
  - slot_was_set:
    - requested_slot: yes_no
  - slot_was_set:
    - yes_no: no
  - slot_was_set:
    - requested_slot: null
  - active_loop: null
  - action: utter_cierre_estandar
  - action: action_terminar_conversacion


- story: ticket_not_found_2
  steps:
  - checkpoint: ingresar_ticket
  - action: utter_indique_ticket
  - action: ticket_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - action: action_utter_toanswer_consulta_ticket     ## Quitar el action_ posteriormente.
  - slot_was_set:
    - error: true
  - action: utter_no_encuentra_ticket
  - action: action_reset_yes_no_form
  - action: yes_no_form
  - active_loop: yes_no_form
  - slot_was_set:
    - requested_slot: yes_no
  - slot_was_set:
    - yes_no: yes
  - slot_was_set:
    - requested_slot: null
  - active_loop: null
  - action: utter_quiere_cobrar_garantia

I hope it works for you.