Search code examples
node.jsbotframeworkinterrupt

Returning to Waterfall Dialog after Interrupt


I'm having a problem trying to return to my Waterfall Dialog after detecting an interruption using Luis. For example, I have 5 steps in my Waterfall, in step 3 Luis detects an interruption and answers correctly but the Waterfall returns to step 4 and doesn't ask again the step 3.

async interrupt(innerDc) {
    if (innerDc.context.activity.text) {
        const luisResult = await this.luisRecognizer.executeLuisQuery(innerDc.context);
        switch (LuisRecognizer.topIntent(luisResult)) {

        case 'TiempoDesembolso':
            const getWeatherMessageText = 'El tiempo de desembolso actual es de 12 meses';
            await innerDc.context.sendActivity(getWeatherMessageText, getWeatherMessageText, InputHints.IgnoringInput);
            return await this.onContinueDialog(innerDc);
        }
    }

How can I ask again for the step 3 and then continue the waterfall flow?


Solution

  • You should be able to use return await innerDc.repromptDialog(); in your case statement to reprompt the last step of the active dialog. I used an older version which has the interrupt code within my main dispatchBot.js file instead of a separate cancelAndHelpDialog file, but I think the method will be the same.