OCL Expression Tracing (Professional Edition only)
In this section, you will trace OCL expressions. There's also a flash tutorial on this issue.
OCL definition
- In the Project Explorer view in the OCL perspective, double-click deflib.oclx to open it in an editor.
- Mark the definition
getClassByName, select Trace OCL from the context menu. A list of available models is displayed.
- Select the model
models.new_file.uml on which you want to trace the definition and select the model element Model::Unknown.

- An input dialog for the required parameters
String:aName is displayed. Type C2 into the input field and press the OK button.

- The definition is evaluated in the context of the selected model element. The evaluation result is displayed in the console.

As expected, the result of the OCL definition tracing is the Class::C2.
OCL query
- In the Project Explorer view in the OCL perspective, double-click querylib.oclx to open it in an editor.
- Mark the query
numberOfAttributes, select Trace OCL from the context menu. A list of available models is displayed.
- Select the model
models.new_file.uml on which you want to trace the query and select the model element Class::C2.

- The query is evaluated in the context of the selected model element. All evaluation steps and results are displayed in the console.

OCL test
- In the Project Explorer view in the OCL perspective, double-click testlib.oclx to open it in an editor.
- Mark the query
numberOfAttributesC2, select Trace OCL from the context menu and finally select the model models.new_file.uml on which you want to trace the test.

- The test is evaluated in the context of the selected model. All evaluation steps and results are displayed in the console.
