How to use IBM Rational Rose Model Importer: Part 2. How to migrate Rose UML model subunits to Rational Software Architect

This article will teach you how to use your IBM Rational Rose Model Importer tool to migrate UML model subunits from your IBM Rational Rose solution to your IBM Rational Software Architect environment. Part two in a series of articles, this piece will show you, in a step-by-step format, how to migrate Rose model subunits so that you can benefit from enhanced modeling capabilities found in your Software Architect environment.

Share:

Mustansir Ali (mustan.ali@in.ibm.com), Senior Staff Software Engineer, IBM

Photo of Mustansir AliMustansir Ali is a development lead at the IBM India Software Lab Bangalore. Ali has 9 years experience in software development working with the IBM Rational Software Architect solution. Ali has a Bachelor of Engineering in Computer Science from Dr. Babasaheb Ambedkar University, India and a Masters Degree in Software Systems from Birla Institute of Technology and Science, Pilani, India.



18 February 2010

Also available in Chinese Spanish

Introduction

Part one of this series briefly discussed subunits and fragments. Fragments in the IBM® Rational® Software Architect tool are equivalent to subunits of the IBM® Rational® Rose® solution; the main objective of subunits or fragments is to facilitate the parallel and independent development of various parts of the model within a project team. This allows you to break up a large, complex model into smaller units that individual developers can work independently. Each of the individual subunits or fragments can exist separately under version control and helps enable a project team to develop a model in parallel.

The Software Architect environment also supports working with multiple models at the same time, unlike Rational Rose that allows working with only one model at a time. Using the Rational Software Architect environment you can break up a large model into multiple, smaller sub models similar to the fragments. The advantage of using sub models is that they can exist independently of the main model, unlike fragments which can exist only inside the main model. These independent sub models can also be shared by multiple models.

The IBM® Rational® Rose® Model Importer tool provides an option to automatically convert the subunits to fragments or independent models after import, allowing you to work in a setup similar to that found in the Rational® Rose environment. The tool also supports sharing the subunits with existing models in the Software Architect solution. This article discusses the various options available for converting subunits during import of a Rose model to your Software Architect environment.

Prerequisites

As a prerequisite, you need the following rational software installed, and you need to be familiar with using both products. The tools needed include:

  • Rational Software Architect Standard Edition Version 7.5.2 or later
  • Rational Rose solution, with models that contain Petal Version 47, 48, or 50, which are the only versions that you can import into your Software Architect environment. If you have models that use Petal Version 46 or earlier, upgrade them to Petal Version 47 first within your Rational Rose tool. These models must be free of errors before you import them. You may use the Check Model option in Rational Rose tool to verify that they are error-free.
  • Before you start planning your Rose model subunits migration, it is important that you read the IBM developer Works "How to use IBM Rational Rose Model Importer: Part 1. How to migrate UML models to Rational Software Architect" (see Resources) article.

Importing Rational Rose subunits

You can import subunits from Rational Rose models into your Software Architect environment in following ways:

  1. As fragments, analogous to subunits in Rational Rose.
  2. As independent models.
  3. As root packages.
  4. You may also choose to import some subunits as models, some as root packages, and yet other subunits as fragments.
  5. You can remap subunits to existing models and packages.
  6. You can also apply a mixed approach by remapping some subunits while converting others to fragment, models or root packages.

Import of subunits as fragments

When you import subunits as fragment, each of the subunits (.cat file) in IBM® Rational® Rose will be migrated as fragment (.efx file) to the Rational Software Architect solution. For example, SubunitX.cat in Rational Rose has been converted to SubunitX.efx in the Software Architect tool, as shown in Figure 1 below.

Figure 1. Subunits in Rational Rose converted to fragments in Rational Software Architect
Screenshot shows subunits converted to fragments

Import of subunits as models

When you import subunits as models, each of the subunits (.cat file) in the Rational Rose solution will be imported as a separate model (.emx file) to the Software Architect tool and a shortcut will be created in the model containing the subunit to the newly created model(from subunit) as shown in Figure 2 below. All the references to the elements of the subunits are automatically updated to the elements of the model created from the subunit. For example, SubunitX.cat of ModelA in the Rational Rose solution has been converted to SubunitX.emx in your Rational Software Architect environment after import. There is new shortcut created for subunit SubunitX in ModelA, which points to the newly created model SubunitX (SubunitX.emx) inside the project named Shared.

