Overview

Triggers can be used to create a more flexible and responsive workflow in Comala Document Management for Cloud.

Triggers can be added to

  • listen for a workflow event
  • check for a set condition or conditions to be met for the event
  • set one or more actions for each event

Triggers are added as JSON using workflow builder or the JSON editor.


Triggers

A JSON trigger contains three different properties

  • JSON Trigger eventsA 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 conditionsOne 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 actionsOne 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.


For each event you can set one or more 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.

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