Adding and Maintaining Triggers

The Trigger asset allows you to create Triggers within Squiz Matrix. Each Trigger will “listen” for an event, check the conditions for that event and perform an action. A Trigger asset can only be created under the Trigger Manager in the Asset Map. If you try to add a Trigger asset anywhere else in the system, a warning message will appear.

Adding a Trigger

When you add a Trigger, the Create new Trigger screen will appear on the right hand side. Set up the event, conditions and actions for the Trigger on this screen (for more information about each of these refer to the sections below). Once you have done this, click Commit.The Trigger will be added as an asset under the Trigger Manager.

Details Screen

The Details screen of a Trigger allows you to add and remove events, conditions and actions.

Details

The Details section allows you to enable the Trigger, as well as enter a Name and Description.

Details section of the Details screen
The Details section of the Details screen 

The fields available are as follows:

  • Status: select whether or not to enable the Trigger. If the Trigger is not enabled, it will not fire when the event occurs. By default, when a Trigger is created it is Disabled. Once you have set up the Trigger, select Enabled from the list provided.
  • Blocking: select whether or not the Trigger should block the event and any subsequent Triggers from running if it fails. For example, if the Trigger fired when the Status of an asset changed and it failed to complete the actions, the Trigger would stop the Status from being changed and stop other Triggers from running.
  • Name: enter a name for the Trigger. This field is required when creating a new Trigger.
  • Description: enter a description of the Trigger.
  • Category: enter the category that the Trigger belongs to. When you enter a category, a Folder with this name is created in the Asset Map under the Trigger Manager and the Trigger is stored under that Folder. You can group multiple Triggers together in the same Folder by using the same category name. To create multiple categories, separate each Folder name with a /. For example Folder1/Folder2 will create two Folders, with Folder2 a child of Folder1. To move Triggers between Folders, change the category name.

Events

This section allows you to select which types of events the Trigger is “listening” for.

Events section
The Events section of the Details screen 

When an event that is selected occurs, the conditions of the Trigger will be checked to determine whether or not the actions specified need to be performed. For more information about each of the events that are available, refer to the Trigger Events chapter in this manual.

Tip: If no events are selected, the Trigger will fire when any event occurs within the system. This can affect the performance of your system and at least one event should be selected. On other hand, selecting too many events can also affect the performance of your system.

Conditions

This section allows you to add conditions to the Trigger. These conditions will be checked when the event that is selected occurs. If the conditions are true, the actions specified will be performed. The Conditions section of the Details screen is shown in the figure below.

Conditions section
The Conditions section of the Details screen

To add a new condition to the Trigger, select the condition from the list provided and click Commit. Additional fields will appear in the Conditions section. For example, the figure below shows the Asset Status condition in the Conditions section.

Condition section with fields
The Asset Status Trigger Condition

A condition can be inverted be selecting the Inverse this condition field. When a condition is inverted, the inverted logic of that condition will be used. For example, the Asset Status condition can be set to check if the Status of an asset is Live. This condition would match on all assets that are Live. If this condition was inverted, however, it would match on assets that were NOT Live, such as Safe Edit or Archived assets.

Please note that as the inverted logic of a condition will likely be met in a large number of scenarios, as such, it is recommended to use this option sparingly as system performance may decrease.

You can add multiple conditions to a Trigger. To do this, select the new condition in the Add new Condition type field and click Commit. Please note that some conditions can only be added once, hence will not appear in the list if they have already been added. For more information on each of the conditions, refer to the Trigger Conditions chapter in this manual. When you add a new condition, it will appear at the bottom of the Conditions section. If you add a condition, but do not change its settings, it will automatically fail.

Tip: When an event is fired, the configured conditions will be checked in the order they are presented on the Details screen of the Trigger. If these conditions pass, the set action(s) will be executed.
 
Because of this, it is recommended that you list conditions based on their expected processing time. Conditions that work on checking exact values (such as a specific Status or tree location) should be listed above conditions that check against a range of values, which generally take longer to process (such as all Page type assets).
 
This will allow the collection of assets being checked to be filtered down before going through some of the more lengthy condition checks. This will customarily lead to an overall performance improvement when checking the conditions of your Trigger.

Actions

This section allows you to add the actions that the Trigger will perform. These actions will only be performed when the conditions specified in the section above are true. The Actions section of the Details screen is shown in the figure below. 

Actions section of the Details screen
The Actions section of the Details screen

To add a new action to the Trigger, select the action from the list provided and click Commit. Additional fields will appear in the Actions section. For example, the figure below shows the Set Status action.

Actions section with fields
 The Set Status Trigger Action

You can add multiple actions to a Trigger. To do this, select the new action in the Add new Action type field and click Commit. For more information on each of the actions, refer to the Trigger Actions chapter in this manual.

The actions configured on a Trigger are executed in the order they are presented on its Details screen. By default, if one of these actions cannot be run, the Trigger will fail and any subsequent actions will not be executed. You can, however, specify an action as Non-Critical; this will allow any remaining actions to continue to be run if another action fails. For example, in the figure above, if the Non-Critical option was selected and the Trigger was unable to set the Status of the asset, the remaining actions configured on the Trigger would still be performed. By default, the Non-Critical option is not selected on Trigger actions.

Triggers within Squiz Matrix have individual transactions for each action configured. This means that, under most circumstances, any actions that have already been executed will not be rolled back in the event that a Trigger fails.

By default, the actions are performed as the user that caused the Trigger to fire (i.e. the currently logged in user). This means that some actions may fail, as the user does not have permission to perform the action. For example, a Backend User with Write Permission to an asset cannot change the Status of the asset to Live. If this user causes a Trigger to fire that changes the Status of an asset to Live, it will not work. However, if the Ignore Permissions option is selected, Squiz Matrix will ignore the access rights the user has been given and perform the action. Hence, the Status of the asset will be changed to Live even though the user cannot do this manually.

Enabling Triggers

Enabled triggers
Trigger assets

By default, when a Trigger is created it is disabled. This means that the Trigger will not fire and hence the actions will not be performed. In the Asset Map, (disabled) will appear at the end of the name of the Trigger asset, as shown in the figure to the right.

To enable a Trigger, go to the Details screen of the Trigger asset, select Enabled in the Status list and click Commit.

Editing a Trigger

Once you have created a Trigger, to add or remove any events, conditions or actions go to the Details screen of the Trigger asset. Each Trigger asset is located under the Trigger Manager in the Asset Map.

Categorising Triggers

By default, when a Trigger is created it will automatically be stored under the Trigger Manager in the Asset Map. If you create a number of different Triggers, this list can be long and it can be difficult to find the Trigger that you want.

Trigger categories
Trigger category folder

To make it easier to find Triggers, you can categorise each Trigger in the Category field on the Details screen. When you enter a category, a Folder will be created under the Trigger Manager in the Asset Map. The name of the Folder will be the name that is entered into the Category field. For example, if you enter Status into the Category field, a Folder called Status will be created, as shown in the figure to the right. To create multiple categories, separate each category name with a /. For example Folder1/Folder2 will create two Folders, with Folder2 a child of Folder1. To move Triggers between Folders, change the category name. 

PreviousNext