OCL Conformance

This group validates an element, relationship or attribute against any defined constraints in the Object Constraint Language (OCL). OCL is used to describe expressions on UML models, and to express constraints free of side-effects. You can add OCL constraints to any element, relationship or attribute in Enterprise Architect.

Reported violations:

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.

 

Topics

Topic

Detail

See also

Define OCL Constraints for an Element

You can add OCL constraints to an element using the Properties dialog (Element | Properties); select the Constraints page, click on the Type drop-down arrow and select OCL.

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 tab of the Output window.

 

Model Validation Configuration

Model Validation

Define OCL Constraints for a Relationship

You can add OCL constraints to a relationship using the Properties dialog (right-click and select the <type> Properties context menu option); select the Constraints page, click on the Type drop-down arrow and select OCL.

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 tab of the Output window.

 

 

Define OCL Constraints for an Attribute

You can add OCL constraints to a feature using the Properties dialog (Element | Attributes); select the Constraints tab, click on the Type drop-down arrow and select OCL.

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 tab of the Output window.

 

 

Notes

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