Skip to main content

q

The q trigger tag declares a pattern by which the dialog can enter a state.

tip
This is a local tag: transitions by this tag can be made only from the nearest parent, sibling, or children states.

Value

A pattern is specified after the tag. Refer to the Patterns section to learn more about pattern syntax.

Parameters

ParameterTypeDescriptionDefault value
fromStateStringA path to a state from which a transition to the current state by this q tag can be made.
toStateStringA path to a state to which a transition from the current state by this q tag can be made.
onlyThisStateBoolean• If true and the fromState parameter is present, a transition to the current state can be made strictly from the state specified in fromState, but not from its nested states.
• If true and the toState parameter is present, a transition to the state specified in toState can be made strictly from the current state, but not from its nested states.
false

How to use

state: Greeting
a: Hi! How are you doing?

state: DoinGood
q: * (good/okay/fine) *
a: Glad to hear you’re fine! Can I help you in some way?

state: DoinBad
q: * (bad/not [really] good) *
a: I’m sorry to hear that. Is there any way I can help?

state: YouCanHelp
q: * (yes/you can) *
q: * (yes/you can) * || fromState = "/Greeting/DoinGood"
a: I’m all ears!