Java Reference
In-Depth Information
mapping mindmap::Topic::toRequirement() : requirements::Requirement {
title := self .name;
children += self .subtopics. map toRequirement();
dependencies += this .dependencies
-> select (source = self ).target. late
resolveIn (mindmap::Topic::toRequirement,
requirements::Requirement);
}
Here we've reworked our example a bit to illustrate late resolveIn . A
dependencies property is declared in the transformation and initialized in our
main mapping using a query that selects all Relationships of Type::DEPEN-
DENCY (not shown). When mapping our Topic elements to Requirement ele-
ments, we add to the Requirement's dependencies list those Requirements that
were resolved using the toRequirement() mapping, where the Topic is speci-
fied as the target of the Relationship and where the current Topic is the source.
During execution, all Topics might not yet have been processed, so late enables
us to avoid a second pass. Section 6.6, “Transforming a Mindmap to
Requirements,” fully explains this example.
Note that although it's legal to combine the inv variant with a late opera-
tor, it doesn't make much sense to do so. This is because the source object would
always be available using a non- late resolve operation.
13.5.7 Executing Transformations
Some things that occur during execution of a QVT script are more clear when
we have a debugger, trace model, or log facility. This section discusses the exe-
cution facilities that are available in the QVTO runtime. Unfortunately, no
debugger is yet available from M2M QVTO.
Trace Model
Execution of a transformation results in one or more target models and a corre-
sponding trace model. The trace model contains a recording of each mapping,
including input model element and target model element instance data. The trace
model is consulted during execution and for reconciliation during subsequent
transformation, to allow for model update semantics.
When an object is created within a transformation, an entry in a trace file is
made. When using M2M OML, you'll find a .qvtotrace model file created
when you execute a transformation, as specified in the launch configuration. Feel
free to examine this model to better understand its contents and how it works.
Search WWH ::




Custom Search