Problem with slot_was_set in rule

I want to execute different actions depending on the values of the slots. The type of these slot are all set to categorical. Here is my rule:

  • rule: Activate buy_clothes_form steps:

    • intent: buy_clothes
    • action: utter_show_message_buy_clothes
    • action: buy_clothes_form
    • slot_was_set:
      • size:
      • color:
      • type:
    • active_loop: buy_clothes_form
  • rule: submit buy_clothes_form 0 condition:

    • active_loop: buy_clothes_form steps:
    • action: buy_clothes_form
    • active_loop: null
    • slot_was_set:
      • size: S
      • color: red
      • type: T-short
    • action: action_submit_buy_clothes_red

But, after executing action_submit_buy_clothes_red action, rasa predicts default_fallback as the next action rather than action_listen. Is there anything wrong? Or, rule is not suitable for the branch task.

Hi @lullaby-afa try

  rules:
    - rule: Activate buy_clothes_form
      steps:
      - action: buy_clothes
      - active_loop: utter_show_message_buy_clothes
      - action: buy_clothes_form
      - slot_was_set:
        - requested_slot: size
        - requested_slot: color
        - requested_slot: type
      - active_loop: buy_clothes_form
  


    rules:
    - rule: submit buy_clothes_form
      condition:
      - active_loop: buy_clothes_form 
      steps:
      - action: buy_clothes_form 
      - active_loop: null
      - slot_was_set:
        - requested_slot: size
        - requested_slot: color
        - requested_slot: type
      # The actions we want to run when the form is submitted.
      - action: action_submit_buy_clothes_red
      - action: utter_slots_values

Further, please check this link Forms how to set the slot and form activation and deactivation using rules. I hope you it will help. Thanks.