How can you interrupt a dialog flow in progress?
Let's say I have the following code:
const intentDialog = new builder.IntentDialog({ recognizers: [recognizer] });
bot.dialog('/', intentDialog);
intentDialog.matches('how_are_you', function(session) {
session.send("Doing very well! Thanks for asking :)");
session.beginDialog("/i_can_help_you_with");
}, function(session) {
session.endDialog();
});
intentDialog.matches("intent_a", [function(session) {
builder.Prompts.choice(session, "Please choose from:", "Option A | Option B", { listStyle: listStyle['button'] });
},
function(session, results) {
if (results.response.entity === "Option A") {
session.beginDialog("/Option_A");
} else {
session.beginDialog("/Option_B");
}
},
function(session) {
session.endDialog();
}
]);
This is what I want to do: If I am at builder.Prompts.choice of intent dialog "intent_a" and the user types "how are you", I would like for the "how_are_you" intent to start. Then when it is finished, resume the flow from intent dialog "intent_a".
This is what I see it do: If I am at builder.Prompts.choice of intent dialog "intent_a" and the user types "how are you", I get the default message from failing to select a valid choice.
Can anyone please point me in the right direction of how to solve this problem? Thanks in advance.
Any update on this?
@willportnoy @muzahmed any update?
@oztheozoz sorry for the delay... We're actually working on a solution to this. For now you would have to actually write a piece of middleware to intercept things which is not going to be as clean as you'd like. We're working on a solution that will let you accomplish the above using actions. You can almost do it today with actions but you're limited to using RegEx's. A future update of the SDK will add support for using Actions with LUIS models which should address this need.
Great to hear that this is being worked on. Thanks for the update and suggestions for work arounds!