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

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

Note: CCRC has supported clearprompt since its initial release in ClearCase 2003.06.14.

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

Note: Under certain conditions, pre-op triggers will not work (for example, triggers that require specific ClearCase environment variable evaluation).

Since CCWeb (when being accessed by a browser) does not support clearprompt, trigger writers may need to adjust the behavior when writing triggers for all of the clients in the enterprise. The ATRIA_WEB_GUI (will yield "true") or CLEARCASE_VIEW_KIND (will yield "snapshot web") environment variables can be used to distinguish between a CCWeb or CCRC user (and a traditional “thick” client user); however, a ClearCase trigger cannot distinguish between a CCRC user and a CCWeb browser user since both are evaluated the same. When a trigger fires that requires clearprompt for a CCWeb browser user, CCWeb should display an error message indicating that it does not support the clearprompt protocol and clearprompt will return an error code instead of a valid yes/no/abort/proceed response code.

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 add a local function that prints debug output to a text file on the server for analysis.

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.

To display what the current system environment is for a CCRC server (this only displays RWP variables and basic web server or system environments):

    • Pass http://hostname/ccrc/?cmd=dump in a browser and supply a username and password when prompted.

    • To display a more detailed listing of users credentials, use http://hostname/ccrc/?cmd=creds The server config file (rwp.conf, ccrc.conf) can be modified to add environment variables using the SetEnv command. This is one way to set an EV that defines the machine OS, and other details. There may also be other ways to 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 Change Management (CM) Server 7.1:


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

    /opt/ibm/RationalSDLC/common/CM/bin/ccrpc.sh


    Example content of ccrpc.sh:

    MYVAR=value

    export MYVAR;


    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)

Rate this page:

(0 users)Average rating

Document information


More support for:

Rational ClearCase
ClearCase Remote Client

Software version:

7.0, 7.0.1, 7.1, 7.1.1, 2003.06.16

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Reference #:

1207634

Modified date:

2012-01-24

Translate my page

Machine Translation

Content navigation