Extracting diagrams from a model

About this task

The first step is to create a template that generates a document that includes all the diagrams from a model.

If you use the first method, your template selects only diagrams that have the same names as the ones used to build the template.

The second method uses a generic element, which represents a type of model element that might exist in anyIBM Rational Rhapsody model. By using generic elements, you create a template that can be used with any model. There is another advantage to using generic elements - it is typically faster to build a template with them than with model elements.

To extract diagrams from a model, follow these steps:

Procedure

  1. In the model view, expand All Metaclasses.

    The generic elements under All Metaclasses represent all the model elements of their type in a model. For example, CollaborationDiagram represents all the collaboration diagrams in a model, ComponentDiagram represents all the component diagrams in a model, and Class represents all the classes in a model.
  2. Click the CollaborationDiagram node and drag it to the template view.
  3. Repeat for each of the diagram nodes. An iteration node and an iteration subnode are created in the template view, as shown in the following figure:
    All Metaclasses window in Model view
  4. Click an iteration node and notice the information displayed on the Text tab, as shown in the following figure. In the generated document, this information is displayed once, at the beginning of the section of the document that contains the diagrams.
  5. Click an iteration subnode and notice again the Text tab. You see boilerplate text (in black) and attributes (in blue), as shown in the following figure. In the generated document, the information about this node displays for each diagram extracted from the model. In this case, for each diagram, the document has a heading that includes the diagram name.
    Iteration subnode window for a collaboration diagram

Results

Default text and attributes are added to the Text tab. You can edit or remove the text. Attributes specify the information to extract from the model. For example, the «$name» attribute indicates the name of the diagram in the generated document. You add additional text and attributes in a later task.


Feedback