Overview
The trigger
macro listens for Events, then, after filtering and confirming any prerequisite requirements, performs the actions contained in the macro body.
Where to use it?
Optional.
One or more trigger
macros can be put in a workflow macro.
can be added as markup in workflow builder
if added using the markup editor, the trigger(s) must be placed after the state macro(s)
Parameters
Parameter | Required | Default | Notes | Ver |
---|---|---|---|---|
unnamed first parameter |
| The event to listen to – see: Events | ||
macro body | One or more actions to process when the trigger is activated – see: Actions | |||
| The description for the trigger:
| 5.7+ | ||
Optionally apply further conditions to filter events – see: Conditions | ||||
| |
Filter to a specific
| ||
|
| Only applies to
The primary use of this parameter is to perform one-time initialisation actions for a given piece of content. For example, on the first review of a piece of content you might want to send out additional emails, or set some metadata. Filter by labelThere are no items with the selected labels at this time. | 3.0.1+ | |
| Only applies to Value is the name of the label that was added or removed. | |||
| If this value is set, then a custom event identified by this value will be published when the actions are executed, and will contain a flag | |||
|
|
The name of the parameter to monitor. Filter by labelThere are no items with the selected labels at this time. | ||
|
| Only applicable to for the following events:
| ||
|
| Should actions be queued?
If there is a chance that actions will take a long time to process, for example when remote publishing content, they should be queued so the end user doesn't have to wait for them to finish before continuing with their work. | ||
|
|
Filter to a specific active state of the workflow.
| ||
|
| This setting is used to listen for the outcome of a custom event (set by the | ||
|
|
Filter to a specific Filter by labelThere are no items with the selected labels at this time. |
Example
The workflow has two triggers with each trigger is listening for a different approval event for the Content Review approval in the Review state.
These are
a
pageapproved
event triggera
pagerejected
event trigger
{workflow:Example Trigger Workflow} {state:Editing|submit=Review} {state} {state:Review|approved=Published|rejected=Editing} {approval:Content Review} {state} {state:Published|final=true|updated=Editing} {state} {trigger:pageapproved|approval=Content Review} {set-message:style=success}This page has been approved!{set-message} {trigger} {trigger:pagerejected|approval=Content Review} {set-message:style=error}This page was rejected, please make requested changes.{set-message} {trigger} {workflow}
You can view and edit a workflow in workflow builder.
In workflow builder, the trigger is added to the workflow using markup.
Once added to the workflow each trigger is displayed as a non-editable workflow Rule.
Rules simply displays the event and event filter for each trigger. To change a trigger you must edit the trigger markup.
All examples
-
Add workflow review information to a header for inclusion in a page export — Use the workflow to add a header containing details of the workflow review to comply with a records retention policy for exported approved page PDFs
-
-
Adding page activity to email — Include page activity report, or a link to it, in custom email notifications
-
Dynamic page header using a metadata value and triggers — Use a trigger to display a different page header for each state in the workflow. Page header content is set as a metadata value.
-
How can I fast-track a single rejection or a single approval decision — How to require everyone to approve, but only need one person to reject
-
Message notification styles — Test the
style
parameter of the{set-message}
macro -
-
-
Require Parameters on a state transition — Require workflow parameter values to be set before moving into a workflow state.
-
-
-
-
State expiry dates — Using state expiry dates, defining them with metadata, and making them editable
-
-
-
Use attachment events in workflow triggers — Triggering events when attachments are created, updated, or removed.
-
Use blog post events in a workflow trigger — Workflow events associated with blog posts
-
Using set-message and metadata to display different information for the draft and published content — Using the
view
parameter of theset-message
macro to display a different metadata when users view the draft or published versions