Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Content layer
id956458043
Content column
id956458056
Content block
id956458046

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.  and apply the «ValidationSuite» stereotype.
  4. Right-click the Package to open its Specification window
  5. On the left side menu, select Constraints > Create.
  6. Click three dots Image Added next to the Applied Stereotype property and set it to «validationRule». Click Apply.

    Note

    If you cannot see the Traceability node, make sure the Expert or All mode is enabled.

  7. Click three dots Image Added next to the SeverityError Message, and Abbreviation properties to specify them Specify the Severity, Error Message, and Abbreviation  for the created validation rule.
  8. Specify the constrainedelement - Click three dots Image Added next to the Constrained Element property to specify the metaclasses and stereotypes whose instances are validated if not used in the diagram.
  9. Click three dots Image Added next to specify the Specification property property. Specification dialog opens.
  10. From the Language the Language drop-down list, select a select StructuredExpression.

  11. Click Expert at the bottom

    On the left side of the

    dialog. The

    dialog

    is switched to the Expert mode.In the Body area of the Specification dialog

    , click Create

    Operation.
  12. Select the Operation from Model operation type on the right side of the dialog.

  13. Select the Not opaque behavior from the model.

    Note

     The Apply Filter check box must be unselected!

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

    Note

     The Apply Filter check box must be unselected!

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

    Note

     The Apply Filter check box must be unselected!

  19. On the left side of the dialog, click the Element parameter of the UsageInDiagramsWithSymbols operation, and press Delete.
  20. Operation > Operation from Model > Not. 

    Note

    If you cannot see the Operation from Model operation under Operations, make sure the Expert mode is enabled.

    Note

    If you cannot see the Not operation, make sure the Apply Filter box is not checked.

  21. Select > Reset.
  22. Select A > Operation from Model > IsEmpty.

  23. Select Input > Operation from Model > UsageInDiagramsWithSymbols.

  24. Select Element > Reset.
  25. Select Element Contextual Variable.
    Image Added
  26. Click OK.Select the Contextual Variable from the Other category.
    Image Removed
Content block
id956458042

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