Trigger conditions
Overview
One or more "conditions"
can be set for a trigger event in the workflow.
When the named workflow event occurs, the trigger checks that any required condition is met and sets one or more actions.
Conditions
Adding a condition to a workflow trigger is optional.
However, when you add a condition to the trigger, it becomes a requirement for the trigger to execute the specified action(s).
The available conditions are
state -
"conditions":[{"state": "(string value)"}]
final -
"conditions":[{"final":true}]
or“conditions":[{"final":false}]
initial -
"conditions":[{"initial":true}]
or"conditions":[{"initial":false}]
The "initial"
condition can be constrained to a named state in the workflow using the "state"
condition.
Boolean condition values true
and false
are added in the code editor WITHOUT encompassing quotation marks, for example, "final":true
and "final":false
.
Trigger conditions
For example, in the example trigger below, the state condition constrains the trigger to the change of state to the Rejected state.
"triggers:"
[
{"event": "on-change-state",
"conditions":
[
{"state": "Rejected"} ],
"actions":
[
{"action":"set-message", "type":"info", "title":"Hey My Wonderful design and Tech Team", "body":"We have some work to do ... it was rejected!!!"}
]
}
]
A space administrator can use the visual editor or the code editor to add one or more triggers to a workflow.
The workflow trigger listens for a single selected event. You can constrain this by adding an optional condition from a dropdown menu.