Switching from one form to another

I have a simple form that enables a person to track his order with us. Before the form starts, I want to check if the logged_in slot is set, and if it is not set, switch to the login form.

I would prefer that this behaviour be enforced by a rule and not an ML model. What would be the best way to implement the switch from one form to another?


If you really want to use code for that, one option is to have some action to verify this condition and returns a FollowupAction. Try something like this:

class ActionVerifyLogin(Action):

    def name(self):
        return "action_verify_login"

    def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain):
        if not tracker.get_slot('logged_in'):
            return [FollowupAction('your_login_form')]
        return [FollowupAction('your_track_order_action')]