Inter-Model Refenrence, How do I do it correctly? [message #990799] |
Fri, 14 December 2012 05:18  |
Eclipse User |
|
|
|
I made an example and replicated the error. So let me explain the Models first.
I want to transform my "source model" into my "target model".
My "source model" references an Object from a "core model".
"Allow inter-model reference" is active, when i do the transformation.
But when I debug the transformation, the references from "source model" to the "core model" are all unknown. I see the reference to the object "core" (<unknown>!<unnamed>),
and his attribute "name". The content of the attribute is "OclUndefined".
The content of the Attribute should be: "CoreName"
So my Questions is: Why arent the references between this models sloved correctly?
Or what did I do wrong?
I hope you can help me with this example. If you need more information, i am happy to provide them.
regards
Tim
The ATL file:
module source2target;
create OUT : tar from IN : src;
helper def : getModel(): tar!TargetModel = tar!TargetModel->allInstances()->first();
rule m2m {
from srcModel : src!SourceModel
to
model : tar!TargetModel()
}
rule c2c {
from sourceClass : src!SourceClass
using{
model : tar!TargetModel = thisModule.getModel();
}
to
tar : tar!Target (name <- sourceClass.core.name)
do{
model.target <- tar;
}
}
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10724 seconds