Home » Modeling » ATL » Containment references cannot span across models (Several output models need to be merged in one file)
| Containment references cannot span across models [message #975246] |
Wed, 07 November 2012 13:27  |
Gunnar Arndt Messages: 46 Registered: June 2012 |
Member |
|
|
Hi forum members,
I've been using ATL happily for months now to create a transformation from a vendor-specific model to an open model called OTX. Its purpose is to describe diagnostic procedures.
The ATL file has grown to more than 4kLOC, and seems that I've just run into a serious problem.
The target Ecore model, OTX, has a submodel, DiagCom, which is an Ecore model, too (I received them as XML schema definitions, which I imported with the Ecore tools). Both of them are output models to the ATL transformation:
create OUT: otx, diag: otxDiagCom from IN: transformate;
In the run configuration, there is a file for each model, but all the output shall be put into the OTX output model/file, whereas the DiagCom output file shall remain empty.
That works fine when a DiagCom target element is put into an OTX element within the rule that creates it, but - and that's my problem - it does not work for a set of rules where a DiagCom target element is not put into an OTX element immediately, but by another rule:
lazy rule Asam3dResponse2ResponseParameters {
from
source: transformate!Asam3dResponse
to
-- This target element from DiagCom is not put anywhere in the current rule,
-- which makes it reside in the DiagCom output file eventually.
-- There is nothing I can do about that, although I need it in the OTX file
-- and it should be put there by the next rule 'Asam3dCallServiceTactic2Action'.
otxResponseParameters: otxDiagCom!ResponseParameters(
name <- otxStringTerm
),
otxStringTerm: otx!StringLiteral(
value <- source.name
)
}
lazy rule Asam3dCallServiceTactic2Action {
from
source: transformate!Asam3dCallServiceTactic,
to
otxAction: otx!Action(
id <- thisModule -> getId(),
realisation <- otxExecuteDiagService
),
-- This output element eventually resides in the OTX output file,
-- although it is from the DiagCom model. This is how I need it!
-- I guess it works because it is put into an OTX element right above,
-- i.e. in the very rule where it is created.
otxExecuteDiagService: otxDiagCom!ExecuteDiagService(
diagService <- otxDiagServiceValue,
-- The DiagCom target element 'otxResponseParameters' from the above rule
-- 'Asam3dResponse2ResponseParameters' should be put in the current
-- output element 'otxExecuteDiagService' here, but, as written above,
-- goes to the DiagCom output file.
responseParameters <- source.service.responses
-> collect(response | thisModule ->
Asam3dResponse2ResponseParameters(response))
),
otxDiagServiceValue: otxDiagCom!DiagServiceValue(
valueOf <- source.service.name
)
}
I would more than glad if you could help me with that - it would be a total disaster if I had to rework the whole project without ATL, because I'm running short on time (and it's more fun that way).
Thank you for reading!
|
|
|
Goto Forum:
Current Time: Thu May 23 19:32:37 EDT 2013
Powered by FUDForum. Page generated in 0.01620 seconds
|