Issue with State inside State


#1
CancelIterationIntent() 
        {
            this.followUpState('Cancel')
                .ask("Are you done with the Library?"); 
        }, 

The above code exists in a state called MediaSearch.

 Cancel: 
        {
            YesIntent()
            {
                console.log("\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "made it in"); 
                this.endSession(); 
            }, 

            NoIntent()
            {
                console.log("\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "made it in"); 
                return this.toStatelessIntent('LAUNCH');
            }
        },

The above code is the state ‘Cancel’ which also exists inside MediaSearch.

intentMap: {
        'AMAZON.StopIntent': 'END',
        'AMAZON.YesIntent': 'YesIntent',
        'AMAZON.NoIntent': 'NoIntent'
    },

The above code is in config.js and maps Amazon’s proprietary intents to my intents.

           {
			"name": "YesIntent", 
			"phrases": [
				"yes"
			]
		}, 
		{
			"name": "NoIntent", 
			"phrases": [
				"no"
			]
		}

The above code is in en-US.json.

Problem:
When I test the application, it seems to route to the ‘Cancel’ state and the Yes and No intents fine; however, it does not go into the yes or no intent. It simply ends the session. I have 0 idea why. Any suggestions?

Thank you in advance!.


#2

Could you paste the full request of either the YesIntent or NoIntent inside that state? Also, where are you testing it? Alexa Simulator, device, Jovo Debugger?


#3

I have been using both, depending on what I am testing. Here is the NoIntent request inside the 'Cancel" state:


#4

Thanks! And just to clarify: Is Cancel a state inside another state?

Then, you would need to do this:

this.followUpState('MediaSearch.Cancel')

// or, generic

this.followUpState(this.getState() + '.Cancel')

#5

Thank you very very much!! That was the issue!


#6

Great! Closing this now


closed #7