Saving packages in hierarchical mode

In hierarchical mode, you can save a package in a unique subdirectory one level below the directory of its parent. All units contained in the package are saved in its subdirectory, along with the package (.sbs) file. Nested packages are further divided into subdirectories.

About this task

Consider the example of a project Home that contains the package Family, which contains the package Pets. With each package in its own directory, the path of the Pets.sbs file would be:

../Home/Family/Pets/Pets.sbs
Note: When changing from flat mode to hierarchical mode, IBM® Rational® Rhapsody® does not automatically create folders for existing packages. Instead, it creates a folder for each new package within the existing directory structure. In hierarchical mode, you can also add multiple packages with the same name in different directories within your project.

Procedure

  1. Right‑click the package and select Unit > Edit Unit. The Unit Information for Package window opens.
  2. Select the Store in separate Directory check box (available only for packages). The name of the separate directory has the same name as the unit.
  3. Click OK.

Results

The product creates the directory and moves the package, along with all of its subunits, into the new folder.

Changing a hierarchical model to a flat model

About this task

To change an existing model from hierarchical mode to flat mode, write a Visual Basic for Applications (VBA) script that iterates over the entire model and, for each IRPUnit, calls the setSeparateSaveUnit(true) method. The only unit that must not activate this method is the project.


Feedback