To validate elements that are not used in a diagram
Create a Package and apply the «ValidationSuite» stereotype.
Right-click the Package to open its Specification window.
On the left side menu, select Constraints → Constraints > Create.
Click three dots 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.
Click three dots next to the Severity, Error Message, and Abbreviation properties to specify them for the created validation rule.
Click three dots next to the Constrained Element property to specify the metaclasses and stereotypes whose instances are validated if not used in the diagram.
Click three dots next to the Specification property. Specification dialog opens.
From the Language drop-down list, select StructuredExpression.
On the left side of the dialog, click Create Operation → Operation >Operation from Model → > Not.
Note
If you cannot see theOperation from Modeloperation 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.
Select A → A >Reset.
Select A → > Operation from Model → > IsEmpty.
Select Input → > Operation from Model → > UsageInDiagramsWithSymbols.
Select Element → Element >Reset.
Select Element → > Contextual Variable.
Click OK.
Content block
id
956458042
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.