Triggers

Triggers can be created within Matrix to automatically perform tasks for you.

Some common triggers are:

  • Creating an image variety when an image asset is created.

  • Setting the status of a user account to live when it is created.

  • Creating a future status job of up for review for a user account so that the user is forced to change their password.

  • Releasing the locks that a user has on an asset when they log out of the system.

  • Stopping an asset from being created within a section of the system.

  • Clearing the cache of an asset when it has been changed.

  • Emailing an administrator when a change has been made to an asset so that the foreign language version can be updated.

Each trigger is made up of three parts – an event, condition and action. An event defines the actions that the trigger is listening for, for example when an asset is created or when the status of an asset is changed. When this event occurs within the system, the trigger is fired and the conditions are checked. These conditions need to be meet before the action is performed.

Table 1. Example
Event Condition Action

An asset is created.

The asset is an image.

Set the asset to Live.

Trigger manager

The trigger manager

For each trigger that you want to create, you need to create and set up a Trigger asset under the trigger manager, which is available under the System Management folder in the asset tree (this can only be accessed by the root user or a system administrator). Read the Adding triggers documentation for more information on how to create triggers.

Further management of these triggers can be performed on the Details and Batching screen of the trigger manager. Read the Batching section below for more information on the Batching screen.

Details screen

The Details screen allows you to enable or disable the trigger manager. By default, the trigger manager is enabled.

Enabling the trigger manager

The trigger manager needs to be enabled before Matrix will fire any triggers:

  1. Go to the Details screen of the trigger manager.

  2. In the trigger manager status field, select Enabled.

  3. Click Save.

The trigger manager status field on the Details screen

Batching

The Batching screen of the trigger manager allows you to execute the triggers on a section of your system as if a trigger event had occurred. It is ideally used when you have set up a new trigger to perform a certain action but you would like to perform this action on an existing set of assets.

For example, if you have just created a trigger to create different image varieties when an image asset is created, you can force the trigger to fire and create these varieties for the existing images.

To force a trigger to fire, fill in the following fields:

Target IDs

Select the trigger(s) that will be executed when the specified event(s) is replicated. If this field is left blank, all applicable triggers will be run. To select further trigger, click the More…​ button - additional fields will appear on the screen.

Target asset

Select a specific asset or root node section of your system that you want to fire the trigger(s) on. This allows you to restrict the firing of triggers to a specified asset, for example, a particular site.

Children

Checking this field will include all child assets of the specified target asset when defining the section of the system to fire the trigger(s) on.

Events

Select the trigger events that you want to replicate the occurrence of, firing any applicable triggers specified in the Target IDs field. For example, if you want to execute a trigger that is configured to fire when an asset is created or when its status is changed:

  1. Select the Asset created and Status changed events in this field.

  2. Click Save once you have entered the required information; the designated trigger(s) (as defined in the Target IDs field) that are 'listening' for the selected trigger events will fire on the assets specified in the Target asset field.

© 2015- Squiz Pty Ltd