The mktrigger command attaches a trigger to one or more elements or UCM objects. An attached trigger fires (executes the trigger action) when the element (or any of its versions) or the UCM object is involved in an operation specified in the trigger type definition. For example, if a trigger type is defined to fire on a checkin command, the attached trigger fires when the specified element is checked in. If a VOB operation causes multiple attached triggers to fire, the order of firing is undefined.
By means of a trigger inheritance scheme, newly created elements (but not existing elements) inherit the triggers that are currently associated with their parent directory element. But a simple inherit-all-triggers strategy does not suit the needs of many sites. For example:
To enable such flexibility, each directory element has two independent lists of trigger types:
By default, attaching a trigger to a directory element updates both lists:
cmd-context mktrigger trig_co proj
Added trigger "trig_co" to inheritance list of "proj".
Added trigger "trig_co" to attached list of "proj".
Each file element has only an attached list:
You can use the –ninherit and –nattach options to control exactly which triggers on a directory element are inherited. (And you can make adjustments using the –ninherit and –nattach options of the rmtrigger command.)
The UNIX system and Linux examples in this section are written for use in csh. If you use another shell, you may need to use different quoting and escaping conventions.
The Windows examples that include wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.
In cleartool single-command mode, cmd-context represents the UNIX system and Linux shells or Windows command interpreter prompt, followed by the cleartool command. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt.
cmd-context mktrigger trig1 hello.c
Added trigger "trig1" to attached list of "hello.c".
cmd-context mktrigger -force trig1 util.c
Added trigger "trig1" to attached list of "util.c".
cmd-context mktrigger trig1 src
Added trigger "trig1" to attached list of "src".
Added trigger "trig1" to inheritance list of "src".
cmd-context mktrigger -nattach trig1 release
Added trigger "trig1" to inheritance list of "release".