A Better Solution, Inc. - IBM Rational ClearCase Triggers

"Clearcase, Rational, clearCase consulting, ClearCase triggers, Jazz tools consultant, ABS, training, GSA, Rational, IBM, GSA, BM Rational Tools consultant, Clearquest, ClearCase training, CM, scm, ClearCase help, consulting, trainer, training, ClearCase guru, configuration management" "ClearCase triggers, RTC, Rational Team Concert, clearcase, CLEARCASE resume, trainer, consultant, clearcase, BM Rational Tools consultant, ClearCase training, GSA contract holder, Rational, IBM, CM, scm, ClearQuest Consulting, ClearCase help, consulting, trainer, training, ClearCase guru, configuration management" "triggers, ClearCase training, RTC, Requisite Pro, JAZZ, ABS, GSA Schedule holder, Rational, IBM, ClearCase training, CM, scm, ClearCase help, consulting, ClearQuest, BM Rational Tools consultant, trainer, training, ClearCase guru, configuration management"
LEADS_ONLY.pl   Print this page...
..

LEADS_ONLY.pl

Make sure only users ("leads") can perform certain VOB actions. Each VOB has there own VOB "lead" list.

Arguments: NONE:
User "leads" per VOB are defined in the internal %VOB_CHAMPIONS hash

Author:A Better Solution, Inc.
Email :support@abs-consulting.com
URL :https://abs-consulting.com
Date :February 18, 2004

This trigger script is expected to be called from a any pre-op trigger.

Create an element all trigger and apply to specified operations like:

cleartool mktrtype -ele -all -pre checkin -brtype main 
 -c "Only allow VOB Leads to checkin on the main branch." 
 -exec "{path}\perl {path}\LEADS_ONLY.pl" LEADS_ONLY

or make a element trigger type and apply elements as needed:

cleartool mktrtype -ele -pre checkout 
 -c "Only allow VOB Leads to checkout certain files." 
 -exec "{path}\perl {path}\LEADS_ONLY.pl" LEADS_ONLY_ON_DEMAND

cleartool mktrigger LEADS_ONLY_ON_DEMAND foo.c bar.c

or make a type trigger to prevent certain action from being performed:

cleartool mktrtype -type -pre mktype -brtype -all 
 -c "Only allow VOB Leads to create branch types." 
 -exec "{path}\perl {path}\LEADS_ONLY.pl" LEADS_ONLY_TRIGGER

Shortcut using...If using ClearTrigger...

If using ClearTrigger, just add a line in the configuration file like either of the keys below:

pre_checkin;R;;0;0;0;D; ;N; ;0;perl;{path}\LEADS_ONLY.pl;

pre_checkin;R;brtype<main>;0;0;0;D; ;N; ;0;perl;{path}\LEADS_ONLY.pl;

pre_checkin;R;;0;0;0;D; ;O;{foo.c}{bar.c};0;perl;{path}\LEADS_ONLY.pl;

You could also accomplish the same effect without writing any code by defining a cleartrigger alias (~leads) and then using either of the keys below:

pre_checkin;R;;0;0;0;A; ~leads ;

pre_checkin;R;;0;0;0;D; ;N; ~leads ;0;;;;;0;Q;Only Leads can do this;C;

Read more on Policy without Triggers using ClearTrigger.