12.2 All Source Files Require a Progress Indicator

You may want to monitor the progress of individual files or determine which or how many files are in a particular state. You can use attributes to preserve this information and triggers to collect it.

In this case, you can create a string-valued attribute type, Status, which accepts a specified set of values.

Attribute Definition:

cleartool mkattype -c "standard file levels" ^
-enum "\"inactive\",\"under_devt\",\"QA_approved\"" Status
Created attribute type "Status".

Developers apply the Status attribute to many different versions of an element. Its value in early versions on a branch is likely to be inactive and under_devt; on later versions, its value is QA_approved. The same value can be used for several versions, or moved from an earlier version to a later version.

To enforce conscientious application of this attribute to versions of all source files, you can create a CheckStatus trigger whose action script prevents developers from checking in versions that do not have a Status attribute.

Trigger Definition:

cleartool mktrtype -element -all -preop checkin ^
-c "all versions must have Status attribute" ^
-exec "ccperl \\neon\scripts\check_status.pl" CheckStatus

Trigger Action Script:

$pname = $ENV{'CLEARCASE_PN'};
$val = "";
$val = `cleartool describe -short -aattr Status $pname`;

if ($val eq "") {
exit (1);
} else {
exit (0);
}