Triggers
A JSON trigger contains three different properties
- JSON Trigger events — A trigger can be set to listen for a named event in the workflow. When the workflow event occurs the trigger will check that any required conditions are met, and if met set one or more actions.
- JSON Trigger conditions — One or more conditions can be set for a trigger for a named event in the workflow. When the named workflow event occurs the trigger will check that any required condition is met, and if met set one or more actions.
- JSON Trigger actions — One or more trigger actions can be set for a named event in the workflow. When the workflow event occurs the trigger will check that any required condition is met, and if met the action(s) will occur.
Multiple trigger events can be added to a workflow.
A single trigger event will include one or more actions.
Example
In a 4 state workflow you might want the workflow to move from a Rejected state to a more proactively named Triage state.
You can use a trigger to listen for the state change event to the Rejected state and set the trigger action to immediately transition to the Triage state.
The trigger must be added as JSON markup
"triggers": [ {"event":"on-change-state", "conditions": [ {"state":"Rejected"} ], "actions": [ {"action":"change-state", "state":"Triage"} ]} ]
There are a number of events that can be used in a trigger.
- Please see JSON Trigger events
For each event you can set one or more conditions.
- Please see JSON Trigger conditions
Multiple trigger actions can be added to a single event, for example
-
"actions":[{"action":"action1"},
{ "action": "action2"}]
The actions are added as a comma-separated list, each action enclosed in curly "{" brackets. The list of actions is then enclosed in square brackets.
Each trigger action can have a number of mandatory elements and optional elements.
Please see JSON Trigger actions
Trigger action and page workflow history
For audit purposes, both the rejected decision transition to the Rejected state and the subsequent trigger transition to Triage are recorded in the page workflow history