The import statement is therefore an Eclipse OCL extension that is likely to be part of a future OCL specification revision.Zero or more import statements may be present to specify the URIs of external model elements and optionally alias names for those elements.

validating uml models and ocl constraints-58validating uml models and ocl constraints-74

The package context declaration may be omitted if subsequent classifier context declrations have a fully qualified name identifying the package.

A definition starts with the new feature name, then the parameters for operations and the feature type followed by an OCL expression that evaluates the operation or the property.

The document provides six invariants, at least three of which detect problems that were encountered by users during the Indigo release cycle.

We therefore want to diagnose that a derivation if an EStructural Feature has a derivation then the volatile declaration is also present to avoid the derivation being ignored.

At the time of writing, just before Kepler, the underlying Papyrus problem has been cured but a minor problem remains.

It is noit clear whether this will be fixed in Papyrus 0.10.0. These are all just examples of how constraints may use the Xtext model.

Now right click within the Sample Ecore Editor pane as described in Load Complete OCL Resource Menu Action and load You may edit the Complete OCL to experiment with alternate constraints or messages.

However the Complete OCL complements the meta-model and EMF does not support live modification of meta-models.

By itself OCL is almost useless, since without any models to operate on, the constraints cannot achieve a great deal.

The simplest way to make OCL useful is to embed OCL expressions within a model to enrich the basic structural characteristics of a model with more complex behavior.

This tutorial introduces the Complete OCL language which may be used to provide a self-standing document that complements a pre-existing meta-model.