Figure 2. Subunits in the Rational Rose tool converted to models in the Rational Software Architect solution
Picture shows subunits converted to models.Picture shows subunits converted to models.

Import of subunits as packages

When you import subunits as packages, each of the subunits (.cat file) in Rational Rose will be imported as a separate model (.emx file with type set as package) to your Software Architect solution. The model containing subunit will add element import to the newly created package (from subunit) as shown in Figure 3 below. All the references to the elements of the subunits are automatically updated to the elements of the package created from the subunit. For example, SubunitX.cat of ModelA in the Rational Rose tool has been converted to SubunitX.emx(with type set as package) in your Software Architect solution after import. There is new element import created for subunit SubunitX in ModelA, which points to the newly created package SubunitX (SubunitX.emx) inside the project named Shared.

Figure 3. Subunits in Rational Rose tool converted to packages in the Rational Software Architect solution
Graphic shows subunits converted to packagesGraphic shows subunits converted to packages

Steps to import subunits as fragments, models or root packages

Follow the steps in "Part 1. How to migrate UML models to Rational Software Architect" of this article (see Resources) for importing the Rational Rose model with subunits. This section will show a step-by-step usage of the Rational Rose Model Subunit Conversion wizard page for subunit conversion.

Note:

The "Rational Rose Model Subunit Conversion” wizard page has changed in the Rational Software Architect Standard Edition Version 7.5.2 for enhancements in the subunit conversion feature; therefore, you will find that this wizard page have some differences in Step 1 and Step 2 of the article.

Step 1. Enable subunit conversion

In the Rational Rose Model Import wizard, on the Rational Rose Model Subunit Conversion page, select the check box labeled Convert subunits to fragments, models or packages as shown in Figure 4 below.

Figure 4. Rational Rose Model Subunit Conversion wizard
Graphics shows the Wizard page

By default, all the subunits are converted to fragments. Therefore, when the user enables the subunit conversion, the Subunit list table gets enabled and all the subunits in the Subunits list table have Convert to/Share column set to fragment.

Step 2. Specify the conversion choice for the subunits

After completing Step 1, by default all the subunits in the subunits list table will be converted to fragments. You have to modify the subunit list in order to import subunits as independent models; or root packages. There are two ways to accomplish this:

  • Option 1: In the Subunit list table, select a subunit name; then, click on the Convert to/Share column, you will see a drop-down list with three choices Fragment, Model or Package as shown in Figure 5 below. Select one of the desired choices for the subunit conversion.
Figure 5. Drop-down list in Subunit list table
Drop-down list showing subunit conversion options
  • Option 2: Right click on the Subunit list table, this will open up a Convert subunits popup menu as shown in Figure 6 below. Select All to menu option, you will see a sub menu with three choices Fragment, Model or Package as seen in Figure 6. Select one of the desired choices; Convert to/Share column for all the subunits in the Subunit list table will be updated with the selected type. The popup menu is very useful when you have large number of subunits and all of them have to be converted to same type during import.
Figure 6. Popup menu in Subunit list table
Pop-up menu to specify subunit choices.

Proceed to Step 3 if you are importing one or more subunits as fragments. Perform Step 4 if you have selected to import one or more subunits as model or root package.

Step 3. Select the naming conventions for fragments

This step is applicable only when you import one or more subunits as fragment. Select the name of the fragment by making appropriate choice in Fragment creation options panel as shown in Figure 7 below. To create fragments with the subunit file name, click Use subunit file names; to use the package name of the subunit, click Use subunit package names. For example consider a subunit SubunitA.cat which has package name defined as PackageA in Rational Rose model. If you select Use subunit file names option then the fragment name will be set to SubunitA_cat.efx after import but if you choose Use subunit package names then the fragment name will be set to PackageA_cat.efx after import.

Figure 7. Fragment, model or package creation options
Graphic shows options for subunit conversions.

Step 4. Specify project and naming conventions for models/root packages

These steps are applicable only when you import importing one or more subunits as models or root package.

1. Specify the project

You have to specify the project for creation of the model/root package using Model/Package creation options panel as shown in Figure 7 above. To use the existing projects select Existing project option and use the Browse button to select one of the existing project from the workspace. To create new project select the New project option and type the name to be used for new project in the Project name text box. The new project will be created at the location specified in the Location text box; by default the location will be set to the current workspace. To change the location uncheck the Use Default check box, this will enable the browse button to specify the new location.

