[Question] Node.js bot framework UniversalBot beginDialogAction usage?
Maybe I'm stupid, but I really don't understand how to read the node.js version of the bot framework sdk in regards to what to call things on and how to call them. I'm trying to figure out how to use beginDialogAction() or endConversationAction() in a ConsoleConnector bot. The documentation says it registers an action when triggered but no mention of how to trigger it. I want to leverage the idea that it can add a dialog in the middle of callstack outside of the normal flow.
var connector = new builder.ConsoleConnector().listen();
var bot = new builder.UniversalBot(connector);
bot.dialog('/', [
function( session ) {
builder.Prompts.text(session, "blah blah blah?");
},
function( session, results ) {
// ...
session.beginDialog('/foo');
session.endDialog();
}
]);
bot.dialog('/foo', [
function( session, args ) {
// ...
},
function( session, results ) {
// ...
session.endDialog();
}
]);
bot.beginDialogAction('bar', '/help');
bot.dialog('/help', [
function( session, args ) {
// ...
},
function( session, results ) {
// ...
session.endDialog();
}
]);
bog.use({ botbuilder: function( session, next ) {
// CALL THE ACTION 'bar' HERE TO ADD '/help' to the callstack
// ...
next();
}});
See my answer here: http://stackoverflow.com/questions/38602107/node-js-bot-framework-universalbot-begindialogaction-usage/38646877#38646877
Yes... I apologize... The documentation is severely lacking here. We're still working through all of the behaviors around actions and better documentation is coming.
I'm actually planning to replace UniveralBot.beginDialogAction() with a dialog level triggerAction() that lets you describe the rules for how a dialog can be triggered. That's what the intent of beginDialogAction() really was. It just says if the user ever says "foo" then start dialog "bar". You can also bind them to a button so that if you return a card with a button bound to a global dialog action it will always work.
Assuming steve's answer clarified the issue. If not please reply to this and ask us to reopen. Thanks!
Anyone tell me, when we use Trigger action in bot code?