Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Accounting for any state

You can also create an intent node with a state of AnyState, which means no matter where in the flow the user currently is if the intent occurs (that is, no matter what the Last state was set to, or if the last state was set to No State), this intent node will fire. If and only when the last Say node does not have

Unless

  1. There is no last state, and there is an intent node that matche the intent with No State set.

  2. There is another intent node on the canvas that has the state selector set to the current state.

  3. The last Say node has the check box “Disable Any State Check for Next Request” checked.

...

For example, you can use AnyState in a scenario in which the voice/chat application lets a user pick from a list of menu options. You can create intents for the available options with the state set to whatever the user chooses, plus an intent with the state set to AnyState that returns the user to the Main Menu.

Another example is to create a CancelIntent with the state set to AnyState that lets a user get out of whatever flow they are in and start over.

If you create an intent with a state of AnyState, and the same intent with the State “Survey”

Note:

...

The intent node with State=Survey will take priority over AnyState, if in the state Survey when an intent fires.

...

AnyState includes noState. If you have 2 nodes, one with AnyState, and another with noState, and you are in the state noState, then the intent node State=noState will execute.

...

Example: In this example will add 3 intent nodes for the intent test, that respond by the utterance “test”
1st node State = “No State”
2nd node State = “Any State”
3rd node State = “t0”

...

  1. User types--> “TEST” -- > the intent with State = “No State” will fire. This will set the Last State value to “t0”

  2. The user again types → “Test” → the intent with State = “t0” i.e the one connected to the debug node “State equal” will fire. This will set the Last State value to “t1”

  3. The user again types → “Test” → the intent with State = “Any State” i.e the one connected to the debug node “anyState” will fire. This will set the Last State value to “t2”

    Next:

  4. Delete the intent node, with State = “No State”

...

  1. Refresh the chatBot, so there is no state in the session.
    The user again types → “Test” → the intent with State = “Any State” will fire. This will set the Last State value to “t2”

    If that Say node with the state set to “t2” also has:

    Image Added

    Then only an Intent node with Intent Test and State = T2 will fire. If one does not exist, then the None Intent will fire.

How to use the state to affect the logical flow of the voice experience

The best place to set a state in a flow is after an interaction. That makes the Say node a perfect place to do this.

...