问题
Is it possible to have multiple waterfall conversation in Microsoft Bot framework?
I am having a Rootdialog (derived from ComponentDialog (WaterfallDialog)), which accepts users's initial input. I want to use this dialogue to initiate a login process to an external service. Once this login is successful, I would like to initiate a specific waterfall dialogue based on users initial input.
For example, User says
Flow1 --> Start Root dialogue (For login process) --> Start Flow1 (Waterfall) dialog
Flow2 --> Start Root dialogue (For login process) --> Start Flow2 (Waterfall) dialog
I tried doing this but the moment I call BeginDialogAsync from Root dialogue, it hangs
return await stepContext.BeginDialogAsync("flow1", null, cancellationToken);
Please let me know what am I missing here, Thanks in Advance
回答1:
Yes, it is very much possible to have multiple waterfall conversations in bot framework. There is a concept of waterfall dialogs in bot framework v4, where a waterfall accepts a stack of functions that will be executed in sequence. Each step of the conversation is implemented as an asynchronous function that takes a waterfall step context (step) parameter. Each waterfall step can ask a question of the user and the user's response will be passed to the next step in the waterfall. You also have component dialogs which allows you to reuse dialog sets.
Refer to the multi-turn prompt sample, which uses a waterfall dialog, a few prompts, and a component dialog to create a simple interaction that asks the user a series of questions and the bot-authentication sample.
Hope this helps!!
来源:https://stackoverflow.com/questions/62267723/multiple-waterfall-conversation-in-microsoft-bot-framework