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

...

One or more workflow triggers can be added to a custom workflow to listen for a workflow event. These triggers can be used to

...

undertake actions,

...

such as sending a custom notification.

Comala Document Management workflow triggers are

...

added to a custom workflow using the workflow builder visual editor

...

.

Info

The code editor supports reducing errors when writing JSON code. It includes autocomplete features and JSON dropdown options to add properties, values, and data, including trigger events, conditions, and actions.

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

If added to a workflow using the code editor, only one overall "triggers": is required in the JSON code. You do not have to add the "triggers": JSON element when adding the JSON trigger notation in the workflow builder visual editor. Workflow builder adds this automatically after saving the workflow.

Adding a trigger using the visual editor

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

Open workflow builder in the app space settings:

  • choose Edit Workflow

  • select Use Visual Editor in the Actions menu

cdmc_documentmanagementdashboard_baw_wf_copy_visualeditor_highlighted_icon.pngImage Removed

In the workflow builder visual editor

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

cdmc_wf_builder_editworkflow_bawcopy.pngImage Removed
  • expand the Advanced tab in the Edit Workflow panel

Image Removed
  • add the JSON code trigger markup to the Triggers dialog box

Image Removed

Do not add the opening JSON "triggers": notation when adding the JSON trigger. This is automatically added to the workflow JSON template when saving the workflow.

  • choose Apply to save the added JSON code trigger

  • choose Save to update the workflow

  • choose Exit to return to the app space settings

The custom workflow is updated in the app space settings.

Trigger validation

The visual editor validates the added JSON code

  • checks the JSON format

  • checks inconsistencies in the trigger with the workflow, for example, in referenced state names

An error in the JSON code format or an inconsistency with the workflow prevents the trigger from being applied in the visual editor or saved to the workflow in the app space settings.

If the format check fails

  • a Wrong format breadcrumb is displayed after adding the trigger to the dialog box

  • the Apply option is disabled

cdmc_wf_builder-trigger_wrongformat_breadcrumb.pngImage Removed
Info

Format validation errors can be caused by unrecognized characters (such as parentheses characters) or a missing paired bracket in the JSON code.

If there is an inconsistency with the workflow, a validation error message is displayed when using Save in the visual editor.

json_editor_error_validation.pngImage Removed

The validation error can be caused by the trigger using a state name that is not in the workflow. Validation fails, for example, if the name of the workflow element (state, approval) includes differences such as lower or uppercase characters or is not present in the workflow.

See the following for further details of these validation checks:

Filter by label (Content by label)
showLabelsfalse
maxCheckboxfalse
showSpacefalse
reversefalse
cqllabel = "tblesht_trigger" and space = currentSpace ( )

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 causes a workflow approval transition to the Rejected state.

Image Removed

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

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

...

Related Pages

User Guide

JSON Triggers

...

An event for the trigger to listen for is selected using the dropdown menu. An optional event condition can also be selected using a dropdown menu. One or more actions for the trigger are added using the Add Action dialog box.

Triggers added to the workflow are displayed in the workflow panel in the visual editor.

...

Add a workflow trigger

Table of Contents
minLevel3
maxLevel6
outlinefalse
typeflat
separatorpipe
printabletrue

To add a workflow trigger to a custom workflow, in the app space settings

  • open workflow builder visual editor for the custom workflow

...

  • open the trigger editor by choosing either

    • Add Trigger in the left-hand workflow panel

    • the + Trigger button in the right-hand navigator panel

...

Event

The trigger only listens for a single event.

  • select a single event for the trigger using the Event dropdown menu

...

Info

Scroll down to view the available workflow trigger events.

Condition

One condition for the event can be added. Adding a condition is optional.

  • if required, add an event condition using the Condition dropdown menu

...

When adding the State condition, you must add the value of the workflow state. A workflow state for the current workflow is selected using the dropdown menu option.

...

The Is Initial State and Is Final State are each a condition with a boolean value of true or false.

...

Actions

A workflow trigger must have at least one action undertaken when the event occurs and any set condition is met.

You can add one or more trigger actions using the Add Action option.

  • choose Add Action to open a dialog box to select a trigger action

...

  • select a trigger action using the Actions dropdown menu

...

Info

Some actions, such as Set Message and Send Email, include mandatory parameters that must be specified for the action to function correctly. These parameters are configured using the dialog box.

  • add any parameter values for the action

...

Mandatory parameters are marked with a red asterisk *. To add the action to the workflow trigger, you must add the values for these parameters.

  • add the values for any parameters

...

  • choose Add to include the action in the workflow trigger

...

Info

If required, choose Add Action to add more actions for the trigger.

  • choose Add to add the trigger to the workflow

...

You can view the JSON code for the added trigger by toggling from the visual editor to the code editor.

...

Editing a trigger

A trigger can be edited to change the event, condition, or add or remove actions.

  • select the trigger in the workflow panel to open the Edit trigger dialog box

...

For example, the On state changed trigger listening for the change to the Approved state.

...

In the above trigger, additional actions have been added:

  • Clean Messages

  • Remove Restrictions

Actions are executed in the listed order.

You can drag each action to change the order of the actions in the list.

...

You can highlight an added action and choose X to remove it from the trigger.

...

Adding multiple triggers

Choose +Triggers to open the trigger editor to add an additional trigger to listen for a different event or event and condition.

...

This workflow trigger actions a change of state on a reviewer rejected decision. When there are multiple approvers, the trigger fast-tracks a rejected decision from a single reviewer.

All workflow triggers added to a workflow are displayed in the workflow panel.

...

Related Pages

Triggers

Child pages (Children Display)
depth1
allChildrenfalse
style
pageWorkflow trigger
first3
sortAndReverse