Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
maxLevel2
minLevel2
absoluteUrltrue
excludeRelated Pages
typeflat
separatorpipe

Overview

Triggers that listen for workflow events can be added to a workflow. These triggers can be used to create actions, for example, custom notifications.

JSON triggers Triggers are used in the Content Expiry workflow and the Quality Management System workflow.

Comala Document Control triggers are created using JSON markupcode and can be added to a workflow using the workflow builder visual editor or the code editor.

Related pages

Child pages (Children Display)
pageJSON Triggers

Trigger JSON

trigger

code format requirements when adding to

workflow builder

For example

Code Block
titleJSON Trigger format for workflow builder

visual editor

Example Trigger notation
Code Block
"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
(info) Only

Only one overall "triggers":

" will

 will be required in the JSON code if added to a workflow using the

JSON  In

When adding the JSON trigger notation in workflow builder visual editor you do not have to add the "triggers":

"

 JSON element. Workflow builder will add this automatically after saving the workflow.

Adding a

JSON

trigger using workflow builder

The trigger JSON code is added using the workflow builder visual editor.

In

Open workflow builder in the space settings Document Control dashboard

open workflow builder. Choose

  • choose Edit Workflow

  • select Use Visual Editor

Image Added
Info

The workflow builder visual editor will open for the current space workflow.

Image Removed

  • choose the workflow name in the workflow panel to open the Edit Workflow panel

Image Added
  • expand the Advanced tab in the Edit Workflow panel

Image AddedImage Removed
Info

Example JSON triggers can be copied, pasted and edited to the Triggers

dialogue Copy

dialog box.

Expand the >Advanced tab.
  • copy and paste the JSON code trigger markup to the Triggers

dialogue box.
Image Removed
Choose
  • dialog box

Image Added
Info

 Workflow builder visual editor does not allow the workflows installed with the app to be overwritten. All edits will be saved as a (Copy) of the original workflow and you may need to edit/amend the workflow name to save changes.

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 code trigger

.
Choose
  • choose Save to update the workflow in workflow builder

.
Choose
  • choose Exit to return to the space settings

and add the customized workflow
Image Added

The edited custom workflow is

  • added to the dashboard as the current space workflow

.
(info) 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 Manage Workflows

Tip

A custom workflow can also be deleted permanently from a space using the Remove Workflow option in the Edit Workflow dropdown menu.

Elements of the custom message notification trigger

In this example, the added trigger will

Listen for a state change event to the named state in the event condition - the Rejected state

Code Block
{"event": "on-change-state",
	"conditions":
	[
		{"state": "Rejected"}
	]

For example, a reviewer choosing to reject the content

and the workflow transitions

causing a workflow approval transition to the Rejected state.

Image Removed
Image Added

action

Action a custom notification once the event occurs, displaying an on-screen message for users who view the content

Image Removed

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!!!"}