Skip to main content

How to set up ClearCase integration for Rational Rose RealTime

Rational staff, Staff, IBM, Software Group
This article is brought to you by the Rational staff at developerWorks.

Summary:  This example demonstrates procedures for setting up ClearCase for use with Rational Rose RealTime.

Date:  04 Dec 2003
Level:  Introductory
Activity:  532 views

Overview

This example does not discuss the process of creating ClearCase VOBs or Views. Please see the ClearCase documentation concerning these activities. This example does not use the ClearCase Unified Change Management (UCM) feature.

ClearCase uses a view model combined with a virtual file system that allows users to specify the lineup of file versions with which they want to work (a config spec controls the lineup used for a particular view). Rose RealTime then sees the files in the current view just as if they were stored on a regular (non-ClearCase) file system. Rose RealTime specifies the set of files that make up the model, and ClearCase provides the versions of these files determined by the view's config spec. Thus the model must be saved to a view directory that is not view-private in order for the files to be added to source control.

It is important that each developer has his/her own work area. When working with ClearCase, a work area is a view. This means that each developer should use a view that is dedicated for their sole usage and that should not be shared with other developers.

ClearCase has a feature allowing a new element "type" to be defined that includes specifying a merge and differencing tool that should be used on files of the new type. Rose RealTime uses this to define an element type that applies to all Rose RealTime files placed under source control. With this element type defined, all new Rose RealTime files that are placed into a VOB are associated with that file type and will use Rose RealTime Model Integrator as their default merge and differencing tool.


Instructions for Windows clients

Registering a new ClearCase element type involves two steps. First, each ClearCase installation must be set up with a "type manager" that will map file extensions to the new element type and indicates which executable to invoke for merge and diff operations. Second, the new element type must be registered in all VOB's in which it will be used.

Registering a new ClearCase element type

Element type setup: type manager

The following steps are required for making ClearCase clients aware of the new element type.

From a command prompt, run:

  • rtperl %ROSERT_HOME%\bin\Win32\cc\mi_typeman.pl
    -atriahome c:\Program Files\Rational\ClearCase

Turning on the "preserve case" option

Rose RealTime is case sensitive when looking for file names, so you must turn on the preserve case option for the ClearCase MVFS on WindowsNT:

  • In the ClearCase HomeBase tool, select the 'MVFS' tab. (The ClearCase Control Panel tool can be started from either the Windows Control Panel or from the 'Administration' tab in the HomeBase tool)
    • Make sure the 'Case Preserving' check box is checked.
    • The MVFS service must be restarted for this change to take effect. (Note that this amounts to a reboot as the MVFS system is actually a foreign file system.)

ClearCase repository setup

Each VOB must be set up to allow files of the new element type to be created. Follow the steps that apply to your platform below for each VOB that will be storing Rose RealTime files.

Open a command prompt window and change directory to a path within the VOB in which you wish to register the type. To create the element type, use the following command syntax:

  • cleartool mkeltype -supertype text_file -manager
       petalrt_file_delta -c "RoseRT files" rosert_unit

    Test the type manager
    To determine if the rosert_unit element type has been successfully registered in the VOB, perform the following command from a command prompt after changing to a directory contained in the VOB:

  • cleartool lstype -long eltype:rosert_unit

A listing of the type details will verify that it is correctly registered.

Sample output

element type "rosert_unit" 
07-Jul-00.12:09:10 by someone@machine 
 "RoseRT files" 
 owner: someone 
 group: groupid 
 scope: this VOB (ordinary type) 
 type manager: petalrt_file_delta 
 supertype: text_file 
 meta-type of element: file element

Note: Please see the online documentation on creating developer views to learn more about view-templates which you will probably want to use in your configuration management scheme.

Rose RealTime usage of the ClearCase setup

  1. Use the ClearCase command line interface or gui to create a directory within the target ClearCase VOB and give this directory an appropriate name for your model. Add this directory to source control and check it in.

  2. Open the Rose RealTime toolset and create your new model or copy an existing model, if one exists, to this new directory. The possibility exists at this point to right click on the top model element in the Model View browser and select File>Control child units.  This will allow the information stored in your model to be split up into separate files or configuration items when saved (do not save your model just yet).

  3. Right click again on the model element in the Model View browser and open the model specifications. Click on the check box to enable source control and click the browse button under the Scripts directory text box which has become active. This should put you in the %ROSERT_HOME%/bin/win32/cmscripts directory (otherwise navigate to this directory). Next, select the cc directory and click OK. Optionally, check the "Add files to source control when first saved" check box (the rest of this note assumes that this option was not selected).

  4. This step continues with the assumption that the 'Add files to source control when first saved' option was not checked. The toolset will tell you that it is refreshing status from source control but unless you already had the model versioned in ClearCase the status of every file in the model is "not under source control". Save the model, giving it an appropriate name in the directory you created in step 1. You will be prompted to accept the default directory and file names for each of your control units. You may say "Yes to all" to avoid being prompted multiple times for each file.

    This will generate the directory structure and files identified at the beginning of Chapter 2 in the Team Development Guide. For ClearCase, they become view private files at this point.

  5. Right-click again on the model element in the Model View browser, select 'Source Control -> Add to source control' from the context menu. Answer "Yes" to the prompt about adding child units as well. You will be prompted with a list of control units that you can de-select if necessary. Do not de-select any of them unless you do not want them to be versioned. You can add control units to source control later if you do de-select items now.

  6. Add an appropriate comment for the generation of the versioned items. You are also presented with the option to keep the model elements checked out. This is not necessary.

  7. It is recommended to check in your control units after adding them to source control from Step 5. This establishes a pseudo-baseline of the original model. Now you can check out the particular control units you need. When you make a change to an unit that is not checked out, you will be prompted by the toolset to check out the unit before applying the change.

  8. Optionally, outside the toolset, add the model's ".rtwks" file to ClearCase. This file will rarely need to change and changes to it are brief and can be delivered quickly back to source control. Having this file in source control also ensures that all the developers are using the same CM settings and scripts. Updating the CM scripts is therefore much easier.

