JSON trigger format requirements when adding to workflow builder
Example JSON Trigger notation
Code Block |
---|
title | JSON Trigger format for workflow builder |
---|
"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!!!"} ]} ] |
Info |
---|
Only one overall " |
will be required in the JSON code if added to a workflow using the JSON editor. |
When adding the JSON trigger notation in workflow builder you do not have to add the " |
JSON element. Workflow builder will add this automatically after saving the workflow. |
Adding a JSON trigger using workflow builder
The trigger is added using the workflow editor.
Open workflow builder in the space settings Document Control dashboard
choose Edit Workflow
select Edit with the Workflow Builder
Info |
---|
Workflow builder will open for the current space workflow. |
choose the workflow name in the workflow panel to open the Edit Workflow panel
expand the Advanced tab in the Edit Workflow panel
Info |
---|
Example JSON triggers can be copied, pasted and edited to the Triggers |
dialog box. |
copy and paste the JSON trigger markup to the Triggers
Choose
dialog box
Info |
---|
You will need to edit/amend the workflow name to save these changes. Workflow builder does not allow the workflows installed with the app to be overwritten. All edits will be saved as a (Copy) of the original workflow. |
Do not add the opening JSON "triggers":
notation when adding the JSON trigger in workflow builder. This will be automatically added to the workflow JSON template on saving the workflow in workflow builder.
choose Apply to save the added JSON trigger
choose Save to update the workflow in workflow builder
choose Exit to return to the space settings
The edited custom workflow is
added to the dashboard as the current space workflow
You will need to edit/amend the workflow name to save these changes. Workflow builder does not allow bundled workflows to be amended. All edits will be saved as a (Copy) of the original workflow.
This example JSON trigger will
listen for a state change event -available for selection in the workflow picker when choosing Change Workflow
A custom workflow can also be deleted using the Remove Workflow option added to the Edit Workflow dropdown menu.
In this example, the added JSON trigger will
Listen for a state change event to the named state in the event condition - the Rejected state
For example, a reviewer choosing to reject the content
causing a workflow approval transition to the Rejected state.
Action a custom notification once the event occurs, displaying an on-screen message for users who view the content
The on-screen message will be in addition to workflow notification confirming the rejection.
Code Block |
---|
{"action": "set-message",
"type": "info",
"title": "Hey My Wonderful design and Tech Team",
"body": "We have some work to do ... it was rejected!!!"} |