This can be a little bit complicated. I can suggest you a way but it’s not perfect. It depends on you to choose and implement accordingly to your usage.
First, you may create a seperate form just for the user to choose what to order like ChooseOrderForm:
User: I want to make an order
Bot: Please select your option:
- order pizza
- order noodle
- order pasta
User: 1 (this part depends on how you do the entity extraction, maybe have a option entity for it ?)
In the submit function of the ChooseOrderForm, you check the value of ‘option’ slot:
If it’s 1: Use FollowupAction events to the OrderPizzaForm which will take care of the whole pizza ordering process:
Bot: Please select the pizza which you want to order:
If it’s 2: Follow up to OrderNoodleForm
If it’s 3: Follow up to OrderPastaForm
As i said before, i don’t know if this solves your problem perfectly or not. But in my opinion, deviding the logic into different forms make it easier to redirect midway, as well as easier to implement the logic as different small parts. You can try and see if it fits your need.
Anyway, you can read about Events and FollowupAction event here: Events