Search code examples
triggersviewclearcase

Does ClearCase have a trigger for snapshot views?


It seems like the Trigger extensibility feature in ClearCase has to be attached to a VOB by the owner. I would like something similar that I can administer myself for my local snapshot views. Does such a feature exist?


Solution

  • There is no "local trigger" per view in ClearCase.

    When you create a trigger (with mktrtype), you can:

    • attach it to a VOB
    • check if you are in a snapshot view by reading the environment variable CLEARCASE_SNAPSHOT_PN

    (All operations executed in a snapshot view) The path to the root of the snapshot view directory in which the operation that caused the trigger to fire took place.

    • check if you are in a snapshot view by reading the environment variable CLEARCASE_VIEW_KIND

    (All operations) The kind of view in which the operation that caused the trigger to fire took place; the value may be dynamic, snapshot, or snapshot web.

    • checking if you are in the right view by reading the view tag CLEARCASE_VIEW_TAG

    (All non-UCM operations; for UCM, all deliver and rebase operations and setactivity) View tag of the view in which the operation that caused the trigger to fire took place.

    • check if the trigger should execute itself for the right user: CLEARCASE_USER

    (All) The user who issued the command that caused the trigger to fire; derived from the UNIX or Linux real user ID or the Windows user ID.


    With all those elements, you could write a script able to call a custom script versioned in the snapshot view, which means by convention (in a path defined in advance) you could define a script managed by the user for a snapshot view.

    But unless you try that kind of indirection, there is no local trigger proposed directly by ClearCase.