How to end Dialog, which has been interrupted by "Allow Interruption" Feature?

Viewed 243

In Bot Framework Composer, a Dialog A is interrupted by an "HelpDialog". When "HelpDialog" is ended, the user resume the "previous dialog A".

I would like to end the "previous dialog A" and trigger a different dialog within the "HelpDialog". But I am always forced to resume the "previous dialog A", although it is not needed anymore.

I found some workaround, but I really would like to "kill" the previous dialog the same way I can end the "HelpDialog" with the action "end this dialog".

Is there a clean way?

Thanks

1 Answers

I think the solution you are looking for is to use 'Replace this dialog' instead of 'Begin a new dialog'. Consider the following.

I have four dialogs: A, B, C, and Help, plus the 'Unknown intent' trigger. The flow looks like this:

  1. The bot starts and I say 'Hi'
  2. The Unknown intent recognizes this and begins Dialog A
  3. While in Dialog A, I ask for 'help'
  4. The Help trigger recognizes this and calls the Help dialog
  5. The Help dialog BEGINS Dialog B
  6. In Dialog B, which asks for my favorite color, it calls Dialog C.
  7. In Dialog C, which asks for my favorite season, it calls 'End this dialog'.

Because interruptions only interrupt (and not cancel) the current dialog, the user is returned back to the parent (or calling) dialog. Dialog A, in this case. As each child dialog is completed, when the end is reached control bubbles back up to the parent dialog to continue where it left off.

However, in step 5 in the Help dialog, we can change 'Begin a dialog' to 'Replace this dialog' so the flow looks like this:

  1. The Help dialog REPLACES Dialog A with Dialog B
  2. In Dialog B, which asks for my favorite color, it calls Dialog C.
  3. In Dialog C, which asks for my favorite season, it calls 'End this dialog'.

When 'End this dialog' is called in Dialog C and control bubbles back up, it is returned to the 'main' dialog as Dialog A is no longer in the dialog stack.

To achieve this, you need to create a secondary Help trigger within Dialog A. It is necessary the trigger is in Dialog A as that is the dialog we want to replace. It is in this secondary Help trigger that the 'Replace this dialog' action is implemented.

enter image description here

Hope of help!

Related