RULE WORKS WITH ONE ACTION BUT NOT WITH ANOTHER

The rule is

- rule: greet
  condition:
  - slot_was_set:
    - user_name: null
  steps:
  - intent: greet
  - action: utter_greet
  - action: profile_form
  - active_loop: profile_form
  - active_loop: null
  - action: action_create_profile

The last action, is action_create_profile, it is not called by rasa! But if instead I use action: action_hello_world instead of action_create_profile, it is called!

The actions code:

from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher

class ActionHelloWorld(Action):

    def name(self) -> Text:
        return "action_hello_world"

    def run(self, dispatcher: CollectingDispatcher,
            tracker: Tracker,
            domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

        text = 'oi mundo'

        dispatcher.utter_message(text)

        return []



from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from actions.crisp_api import add_new_people_profile

class ActionCreateProfile(Action):

    def name(self) -> Text:
        return "action_create_profile"

    def run(self, dispatcher: CollectingDispatcher,
            tracker: Tracker,
            domain: Dict[Text, Any]) -> List[Dict[Text, Any]]: 

        dispatcher.utter_message("testses")

        email = tracker.get_slot('email')
        user_name = tracker.get_slot('user_name')
        segments = tracker.get_slot('segments')
        phone = tracker.get_slot('phone')

        data = {
            "email": email,
            "person": {
                "nickname": user_name,
                "phone": phone,
            },
            "segments": segments,
            "data": {
                "user_name": user_name,
            }
        }

        print('todos')
        print(email)
        print(user_name)
        print(segments)
        print(phone)

        add_new_people_profile(data)

        return []

The debug log will show you what’s going on with the dialogue prediction issue.

You should follow the forms docs example with separate rules to enter and complete the form.

Separate rules worked. Thank you