This section describes the various manners in which OCL expressions
can be used in UML models.
In this specification the structure of an expression, and its evaluation are separated from the usage of the expression. Chapter 8 ("Abstract Syntax") defines the structure of an expression, and appendix A ("Semantics") defines the evaluation. In chapter 9 ("Concrete Syntax") it was allready noted that the contents of the name space environment of an OCL expression are fully determined by the placement of the OCL expression in the model. In that chapter an inherited attribute env was introduced for every production rule in the attribute grammar to represent this name space environment.
This section specifies a number of predefined places where OCL expressions can be used, their associated meaning, and the contents of the name space environment. The modeler has to define her/his own meaning, if OCL is used at a place in the UML model which is not defined in this section.
For every occurence of an OCL expression three things need to be separated:
the placement, the contextual classifier, and the self instance of an OCL
expression.
In thenext section a number of placements are stated explicitly.
For each the contextual classifier is defined, and well-formedness rules
are given, that exactly define the place where the OCL expression is attached
to the UML model.
The definition of the contextualClassifier and ExpressionInOcl depends to a large extend on the UML 2.0 definition.
Therefore this section will need to be finished after the UML 2.0 definition
has been frozen. Therefore not all rules in this section are completely
finished, they need to be re-done anyway.