[ATL] casting of refImmediateComposite() needed ? [message #629443] |
Tue, 28 September 2010 06:14  |
Eclipse User |
|
|
|
Hi,
I have defined this helper :
helper def : getZLayoutByComponentType(is : Datasim!InformationSystem, type : String) : Real =
is.zLayouts->select(layout | layout.componentType.toString() = type).first().z;
I use this helper in this rule :
rule layoutCubes {
from
sCu : Datasim!Cube
to
tCu : Datasim!Cube (
z <- thisModule.getZLayoutByComponentType(
thisModule.resolveTemp(sCu.refImmediateComposite(),'tIS') , 'Cube'),
...
When I launch my transformation I have this message :
org.eclipse.m2m.atl.engine.emfvm.VMException: Feature zLayouts does not exist on Element
Do I need to cast the refImmediateComposite returned element ?
if yes how ?
Thanks
|
|
|
|
|
Re: [ATL] casting of refImmediateComposite() needed ? [message #629469 is a reply to message #629443] |
Tue, 28 September 2010 08:21  |
Eclipse User |
|
|
|
As I assume you're in refining mode, you have to know that this mode works with a refining trace model that stores all the transformation you're making on the model. That refining trace model is then used to apply the changes on the input model.
So, in refining mode, you're not really working on the elements themselves but on the corresponding refiningTrace elements.
In fact, when you execute thisModule.resolveTemp(sCu.refImmediateComposite(),'tIS') , 'Cube') , this will return the refining Trace element associated with the real element you targetted.
So, the error you get is not a "cast" error. It's just telling you that zLayouts doesn't exist on the type Element of the meta-model RefiningTrace.
I'm afraid, you'll have to find another way to access the zLayouts of the element.
|
|
|
Powered by
FUDForum. Page generated in 0.46304 seconds