Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] casting of refImmediateComposite() needed ?
[ATL] casting of refImmediateComposite() needed ? [message #629443] Tue, 28 September 2010 10:14 Go to next message
El Arbi Aboussoror is currently offline El Arbi AboussororFriend
Messages: 90
Registered: June 2010
Member
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 #629457 is a reply to message #629443] Tue, 28 September 2010 11:10 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
You're in refining mode right ?
Re: [ATL] casting of refImmediateComposite() needed ? [message #629466 is a reply to message #629457] Tue, 28 September 2010 12:18 Go to previous messageGo to next message
El Arbi Aboussoror is currently offline El Arbi AboussororFriend
Messages: 90
Registered: June 2010
Member
yes
Re: [ATL] casting of refImmediateComposite() needed ? [message #629469 is a reply to message #629443] Tue, 28 September 2010 12:21 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
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.
Previous Topic:[ATL] convert attribute type error
Next Topic:[QVTO] Black box queries in org.eclipse.m2m.qvt.oml_1.0.1
Goto Forum:
  


Current Time: Thu Apr 25 13:25:42 GMT 2024

Powered by FUDForum. Page generated in 0.02802 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top