botframework-sdk
botframework-sdk copied to clipboard
Adaptive Dialogs: Add `AllowInterruptions` property to AdaptiveDialog class
Issue
The telephony team is attempting to build a DTMF based phone tree using AdaptiveDialogs. The idea is they'd like to use simple RegEx based intents to handle each menu option. This works but the issue they're running into is that when a user presses "3" within a child menu and that menu doesn't have an intent handler for "3", the digit bubble up to the parent menu which may have a handler for "3".
Proposed change
To solve this problem we simply need to add an AllowInterruptions property at the dialog level. This property will default to true preserve the current behavior but when set to false will prevent unrecognized key presses from bubbling up the menu hierarchy.
By setting both AllowInterruptions and AutoEndDialog to false, developers can easily build a hierarchical menu system. Adding a conditional expression to AllowInterruptions would even let you allow certain digits like 0 or non-DTMF responses to bubble up the hierarchy as normal.
Component Impact
New property on AdaptiveDialog class and new schema entry for composer.
Customer Impact
The default value will be true to preserve existing behavior so there should be no customer impact.
Tracking Status
Dotnet SDK TODO
- [ ] PR
- [ ] Merged
Javascript SDK TODO
- [ ] PR
- [ ] Merged
Python SDK TODO
- [ ] PR
- [ ] Merged
Java SDK TODO
- [ ] PR
- [ ] Merged
Samples TODO
- [ ] PR
- [ ] Merged
Docs TODO
- [ ] PR
- [ ] Merged
Tools TODO
- [ ] PR
- [ ] Merged
Don't know if AllowInterruptions is a good name to intuitively understand its purpose. FYI, in JS, we call this "stop propagation".
And "interruption" in speech could means "allow the user to interact before the menu/dialog complete", because some "menu" could be around legal stuff and should not be "interrupted", e.g. "we will record for training and monitoring purpose".
Love to see elimination of code for "press # (pound) for main menu", but don't know if the complexity will outweigh its existence.
@compulim all of the input actions have an AllowInterruptions property that will stop the propagation of a received message up the dialog stack. The AdaptiveDialog class is missing this property which means you can only turn interruptions on/off at leaf nodes currently. Like the name or not we should stick with the current naming convention to avoid two different property names that do the exact same thing.
Agree. We should stick with the name, I thought it is a new one. 😄