Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel6
outlinefalse
typeflat
separatorpipe
printablefalse

Overview

Excerpt

One or more "conditions" can be set for a trigger for a named event in the workflow.

When the named workflow event occurs, the trigger checks that any required condition is met , and if met sets one or more actions.

Conditions

condition must be met

Adding a condition to a workflow trigger is optional.

However, when you add a condition to the trigger, it becomes a requirement for the trigger to perform execute the specified action(s). Available

The available conditions are

  • state - "conditions":[{"state": "(string value)"}]

  • final - "conditions":[{"final":(boolean true/false)"true}] or “conditions":[{"final":false}]

  • initial -"conditions":[{"initial": (boolean true/false)

If "final" condition is added together with another condition to an event, the condition is evaluated as an OR function.
  • true}] or "conditions":[{"initial":false}]

The "initial" condition can be constrained to a named state in the workflow using the "state" condition.

info

Boolean condition values true and false are added in the code editor WITHOUT encompassing quotation marks, for example, "final":true

or

and "final":false.

JSON trigger

Trigger conditions

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "jsontriggercondition" and space = currentSpace ( )

Example “on-change-state" event

Insert excerpton-change-state eventon-change-state eventnopaneltrueExample “on-approve" event

For example, in the example trigger below, the state condition constrains the trigger to the change of state to the Rejected state.

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

A space administrator can use the visual editor or the code editor to add one or more triggers to a workflow.

Insert excerpt
Trigger events
Trigger events
nameevent_visualeditor
nopaneltrue

The workflow trigger listens for a single selected event. You can constrain this by adding an optional condition from a dropdown menu.

cdmc_visualeditor_extract_condition_dropdownmenu.pngImage Added

You must add a value for the selected Condition.

For example, you must choose one of the states from the workflow using the dropdown menu for the State condition.

cdmc_visualeditor_extact_trigger_condition_state_approved_dropdownmenu.pngImage Added

In the code editor:

cdmc_coded_editor_workflowtrigger_on-change-state_set-message_highlighted.pngImage Added

 The code editor includes

  • color coding to easily distinguish property names, values, and different data types

  • autocomplete feature

  • dropdown selectors for available properties and attributes

The JSON schema consists of an option to add conditions for the trigger.

cdmc_codeeditor_triggers_event_eventtype_conditions_schema.pngImage Added

Once you have added the conditions attribute, you can select the condition from a JSON schema help box.

cdmc_codeeditor_trigger_conditions_state_selected_JSON_schema.pngImage Added


Example "on-approve" event with "state" condition

Insert excerpt
on-approve event
on-approve event
nopaneltrue