Java Reference
In-Depth Information
cause some conflicts because you cannot guarantee that the model name is
unique. Technically, the NS URI is no guarantee of uniqueness, but it gives a
much higher degree of confidence. Following is another modeltype declaration
that uses just the model name:
modeltype
UML
uses
simpleuml;
A modeltype declaration can also include a
strict
qualifier. By default,
model types are effective and flexible, in that they allow the transformation to
work with similar model types. For example, slight version changes of a meta-
model might not impact a QVT definition, so the
effective
declaration allows
these instances to be processed. If the transformation author requires a specific
metamodel to be used, adding
strict
before the
uses
clause provides the
required enforcement. For example, this is a fully qualified modeltype declara-
tion using
strict
compliance:
modeltype
UML 'strict'
uses
simpleuml('http://www.eclipse.org/examples/1.0.0/simpleuml');
You also can restrict the model type using a
where
clause. For example, the
following declaration imposes the restriction that a model must have at least one
Class
. This capability allows for a degree of validation of input models without
executing the transformation.
modeltype
UML
uses
simpleuml('http://www.eclipse.org/examples/1.0.0/simpleuml')
where
{
self
.ownedElements->
closure
(
oclIsKindOf
(UML::Class))->size() > 0};
Currently, the M2M QVTO implementation produces a warning that meta-
model conditions are not supported.
NOTE
The use of
closure()
in the previous statement is nonstandard.
Although QVT extends standard OCL libraries, this is not a QVT function.
The
closure
iterator is provided by MDT's OCL component and works
nicely in this case.
Search WWH ::
Custom Search