Instructions for UNIX clients

Registering a new ClearCase element type involves two steps. First, each ClearCase installation must be set up with a "type manager" that will map file extensions to the new element type and indicates which executable to invoke for merge and diff operations. Second, the new element type must be registered in all VOB's in which it will be used. The setup required for these steps is:

Element type setup: type manager

ClearCase's cleartool command (often aliased as "ct") must be accessible from the shell prompt.

  • Use the $ROSERT_HOME/bin/$ROSERT_HOST/cc/mi_typeman script to install the type manager in each ClearCase installation. To set up the extensions and tool mappings, the user executing the script must have access to the following directories in the ClearCase installation:

    /lib/mgrs 
    /config/ui/icons 
    /config/ui/bitmaps 
    /config/magic 

  • Use the following command line to set up the proper file extensions and tool invocations:

    $ROSERT_HOME/bin/$ROSERT_HOST/cc/mi_typeman.sh install 
    -server 
    

Register the rosert_unit element in each VOB

  • Use the mi_typeman script to register the rosert_unit element type in each VOB using the following syntax:

    $ROSERT_HOME/bin/$ROSERT_HOST/cc/mi_typeman.sh 
    install 
    -eltype -vob <vob_path>

    (This note does not cover MultiSite replicated VOBs and administrative VOBs directly)

  • Test the type manager To determine if the rosert_unit element type has been successfully registered in the VOB, perform the following command from a command prompt after changing to a directory contained in the VOB:

    cleartool lstype -long eltype:rosert_unit

A listing of the type details will verify that it is correctly registered.

Sample Output

element type "rosert_unit" 
08-Nov-99.14:48:11 by Someone (someone@machine) 
 "RoseRT model unit, Version 1.0" 
 owner: someone 
 group: somegroup 
 scope: global 
 type manager: petalrt_file_delta 
 supertype: text_file 
 meta-type of element: file element

Note: Please see the online documentation on creating developer views to learn more about view-templates which you will probably want to use in your configuration management scheme.

Rose RealTime usage of the ClearCase setup

  1. Use the ClearCase command line interface ct mkdir to create a directory within the target ClearCase VOB and give this directory an appropriate name for your model. Before you can use this command, however, you will first have to check out the parent directory (i.e, "ct co -nc ."). Add this directory to source control and check it in. Don't forget to check the parent directory back in ( i.e., "ct ci -nc .").

    The sequence of events will therefore be:

    ct co -nc . 
    ct mkdir -nc -ci <dirName> 
    ct ci -nc .

  2. Open the Rose RealTime toolset and create your new model or copy an existing model, if one exists, to this new directory. The possibility exists at this point to right-click on the top "model" element in the Model View browser and select File > Control child units.  This will allow the information stored in your model to be split up into separate files or control units when saved (do not save your model just yet).

  3. Right click again on the model element in the Model View browser and open the model specifications. Click on the check box to enable source control and click the browse button under the Scripts directory text box, which has become active. This should put you in the $ROSERT_HOME/bin/<platform>/cmscripts directory (otherwise navigate to this directory) and you should select the cc directory and click OK. Optionally, check Add files to source control when first saved (although the rest of this Tech Note assumes that it was not).

  4. This step continues with the assumption that the 'Add files to source control when first saved' option was not checked. The toolset will tell you that it is refreshing status from source control but at this point the status for every control unit in the model is currently "not under source control" unless you already had the model versioned in ClearCase. Save the model, giving it an appropriate name in the directory you created in step 1. You will be prompted to accept the default directory and file names for each of your control units. You may say "Yes to all" to avoid being prompted multiple times.

    This will generate the directory structure and files identified at the beginning of Chapter 2 in the Team Development Guide. For ClearCase, they become view private files at this point.

  5. Right click again on the model element in the Model View browser, select Source Control > Add to source control from the context menu. Answer "Yes" to the prompt about adding child units as well. You will be prompted with a list of control units, which you can de-select if necessary. Do not de-select any of them unless you do not want them to be versioned. You can add control units to source control later if you do de-select items now.

  6. Add an appropriate comment for the generation of the versioned items. You are also presented with the option to keep the model elements checked out. This is not necessary.

  7. It is recommended that you check in your control units at this point as it establishes a pseudo-baseline of the original model. Now you can check out the particular control units you need. When you make a change to an item that is not checked out you will be prompted by the toolset to check out the item before applying the change.

  8. Optionally, outside the toolset, add the model ".rtwks" file to ClearCase. This file will rarely need to change and changes to it are brief and can be delivered quickly back to source control. Having this file under ClearCase control also ensures that all developers are using the same CM settings and scripts. Updating the CM scripts is therefore much easier.


References

  • Rational Solution Id #12900
  • Rational Solution Id #12902
  • RoseRT Team Development Guide
  • Chapter 10 describes a ClearCase Parallel Development: Sample Process

About the author

This article is brought to you by the Rational staff at developerWorks.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=958
ArticleTitle=How to set up ClearCase integration for Rational Rose RealTime
publish-date=12042003
author1-email=ibmrationalstaff@bogusemail.com
author1-email-cc=

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Rate a product. Write a review.

Special offers