You can write an OCL statement to query the characteristics of
UML model elements.
To write an OCL statement, you must have a model or profile open,
and have an OCL resource in your workspace.
To write an OCL statement in the Modeling perspective:
- In the Model Explorer view, double-click an
OCL resource.
- At the top of the editor, from the Target
Model list, select a target model. This selection determines
the available context elements.
- In the Context Element field, specify a
context element.
- In the editor, type your OCL statement. Information
about proper OCL syntax is available on the UML Resource Center, in the UML
2.0 OCL Specification document, in the "Standard UML documentation" section.
Tip: When you write OCL statements, the self keyword
substitutes the context element.
- To save the OCL resource, click .