You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

To validate elements that are not used in a diagram


  1. Create a Package and apply the «ValidationSuite» stereotype.
  2. Under the created Package, create a Constraint, and apply the «validationRule» stereotype.
  3. Specify the Severity, Error Message, and Abbreviation for the created validation rule.
  4. Specify the constrainedelement - metaclasses and stereotypes whose instances are validated if not used in the diagram.
  5. Click to specify the Specification property.
  6. From the Language drop-down list, select a StructuredExpression.

  7. Click Expert at the bottom of the dialog. The dialog is switched to the Expert mode.
  8. In the Body area of the Specification dialog, click Create Operation.
  9. Select the Operation from Model operation type on the right side of the dialog.

  10. Select the Not opaque behavior from the model.

     The Apply Filter check box must be unselected!

  11. On the left side of the dialog, select the parameter of the Not operation and press Delete.
  12. On the right side of the dialog, click the Operation from Model operation type.
  13. Select the IsEmpty opaque behavior from the model.

     The Apply Filter check box must be unselected!

  14. On the right side of the dialog, click the Operation from Model operation type.
  15. Select the UsageInDiagrams opaque behavior from the model.

     The Apply Filter check box must be unselected!

  16. On the left side of the dialog, click the Element parameter of the UsageInDiagramsWithSymbols operation, and press Delete.
  17. Select the Contextual Variable from the Other category.

Sample model

The model used in these examples is the Case Studies for Querying the Model sample model. To open this model, you need to download case studies for querying the model.mdzip