State

The state a process that's instantiated from this scenario can be in.

The scenario defines a finite state machine. Each state describes through which action it can transition to a new state.

Simple state

A simple state has a single transition specified by the on or after and the goto property.

Optionally you can limit who can perform the action in this state using by. Use an array for by if multiple actors are allowed to do the action.

initial:
  on: complete
  by: client
  goto: (done)
wait:
  after: 24 hours
  goto: main

The on, after, by, goto, and log properties that can be added to simple states are described in the documentation of transitions.

State with multiple transitions

A state can define multiple transitions. The transition depends on the action being performed in that state or by the actor who performed it.

initial:
  title: Waiting in the lobby
  description: Participants can join until the organizer starts
  transitions:
    - on: join
      by: participant
      goto: ~
    - on: join
      by: organizer
      goto: start
    - on: cancel
      by: organizer
      goto: (canceled)
    - after: 10 days
      goto: (expired)

End states

End states are states wi

Properties

title

string

A short title for the state.

description

string or data function

A detailed description of the action, displayed when the state is either the current state or part of the prediction.

transitions

array of transitions

Transitions from this state to the next.

Last updated

Was this helpful?