Skip to main content

$reactions.timeout

The function executes a transition to the state in case there is no response from the user.

caution
There can be only one timeout for one user at a time.

As an argument it gets an object with fields:

  • interval — interval during which user response is expected.
  • targetState — state into which the transition will be performed if the response from the user does not come.

The wait interval can be a number, denoting the number of seconds, or a string in the format defined by a regular expression like:

(\s*(?<h>\d{0,2})\s*(hours|hour|h))?(\s*(?<m>\d{0,2})\s*(minutes|minute|min|m))?(\s*(?<s>\d{0,2})\s*(seconds|second|sec|s))?\s*

Examples for interval:

interval: '5 seconds'
interval: '1 sec'
interval: '3s'
interval: '1 min'
interval: '1 minute'
interval: '10 minutes'
interval: '1 hour'
interval: '10 hours'
interval: '3 min 1 sec'
interval: '1h5m3s'
How to use
script: $reactions.timeout({interval: '5 seconds', targetState: '/Start/timedout'});
script: $reactions.timeout({interval: 10, targetState: './timedout'});
script: $reactions.timeout({interval: '2s', targetState: '../end'});