null


Skip to end of banner
Go to start of banner

JSON Triggers

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Overview

You can use workflow triggers to help automate your documentation process and flexibly respond to workflow events. For example, you can use a trigger to automatically send an email when a page is submitted for review.

Triggers can be added to

  • listen for workflow events

  • check for a set condition or conditions to be met for each event

  • set one or more actions for each event

You can include one or more workflow triggers in a custom workflow. Triggers are added as JSON using workflow builder or the JSON editor and can be used to create a more flexible and responsive workflow in Comala Document Management for Cloud.

Triggers

A JSON trigger contains three different properties

Multiple triggers can be added to a workflow. A trigger for an event must include at least one or more actions.

You can /wiki/spaces/CDMCD/pages/614010813.

cdmc_workflowbuilder_viusal_editworkflow_addtrigger_withvisualworkflowdiagram.png

Example

In a 4 state workflow, you might want the workflow to move immediately from a Rejected state to a more proactively named Triage state, rather than waiting for a user to manually transition the content.

o

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.

o

The trigger can be added to a workflow using workflow builder but it must be added in JSON markup notation.

"triggers":
[
	{"event":"on-change-state",
	"conditions":
	[
		{"state":"Rejected"}
	],
	"actions":
	[
		{"action":"change-state",
			"state":"Triage"}
	]}
]

If you want to add this trigger to a workflow using workflow builder, copy and paste the JSON code format (without the opening "triggers": JSON markup notation) to the Triggers dialog in the Edit Workflow panel in workflow builder.

Each action is enclosed in a pair of curly brackets { ... }. Multiple actions are added as a comma-separated list. This list of actions is then enclosed in a pair of square brackets [ ...].

For example:

  • "actions":[{"action":"action1"}, { "action": "action2"}]

  • "actions":[{"action":"change-state", "state":"Triage"}, {"action":"set-message", "type":"warning", "body":"Rejected content, triage actions required", "mode":"autoClose"}]

Each trigger action can have a number of mandatory elements and optional elements depending on the action.

Trigger action and page workflow document activity

For audit purposes, both the rejected decision transition to the Rejected state and the subsequent trigger transition to Triage are recorded in the page document activity.



  • No labels