Search code examples
dialogbotframeworkadaptive-dialogs

How do I redirect from one child dialog into another child dialog


I'm in an adaptive dialog in bot framework.

The "conversational architecture" looks like this:

[ROOT DIALOG] -> [CHILD1 DIALOG]

[ROOT DIALOG] -> [CHILD2 DIALOG] ... [further dialogs]

I'm finished with the data capture I was doing in [CHILD1 DIALOG] and I would like the user to "jump" straight into [CHILD2 DIALOG] without having to manually do so via [ROOT DIALOG].

How would one do that in bot framework?


Solution

  • I think you're looking for replaceDialog. I use it in my non-adaptive dialogs to transition from the end of dialog 1 to dialog 2 without going back to the root (I call it in the last step instead of endDialog). There is a sample for using ReplaceDialog within adaptive dialogs.

    That sample includes a prompt to confirm if the user wants to replace the dialog (it's in the context of an interrupt, not redirecting from dialog 1 to dialog 2 as you mentioned), but I think you can leave that part out and just use the new ReplaceDialog(YOUR_DIALOG_NAME) line as your step action to accomplish this.