2. Select the directory structure

Specify the directory structure to be used for the models or root packages using Createmodels/packages panel as shown in Figure 7 above. To keep the hierarchical structure same as that in Rational Rose select With subunit directory structure option; to impose a flat directory structure select In one directory option. For example the SubunitA.cat is stored at location C:\XYZ in Rational Rose model i.e. C:\XYZ\SubunitA.cat.You have imported the subunits into RSA model project ABC located at C:\workspace i.e. C:\workspace\ABC. If With subunit directory structure option is selected then SubunitA.emx will be created inside project ABC with the directory structure preserved i.e. C:\workspace\ABC\XYZ\SubunitA.emx; if In one directory option is selected then SubunitA.emx will be created directly inside project ABC i.e. C:\workspace\ABC\SubunitA.emx

3. Select the naming convention

Select the name of the model/root package by making appropriate choice using For model/package file names panel as shown in Figure 7 above. To create model/root package with the subunit file name, click Use subunit file names; to use the package name of the subunit, click Use subunit package names. For example consider a subunit SubunitA.cat which has package name defined as PackageA in Rational Rose model. If you select Use subunit file names option then the model/root package name will be set to SubunitA.emx after import but if you choose Use subunit package names then the model/root package name will be set to PackageA.emx after import.

After you specify the appropriate options for subunits import, the models, root packages, and fragments are created in RSA and displayed in the Project Explorer view.


Mapping subunits

The Rational Rose tool supports sharing of subunits between two or more models to allow the re-use of the model components. You can use the subunit map feature of Rational Rose Model Importer to import these types of models so that they can share the subunits even after the import to your Software Architect environment. The subunit map feature enables the sharing of subunits after import in two different ways, as show in the sections below.

1. Import shared subunits as model and map

When you import the shared subunits first time, convert it to a model as explained in Steps to import subunits as fragments, models or root packages section above. Now whenever you import the new models containing the same subunit, use the subunit map feature of the Rational Rose Model Importer as explained in the Steps to map subunits to existing models and packages section below. This feature will configure the new model in your Software Architect environment such that it will re-use the existing model (already created from the same shared subunit earlier).

Let's consider an example to better understand these concepts. There are two models in Rational Rose, ModelA and ModelB both using the same subunit SubunitX. When you import ModelA convert SubunitX to a new model inside Shared project. After import the models will look like as shown in the Figure 8 below:-

Figure 8. Subunit SubunitX in Rational Rose has been converted to model SubunitX in the Software Architect environment after import
Picture shows models generated from subunits.

When you import ModelB containing the same shared subunit SubunitX, use the subunit map feature of the Rational Rose Model Importer. The ModelB will be imported to the Rational Software Architect solution such that it will have shortcut to the model SubunitX inside the Shared project, as shown in the Figure 9 below. This way both ModelA and ModelB share the subunit SubunitX as models.

Figure 9. Subunit SubunitX in ModelB is remapped to the model SubunitX from Shared project after import
Remap of subunits to existing models.

2. Import shared subunits as package and map

When you import the shared subunits first time, convert it to a root package (model with type package) as explained in the Steps to import subunits as fragments, models or root packages section above. Whenever you import the new models containing the same subunit, use the subunit map feature of the Rational Rose Model Importer as explained in the Steps to map subunits to existing models and packages section below. This feature will configure the new model in your Software Architect solution such that it will re-use the existing model (already created from the same shared subunit earlier).

Let's consider an example to better understand this concept. There are two models in IBM® Rational® Rose, ModelA and ModelB both using the same subunit SubunitX. When you import ModelA convert SubunitX to a new package inside Shared project. After import the models will look like this, as shown in the Figure 10 below.

Figure 10. Subunit SubunitX in Rational® Rose has been converted to package SubunitX in Rational® Software Architect after import
Picture shows packages generated from subunits.

When you import ModelB containing the shared subunit SubunitX, use the subunit map feature found in your Rational Rose Model Importer. The ModelB will be imported to the Software Architect solution such that it will have element import to the package SubunitX inside the Shared project as shown in the Figure 11 below. So this way both ModelA and ModelB shares the subunit SubunitX as root packages.

Figure 11. Subunit SubunitX in ModelB is remapped to the package SubunitX from Shared project after import
Remapping subunits to existing packages.

