OCL Header If you select the OCL2.0 language, the header of the expression from the constraint information is generated automatically according to the following rules: context <constrained element> <constraint type> <constraint name if any>:. See the following image.
 Constraint types Since the Constraint is stereotyped by «validationRule» which is derived from «invariant » stereotype, inv is shown in the header. Only inv constraints can be evaluated. Other types of Constraints are not evaluated, but can be modeled for documentation purposes:
OCL Performance When evaluating the validation rule defined in OCL language, the validation on the first run can have a delay of 20-30 seconds (depending on the computer performance) while the Java compiler is loading. Subsequent validations will run faster than the first one. If the validation process is run heavily on medium-large projects, increasing the default Java VM size is advisable. By default, the VM size is set to 400MB in MagicDraw; increasing this to 600 (or 800 if the computer has sufficient RAM) might improve the performance. |