Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [ATL] casting of refImmediateComposite() needed ?
[ATL] casting of refImmediateComposite() needed ? [message #629443] Tue, 28 September 2010 06:14 Go to next message
Eclipse UserFriend
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 07:10 Go to previous messageGo to next message
Eclipse UserFriend
You're in refining mode right ?
Re: [ATL] casting of refImmediateComposite() needed ? [message #629466 is a reply to message #629457] Tue, 28 September 2010 08:18 Go to previous messageGo to next message
Eclipse UserFriend
yes
Re: [ATL] casting of refImmediateComposite() needed ? [message #629469 is a reply to message #629443] Tue, 28 September 2010 08:21 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 13:46:38 EDT 2025

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

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

Back to the top