Adding a condition

About this task

Conditions limit the model elements that IBM® Rational® Rhapsody® ReporterPLUS includes from an iteration. When you add a condition, Rational Rhapsody ReporterPLUSextracts only those model elements that meet the condition. If you do not specify a condition,Rational Rhapsody ReporterPLUS extracts all the model elements in the iteration.

For example, the classes iteration in your template extracts all classes from the model. If you want only classes named "Dishwasher," for example, you can add a condition to the iteration that limits the classes to names equal to "Dishwasher."

To specify a condition, you first choose the attribute you want to base the condition on, such as name or metaClass. Next, you choose the operator, such as = (equal to) or <> (not equal to). Finally, you specify the value you want to compare to the attribute. In this section, you add a condition so that only the overridden properties in the class are extracted.

Note: The product supports two types of conditions: simple and advanced. This section describes simple conditions, which suffice for many purposes. Advanced conditions are written using the Q Language. For more information about Q, see the Q Language section.

To add a condition:

Procedure

  1. In the template view, click the property iteration node (From class "Class"…).
  2. Click the Condition tab.
  3. Make sure the Simple option is selected.
  4. In the Attribute field, click the down arrow to display the list. The list contains the attributes on which you can base conditions for this iteration.
  5. Select isOverridden, then click OK.
  6. In the Operation field, click the down arrow and select the equal sign (=).
  7. In the Value field, click the down arrow and enter true. Click Apply. The Condition tab resembles the following figure. Property interation window with Condition tab
  8. Save your template.
  9. If the Dishwasher.rpy is not already open, open it now.
  10. Generate a Microsoft Word document, and go to the last page to check the results. For class AcmeJet in the model, you see only one property, CG::Class::Concurrency, because it is the only overridden property.

Feedback