|[QVTO] Bug or feature: Order of 'out' model parameters affects transformation results [message #675701]
||Wed, 01 June 2011 08:46
| Toni Ruokolainen
Registered: June 2011
This is my first post to the forum. I'm developing a quite complex model transformation which creates multiple (four) output models from a single input model.
Here is the signature and the main -section of the operational transformation
(the transformation itself is so huge that I won't post it here):
transformation UML2EcosystemModel(in input : UML, in ecoprof : UML, in ecoMM : INT,
out int : INT, out ecosystem : ECO, out domont : DO, out ecore : ECORE);
The transformation creates four output models (int, ecosystem, domont and ecore)from a single UML model (input). The ecoprof and ecoMM models are used for facilitating certain operations in the transformation and they are static in nature.
The resulting 'domont' model references both 'int' and 'ecosystem' models.
I struggled for a few days with the transformation and tried all kinds of tricks, due to the fact that inter-model references between the output models didn't work. I used assert -clauses in the transformation to make sure that the references were actually resolved correctly during the transformation (they were). However, when I looked at the resulting models, the references were not stored in the models, except only between 'domont' and 'ecosystem' models. That is, while the references were resolved correctly also between 'domont' and 'int' models, they were not included in the resulting models.
Today I realized, that actually what was wrong in this transformation, was that the order of the model parameters in the transformation signature is significant and has semantic meaning. Element references between output models do not work, if the target model for the refences is later in the sequence of model parameter declarations. I.e. in my case, the correct order for model parameter declarations, is (as in the above transformation signature):
out int : INT, out ecosystem : ECO, out domont : DO
out ecosystem : ECO, out int : INT, out domont : DO
If the order is, as it was originally in my transformation, like this:
out ecosystem : ECO, out domont :DO, out int : INT
the resulting 'domont' model will only contain references to the 'ecosystem' model; the references to 'int' model are resolved correctly in the transformation, but are not 'stored' in the corresponding outputs.
Now I'm wondering whether this is a bug or a feature in QVT standard or QVTo implementation. I checked the QVT -standard (version 08-04-03). While modelParameter reference from the OperationalTransformation element of the QVT metamodel is ordered, I couldn't find any declaration for the fact that the ordering does have an effect on the transformation results. Does anyone have any clue what is the situation with this, and possibly a reference to a document which states this fact (or a bug report, possibly)?
Sorry for the long post!
Powered by FUDForum
. Page generated in 0.02777 seconds