IBM Support

Writing triggers for the ClearCase Remote Client

Technote (FAQ)


Question

Does IBM Rational ClearCase Remote Client (CCRC) support interactive triggers that use clearprompt to interact with users?

Cause

In a remote client-server environment like CCRC, there are considerations that trigger developers need to be aware of.

Answer

Note: These restrictions and comments apply to both web views and automatic views.

User Interaction

CCRC client supports clearprompt interaction which:

  • Provides list, text, proceed, and yes_no dialogs

  • Does not support File dialog because of ambiguities in client-side file selection versus server-side utilization

  • Times out after 5 minutes without user response

Refer to IBM Rational ClearCase Command Reference under the topic of clearprompt for further information about the usage of this module.

Recommendations:

IBM Highly recommends the usage of Perl as a trigger language in the application of ClearCase triggers.

Trigger Output

    • If the CCRC operation fails, trigger output should appear in the client error message; for example, a pre-op checkin trigger that fails will cause the CCRC checkin operation to fail.

    • If the CCRC operation does not fail, output is not shown (for example, because a post-checkout trigger failure will not stop checkout, output will not be displayed). Trigger output may be present in internal status information returned from the host but it is not displayed to the user.

    • On Windows, Perl scripts do not capture output from sub processes such as system calls (calls to clearprompt, for example) or secondary Perl scripts (nested triggers that call other triggers). So error messages can be lost before they get back to the client user.


Debugging suggestion: Since the client does not always see trigger output sent to stdout, the trigger developer can run the perl script explicitly via command line to get the output written to a file - if you add code similar to this.

Example:

sub debugPrint {
my ($m) = @_;
open (OUTFILE, ">>c:/temp/debugPrint.out");
print OUTFILE "$m\n";
close OUTFILE;
 }

debugPrint(“Reached step one”);

Environment

CCRC runs as a client process that sends RPC commands to the CCRC server, where they are executed by separate CCRC server processes. These server processes run under Apache, so the environment variables (EVs) will likely be different from those seen in command shell windows during interactive development. You can get essential environment information using standard Perl packages like Config.pm instead of relying on locally defined EVs.

CCRC server processes are started as the "system" user and then impersonate the original CCRC client user. This means that the trigger can't assume EVs exist that define where the "user home" directory is (for example, "~" on UNIX or "Documents and Settings/<user>" on Windows).

The primary group for a ClearCase Remote Client can be set under the workspace preferences:



    • Temporary files. It is recommended that a system-wide temp directory be defined on the host in order to allow environment variables a dedicated temp location to use where data can be cached between trigger invocations.

      Note: Paths to supporting executables can also be problematic if the path where the executables are stored relies on local user environment definitions (.cshrc and %USERHOME% for example).

    In CCRC Wide Area Network (WAN) Server 8 and 9:


    For Linux or UNIX, custom CCRC trigger environment variables can be set in:

    /opt/ibm/RationalSDLC/common/CM/bin/ccbe-web.sh

    (default install location)


    Example content of ccbe-web.sh:

    MYVAR=value

    export MYVAR;

    Note: Changes made are picked up without requiring restart of server.


    ClearCase Operations

    • The CLEARCASE_* EVs are defined because the trigger is a sub process under the server-side ClearCase operation, like, checkout.

    • CLEARCASE_* path name EVs (CLEARCASE_PN, CLEARCASE_XPN, and so forth) reference a temporary snapshot view on the server side (backing store) which is an unpopulated area where files appear temporarily during operations.

    • The file may not exist in the server snapshot view when the trigger fires. A pre-checkin trigger will NOT see the file or the correct contents on the server side until AFTER the checkin has occurred. A post-checkin trigger will see the correct contents. The file will not necessarily stay around long after the operation so a later trigger for another file may find the earlier file no longer available.

    • The CLEARCASE_SERIES_* EVs identify when a ClearCase operation is part of a "batch" of related operations (for example, an operation that checks out 10 files together). Depending upon the type and purpose of the trigger, it will use the CLEARCASE_SERIES_* EVs to indicate when a checkout, undo checkout, or checkin operation is part of a group of files being modified simultaneously. These environment variables can be set for use with CCRC 7.0.1 and later.

    Note: Currently interactive triggers cannot determine when a series is in progress.
    • CCRC pre-op checkin triggers that modify the file being checked in are not supported in CCRC.

      The file may not exist in the server snapshot view when the trigger fires. A pre-checkin trigger will not see the file or the correct contents on the server side until after the checkin has occurred. A post-checkin trigger will see the correct contents. The file will not necessarily stay around long after the operation so a later trigger for another file may find the earlier file no longer available.

Cross reference information
Segment Product Component Platform Version Edition
Software Development Rational ClearCase ClearCase Remote Client (CCRC)

Document information

More support for: Rational ClearCase
ClearCase Remote Client

Software version: 7.0, 7.0.1, 7.1, 7.1.1, 7.1.2, 8.0, 8.0.1, 9.0

Operating system(s): AIX, HP-UX, Linux, Solaris, Windows

Reference #: 1207634

Modified date: 24 January 2012