0

I have three dialogs : DialogA , DialogB and DialogC.DialogA and DialogB can both call DialogC.Now if DialogC is called from DialogA, at the end of DialogC, how do I determine that the DialogC was called from DialogA and I need to call it back. If I use return await context.endDialog(); , it moves to the next step of the DialogA. The dialog calls happen based on condition like

DialogA {
    async step1(context) {
        if(some condition) {
            return await context.beginDialog(DialogC);
        }
        //some other code
    }
    async step2(context) {
        //step2 processing code
    }
}

All the dialogs are WATERFALLDIALOG.So what I need to find is how do I return to the same point where I had called the DialogC from either of the dialogs DialogA or DialogB or restart the DialogA or DialogB.

Rajeesh Menoth
  • 1,704
  • 3
  • 17
  • 33
AJ31
  • 210
  • 2
  • 13

1 Answers1

0

I think the ReplaceDialog class is possibly what you are looking for if I’ve understood your requirement. Also, you can pass in a value into your dialog using the options property too.

DialogA
var options = ‘FromDialogA’
return await context.beginDialog(DialogC, options)

DialogC
if (context.options == ‘FromDialogA’) {
// back to the parent dialog
return await context.replaceDialog(DialogA)
}
Steve Johnson
  • 405
  • 3
  • 8
  • Actually I have used `context.replaceDialog()` but what I was missing was `context.next()` for one of the waterfall steps. Thanks for the help though. – AJ31 Sep 15 '21 at 13:44