How to use the botbuilder-dialogs-adaptive/lib/actions/case.Case function in botbuilder-dialogs-adaptive

To help you get started, we’ve selected a few botbuilder-dialogs-adaptive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / botbuilder-js / samples / 08. switchCondition / lib / index.js View on Github external
bot.conversationState = new botbuilder_1.ConversationState(new botbuilder_1.MemoryStorage());
// Listen for incoming activities.
server.post('/api/messages', (req, res) => {
    adapter.processActivity(req, res, async (context) => {
        // Route activity to bot.
        await bot.onTurn(context);
    });
});
// Initialize bots root dialog
const dialogs = new botbuilder_dialogs_adaptive_1.AdaptiveDialog();
bot.rootDialog = dialogs;
// Handle unknown intents
dialogs.triggers.push(new botbuilder_dialogs_adaptive_1.OnUnknownIntent([
    new botbuilder_dialogs_adaptive_1.SetProperty('dialog.age', "'22'"),
    new botbuilder_dialogs_adaptive_1.SwitchCondition('dialog.age', null, [
        new case_1.Case("21", [
            new botbuilder_dialogs_adaptive_1.SendActivity("age is 21!")
        ]),
        new case_1.Case("22", [
            new botbuilder_dialogs_adaptive_1.SendActivity("age is 22!")
        ])
    ])
]));
//# sourceMappingURL=index.js.map
github microsoft / botbuilder-js / samples / 08. switchCondition / lib / index.js View on Github external
adapter.processActivity(req, res, async (context) => {
        // Route activity to bot.
        await bot.onTurn(context);
    });
});
// Initialize bots root dialog
const dialogs = new botbuilder_dialogs_adaptive_1.AdaptiveDialog();
bot.rootDialog = dialogs;
// Handle unknown intents
dialogs.triggers.push(new botbuilder_dialogs_adaptive_1.OnUnknownIntent([
    new botbuilder_dialogs_adaptive_1.SetProperty('dialog.age', "'22'"),
    new botbuilder_dialogs_adaptive_1.SwitchCondition('dialog.age', null, [
        new case_1.Case("21", [
            new botbuilder_dialogs_adaptive_1.SendActivity("age is 21!")
        ]),
        new case_1.Case("22", [
            new botbuilder_dialogs_adaptive_1.SendActivity("age is 22!")
        ])
    ])
]));
//# sourceMappingURL=index.js.map
github microsoft / botbuilder-js / samples / 08. switchCondition / src / index.ts View on Github external
await bot.onTurn(context);
    });
});

// Initialize bots root dialog
const dialogs = new AdaptiveDialog();
bot.rootDialog = dialogs;

// Handle unknown intents
dialogs.triggers.push(new OnUnknownIntent([
    new SetProperty('dialog.age', "'22'"),
    new SwitchCondition('dialog.age', null, [
        new Case("21", [
            new SendActivity("age is 21!")
        ]),
        new Case("22", [
            new SendActivity("age is 22!")
        ])
    ])
]));
github microsoft / botbuilder-js / samples / 08. switchCondition / src / index.ts View on Github external
server.post('/api/messages', (req, res) => {
    adapter.processActivity(req, res, async (context) => {
        // Route activity to bot.
        await bot.onTurn(context);
    });
});

// Initialize bots root dialog
const dialogs = new AdaptiveDialog();
bot.rootDialog = dialogs;

// Handle unknown intents
dialogs.triggers.push(new OnUnknownIntent([
    new SetProperty('dialog.age', "'22'"),
    new SwitchCondition('dialog.age', null, [
        new Case("21", [
            new SendActivity("age is 21!")
        ]),
        new Case("22", [
            new SendActivity("age is 22!")
        ])
    ])
]));
github microsoft / BotBuilder-Samples / experimental / adaptive-dialog / javascript_nodejs / declarative / 60.adaptive-bot / index.js View on Github external
(resourceExplorer.getResources('.dialog') || []).forEach(resource => {
        if (resource.resourceId !== undefined && resource.resourceId.endsWith('.main.dialog')) {
            let dialogName = path.basename(resource.resourceId, '.main.dialog');
            const subDialog = resourceExplorer.loadType(resource);
            choices.push({value : dialogName});
            switchCases.push(new Case(dialogName, [subDialog]));
        }
    });
    rootDialog.generator = new TemplateEngineLanguageGenerator();