All source files require a progress indicator

You can 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 on Linux and the UNIX system

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

Attribute Definition on the Windows® system

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 consistent 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 on Linux and the UNIX system

cleartool mktrtype –element –all –preop checkin \
–c "all versions must have Status attribute" \
–exec 'Perl /public/scripts/check_status.pl' CheckStatus 

Trigger definition on the Windows system

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);
}