Model Validation

Return to Introduction  Previous page  Next page

You use Model Validation to check UML models against known UML rules, as well as any constraints defined within the model, using the Object Constraint Language (OCL). You can run Model Validation against a single UML element, a diagram or an entire package, as described below.

Validating a UML:

·Element validates the element and its children, features (attributes and operations) and relationships (connectors and links)
·Diagram validates the diagram itself (for correctness) as well as any elements and connectors within the diagram
·Package validates the package and all subpackages, elements, connectors and diagrams within it.

To use Model Validation, follow the steps below:

1.Select the package, diagram or element either from the Project Browser window or within an open diagram.
2.Select the Project | Model Validation | Validate Selected menu option, or press [Ctrl]+[Alt]+[V].

Enterprise Architect performs the validation, and displays the results in the Output window. To display the Output window, select the View | Output menu option.

While performing the validation, Enterprise Architect also displays a progress window containing the Cancel Validation button, which enables you to cancel the validation process at any time.

ModelValidationProgressDialog

Alternatively, select the Project | Model Validation | Cancel Validation menu option.

Example Model Violations.

The following UML diagram contains several basic violations.

ModelValidationExample

If you run Model Validation on this diagram, Enterprise Architect displays the following violations in the Output window:

ModelValidationExampleOutput

The validation results show that the diagram:

·Contains a UML ExpansionRegion (ExpansionRegion1) with an invalid value for its 'mode' property (in this case, the valid values are iterative, parallel or stream)
·Contains an invalid self-generalization on Class2 (UML elements cannot be self-generalized)
·Contains an OCL violation for the anonymous Association (between Class2 and Object1)
·Contains a UML ExceptionHandler (ExceptionHandler1) that is missing its child input ObjectNode

Note: If you double-click on an error in the Output window, you select the diagram element that the error message refers to.

See Also