Missing data

The «No Model Data» message is printed when the template attempts to extract information about an attribute that is not present in the model. For example, in the Dishwasher model, not all of the classes have descriptions.

About this task

Missing data can occur on two levels: attribute and iteration. The missing description in the Dishwasher classes shows what happens at the attribute level: IBM® Rational® Rhapsody® ReporterPLUS is able to extract classes from the model, but not all of the classes have data for all of the attributes specified in the template. There might also be missing data on the iteration level. For example, if you open a model that has no object model diagrams, then generate a document with a template iterating over object model diagrams, the template tries to extract object model diagrams, but there are none.

In this section, you learn how to control whatRational Rhapsody ReporterPLUS does when data is missing from a model at either the attribute or the iteration level.

Modifying attributes

About this task

The «No Model Data» message is the default behavior of the product when attributes are missing from a model. To change that behavior to something more specific, follow these steps:

Procedure

  1. Click on the class subnode (the last node in the template view, labeled ‘…iterate over association "classes"').
  2. On the Text tab, right-click on the «$descriptionHTML» attribute to display the context menu. Be sure to click directly on top of the attribute.
  3. Select Edit Attribute from the context menu to display the Edit Attribute dialog box. This dialog box enables you to specify alternate text and to control what happens to text preceding and following the missing attribute.
  4. Select Use alternate text and type Model contains no description for this class in the text field. Rational Rhapsody ReporterPLUS prints this text instead of
    «No Model Data»
    .
  5. From the Preceding text section of the dialog box, select Skip preceding text. This means that Rational Rhapsody ReporterPLUS does not print the word "Description:" for the missing attributes. The Edit Attribute window resembles the following figure.
    Edit Attribute window
  6. Click OK to dismiss the dialog box, then click Apply in the template node view.
  7. Save your template.
  8. Generate a Microsoft Word document and go to the last page to look at the Classes section of the document. For the AbstractFactory and AcmeFactory classes, see the message "Model contains no documentation for this class."
    Note: In the Edit Attribute dialog box, you can also specify whether you want to include any boilerplate text following the attribute. Refer to the online help topic "Coping with missing attributes" for details on exactly what text is included in "preceding" and "following" selections. In addition, you can create advanced statements about the attribute using the Q Language. For example, you can create a statement that specifies thatRational Rhapsody ReporterPLUS prints a Boolean attribute only if its value equals "true." For more information about Q, see the Q Language section.

Missing iteration elements

About this task

When the model is missing an element that an iteration is attempting to extract, the default behavior is to skip the iteration and print nothing for that iteration in the generated document. However, there might be instances when you want to know that the model does not contain an element. You can print heading or body text when an iteration cannot find the specified model data.

Because your template is fairly simple—it extracts only diagrams and classes—in order to see how this option works, you need to add a generic element to the template that you know does not exist in the Dishwasher model.

Do the following:

Procedure

  1. In the model view, expand the project node and the containedPackages node.
  2. Select the nestedPackages node, and drag it to the template view on top of the containedPackages iteration subnode (…iterate over association "containedPackages"). The new iteration node is placed at the end of the template, under the containedPackages classes subnode.
    Note: As you drag nestedPackages over the nodes in the template view, the mouse pointer changes to the symbol ✸. This means you cannot drop the item at that location.
  3. Click on the new nestedPackages iteration node.
  4. Click the No Data tab.
  5. Select Use alternate text.
  6. Click to place your cursor in the text box, then type "No nested packages in the Package(s) of this model." The No Data tab is similar to the following example.
  7. Click OK to dismiss the dialog box.
  8. Save your template.
  9. Generate a Word document, and go to the last page to check the results. See the heading "Package information for Package «$name»" followed by "No nested packages in the Package(s) of this model."

Feedback