This group validates an item against any defined constraints in the Object Constraint Language (OCL). OCL is used to describe expressions on UML models, and to express side-effect free constraints. You can add OCL constraints to any element, relationship or attribute in Enterprise Architect.
Error ID |
Description |
Information |
MVR040001 |
OCL violation: <<violated OCL>> |
The element violates the OCL constraint specified. |
MVR070001 |
OCL violation: <<violated OCL>> |
The relationship violates the OCL constraint specified. |
MVR0A0001 |
OCL violation: <<violated OCL>> |
The attribute violates the OCL constraint specified. |
Defining OCL Constraints for an Element
You can add OCL constraints to an element using the Properties dialog (Element | Properties). Select the Constraints tab, click on the Type drop-down arrow and select OCL.
Important: To have a valid OCL constraint, the syntax must be correctly formed. If the expression is not correct, Enterprise Architect displays a message stating that the OCL constraint is not valid.
To perform an OCL Validation, display the Model Validation Configuration dialog and select the Element: (OCL) Conformance checkbox. Any OCL violations are recorded in the Model Validation Output window.
Defining OCL Constraints for a Relationship
You can add OCL constraints to a Relationship using the Properties dialog (Element | Properties). Select the Constraints tab, click on the Type drop-down arrow and select OCL.
Important: To have a valid OCL constraint, the syntax must be correctly formed. If the expression is not correct, Enterprise Architect displays a message stating that the OCL constraint is not valid.
To perform an OCL Validation, display the Model Validation Configuration dialog and select the Relationship: (OCL) Conformance checkbox. Any OCL violations are recorded in the Model Validation Output window.
Defining OCL Constraints for a Feature (Attribute)
You can add OCL constraints to a Feature using the Properties dialog (Element | Properties). Select the Constraints tab, click on the Type drop-down arrow and select OCL.
Important: To have a valid OCL constraint, the syntax must be correctly formed. If the expression is not correct, Enterprise Architect displays a message stating that the OCL constraint is not valid.
To perform an OCL Validation, display the Model Validation Configuration dialog and select the Feature: (OCL) Conformance checkbox. Any OCL violations are recorded in the Model Validation Output window.
See Also