Trigger events
Overview
A trigger can be set to listen for a named event in the workflow.
When the workflow "event"
occurs, the trigger checks that any required "conditions"
have been met.
If the set conditions are met for the named event, one or more trigger "actions"
occur.
Event
A trigger can be set to listen for the following events.
You can add multiple triggers, each with a different "event"
. However, you can only include one of each type of event in a single "event"
in the trigger.
For example, when adding the change of state
{"event": "on-change-state", "actions":[............]}
Any other use of this event must be filtered to a specific occurrence using a condition:
{"event": "on-change-state","conditions":[{"state":"Approved"}], "actions":[............]}
Once the event occurs and conditions are met, one or more set trigger actions occur.
Example "on-expire"
event
A space administrator can use the visual editor or the code editor to add one or more triggers to a workflow.
In the visual editor:
You can use the following options to add the workflow trigger:
select an Event
add a Condition
include one or more Actions to execute automatically
The workflow trigger listens for a single event selected from a dropdown menu.
In the code editor:
The code editor includes JSON schema to help support writing the trigger:
color coding to easily distinguish property names, values, and different data types
autocomplete feature
dropdown selectors for available properties
The JSON schema includes an option to add a single event for the trigger.
Once you have added the event attribute, you can select the event name from a JSON schema help box.