Triggers
Triggers automatically execute a set of actions after specific events and under specific conditions. They are evaluated for every create, update, and delete event that occurs in Sitecore Content Hub and are executed asynchronously to prevent delays.
A trigger consists of:
-
The conditions under which trigger actions are executed.
-
The actions that the trigger executes.
When a trigger reacts to an event, it only executes its actions if its conditions are met.
To create a trigger:
-
On the menu bar, click Manage .
-
On the Manage page, click Triggers.
-
In the upper-right corner of the application window, click New trigger.
-
On the trigger details page, configure the General, Conditions, and Actions tabs as explained below.
-
Click Save to activate the trigger.
Event listening
If you modify a relation between two entities, the change event is only produced on the changed entity's side. In other words, if a trigger condition is set to observe an entity's relation, the trigger only executes if the relation is updated from the referenced entity's side. This is important when configuring a trigger condition.
For example, to configure a trigger that executes each time an asset is removed from a collection, you set the trigger condition to observe the M.Asset entity definition, specifically the CollectionToAsset relation. In this case, if the asset is removed from the collection from the asset's side, the trigger executes; however, if the asset is removed from the collection's side, the trigger doesn't execute.
For a trigger to execute when an asset is removed from a collection, regardless of the source of change, the trigger condition must include both the M.Asset entity definition and the M.Collection entity definition, each specifying the CollectionToAsset relation.