Reputation: 832
I have a conversation where a user can enter into a form. Before they can enter the form they need to authenticate and then potentially after authentication they may need to answer a few more questions before the target form is invoked.
So lets say I have 3 dialogs A, B and C. The aim is to display C but we may need to display A and potentially also B first.
How do i neatly create a chain that caters for all scenarios (only C, A and C and A, B and C etc)?
Upvotes: 0
Views: 870
Reputation: 14787
You don't need a chain for this. You set C as your root dialog. There you add the logic to check for example if it's authenticated or not. If it's not, then you FWD the message to the A dialog.
From the A dialog you should go back to C and C should decide if this goes to B or not.
In the AzureBot sample, they are doing something pretty similar here. You will see that they are trying to retrieve an auth token; and if the token is not present, they forward the message to the dialog responsible for handling the auth.
If you don't know how to call/fwd to dialogs, please read this.
Upvotes: 1