About triggers

Build 1501 on 14/Nov/2017  This topic last edited on: 21/Mar/2016, at 18:34

Triggers represent a mechanism to execute actions when something changes in the system.

To define a trigger it is necessary to specify what to monitor in the system and the action to perform when the monitored condition 'fires'.

Monitoring

The possibilities for monitoring are following:

Object modifications trigger

An object modification trigger fires when one or more specified objects gets modified.

Object attribute trigger

An object modification trigger fires when the specified attribute of the specified object gets modified.

Referencing object trigger

A referencing object trigger fires when objects are added or removed from a specified 'container' - e.g. a folder, calendar, edition etc, or when an object is modified (version 1.5). Thus, the definition specifies the container object (e.g. folder, calendar, edition etc) and the attribute will be folderObject.folderRef etc.

Check-out/check-in trigger

Check-out/check-in trigger fires when a specific object is checked-out or checked-in. Optionally it is possible to specify also an attribute of the object - and in this case the trigger fires only when the object is checked-out or checked-in for the access class of the specified attribute.

Check-out and check-in triggers pass to the associated workflow - or send to the client that requested an alert - the information about the check-out state of the object after the check-out or check-in has been executed.

Object indexing

Trigger fires every time objects are full-text indexed by Back4.

Referencing objects indexing

Trigger fires when objects referencing 'container' objects are full-text indexed by Back4. A referencing indexing trigger definition specifies (optionally) the container object and the attribute that defines the 'containment' - e.g for a folder the object will be the one of the folders and the attribute will be 'folderObject.folderRef'.

There is a new trigger mode: 'ReferencingObject' - it defines triggers that fire when any object referencing the specified object via the specified attribute is modified in any way and still references the specified object after the modifications - i.e. it is not 'sent' to a different container

 

E.g.

cmd4 triggerwf -ids 31860 -mode ReferencingObject -attr folderObject.folderRef -name TestTrigger-username xxxx -password yyyy

where PPPP is the path of the archive, xxxx is the name of a GN4 user who can logon to system with sufficient permissions to perform this operation and yyyy is the password.

Note: the above connects to the default connection: should you want to specify the connection or server name, see cmd4 examples.

creates a trigger that executes the workflow "TestTrigger" every time any object referencing the folder with id 31860 is modified.

Actions

There are two possible actions associated with triggers: the execution of a workflow or sending an alert.

When the system detects that a workflow execution trigger fired it schedules the workflow for immediate execution in background by Back4, passing to it the object whose modification caused the trigger to fire and some additional parameters.