Mapping subunits to existing models and packages

Follow these steps to map subunits to existing models and packages.

Step 1. Enable subunit mapping

In the Rational Rose Model Import wizard, on the Rational Rose Model Subunit Conversion page, select the check box labeled Map subunits to existing models/packages as shown in Figure 12 below.

Figure 12. Rational Rose Model Subunit Conversion wizard
Picture shows subunit conversion Wizard page.

Step 2. Select the list of model project for mapping

Use the Source Directory panel as shown in Figure 12 above, to select the list of model project to be used for mapping the subunit being imported. Click on the Browse button in the Source Directory panel, this will open up the dialog box which allows you to select the list of projects for mapping subunits as shown in Figure 13, below.

Figure 13. Select the input folder dialog box
Graphic shows dialog to select existing projects.

Once you select the list of projects and click on the OK button, the Existing project text box will be updated with the list of projects selected by the user as shown in Figure 14 below.

Figure 14. Existing project text box
Text box showing the existing project.

The subunits that can be mapped are automatically updated in the Subunits list table, with Convert to/Share set to Share and Sharable set to Yes as shown in Figure 15 below. The Convert To/Share area is disabled and appears empty for all nested subunits of a sharable subunit because you cannot modify it. For example SubunitY and SubunitZ are nested within shared subunit SubunitX hence they are disabled and set empty as seen in the Figure 15 below. The other subunits that cannot be shared have the previous values preserved in Convert to/Share column.

Figure 15. Subunits list table updated with sharing information
Graphic shows subunits list table.

Step 3. Further customize the subunit conversion

You can use the Subunits list table on the Rational Rose Model Subunit Conversion page to further modify and refine the subunit conversion options. The following modifications are allowed in the Subunits list table.

1. Undo sharing for the subunit

If a subunit is sharable i.e. Sharable column set to Yes but you do not want to share that subunit, you can undo the sharing of the subunit by modifying the Convert to/Share column to Fragment, Model or Package from the drop-down list as shown in Figure 5 above. After the import process, each subunit imports as a new fragment, model, or root package based on the option you specified. All the nested subunits automatically become unshared.

2. Sharing the subunit

If the subunit has Sharable set to Yes but Convert to/Share section is not set to Share, you can modify the Convert to/Share to Share for sharing the subunit as shown in Figure 16 below. All the nested subunits are automatically disabled with Convert To/Share set as empty.

Note: You cannot modify the Convert To/Share for nested subunits even when it is not set to Share.

Figure 16. Setting Convert to/Share column to Share
Modifying sharable subunits to share

3. Modify non-shared subunits

You can modify the conversion of the non-shared subunits (i.e. subunits with Sharable set to empty) to the desired type using drop-down list on the Convert to/Share column with three choices Fragment, Model or Package, as shown in Figure 5. Select one of the desired choices for the subunit conversion.

You can also modify the non-shared subunits using popup menu. Right click on the Subunit list table; this will open up a Convert subunits popup menu as shown in Figure 17 below. Select All non-share to menu option, you will see a sub menu with three choices Fragment, Model or Package, as seen in Figure 6. Select one of the desired choices; Convert to/Share column for all the non-shared subunits in the Subunit list table will be updated with the selected type. The popup menu is very useful when you have large number of non-shared subunits and all of them have to be converted to same type during import.

Figure 17. Popup menu for non-shared subunits in Subunit list table
Menu to modify non-shared subunits.

Summary

Rational Rose model subunits can be imported into your Rational Software Architect solution as fragments, models or packages. The subunits that are shared by multiple models in the Rational Rose tool can also be shared after import to your Software Architect environment using the subunit mapping feature in the Rational Rose Model Importer. You can also use a mixed approach, remapping some subunits while converting others to fragment, models or root packages, by enabling both Convert subunits to fragments, models or packages and the Map subunits to existing models/packages options.


About Part 3

In Part three of this series of articles, we will cover new features found in the Rational Rose Model Importer like the pathmap-based profile creation capability. This article will also cover the import of framework based models and some tips about how to handle a Rational Rose model that uses scripts.


Tips and hints

If the subunits conversion fails with errors, then check the problem details in the Error Log window and address the problem indicated there.

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Rational software on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=468585
ArticleTitle=How to use IBM Rational Rose Model Importer: Part 2. How to migrate Rose UML model subunits to Rational Software Architect
publish-date=02182010