State
The state a process that's instantiated from this scenario can be in.
All the possible states are described in the
states
section. Each state describes through which action
it can transition to a new state
YAML
JSON
:initial:
action: complete
transitions:
- response: ok
transition: :success
- response: cancel
transition: :failed
{
":initial": {
"action": "complete"
"transitions": [
{
"response": "ok",
"transition": ":success"
},
{
"response": "cancel",
"transition": ":failed"
}
]
}
}
or
YAML
JSON
:initial:
actions:
- complete
- next
transitions:
- action: complete
transition: :success
- action: next
transition: next-state
{
"initial": {
"actions": [
"complete",
"next"
],
"transitions": [
{
"action": "complete",
"transition": "success"
},
{
"action": "next",
"transition": "next-state"
}
]
}
}
https://specs.letsflow.io/v0.2.0/scenario/schema.json#state
A short title for the state.
A long description for the action that is shown when if the state is current or part of the golden flow.
Instructions that can be specific per actor. This is an object where the keys correspond with the actor keys.
YAML
JSON
instructions:
employee: Fill out this form
employer: Waiting for employee to fill out the form
{
"instructions": {
"employee": "Fill out this form",
"employer": "Waiting for employee to fill out the form"
}
}
An array with the keys of all actions that may be performed in this state.
The order of the actions matter, especially for automated actions. The first available action is considered to be the default action. This action is followed when determining the golden flow.
If there is only one action available action, you may replace the
actions
property with an action
property with a single action key as value.https://specs.letsflow.io/v0.2.0/scenario/schema.json#transition
A transition defines the change from one state to the next. State transition definitions are more dynamic than the transition you can set in the response object.
Transitions are evaluated in order. If multiple transitions apply, only the first one is used.
Key of the action that must be performed for this transition to be selected.
Key of the response for which this transition would be selected.
A boolean that must be true for the transition to be selected. This is typically a data instruction.
Key of the state where to transition to.
Last modified 3yr ago