Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Galileo, XPAND] Loop using the expression FOREACH
[Galileo, XPAND] Loop using the expression FOREACH [message #869314] Thu, 03 May 2012 08:09 Go to next message
Ricardo Ben Amor is currently offline Ricardo Ben Amor
Messages: 51
Registered: March 2012
Member
Hi everyone,

I have a little problem for doing my work. To be clear, I have 3 arguments "FramePort, Length and SlotID" with 121 elements each.
The different argument are in different part of my file. So I would like to create a loop from 0 to 121.

Now, when I'm using my loop FOREACH, i have the right argument "SlotID" but for my two others arguments, I have the all collection for each iteration.

«LET this.topLevelPackages.......framePort AS FramePort-»
«LET this.topLevelPackages.......frameLength AS Length-»

«FOREACH  topLevelPackages........slotId AS SlotID ITERATOR SlotIDCounter-»

Slot ID : «SlotID»
Length  : «Length»
FramePort	: «FramePort»

«ENDFOREACH-»


«ENDLET»
«ENDLET»


Thanks you in advance,

Regards,

[Updated on: Thu, 03 May 2012 08:16]

Report message to a moderator

Re: [Galileo, XPAND] Loop using the expression FOREACH [message #869625 is a reply to message #869314] Thu, 03 May 2012 18:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6327
Registered: July 2009
Senior Member
Hi,

since you dotted out a lot i do not really get your problem.
what about

«FOREACH topLevelPackages……..parent AS parent ITERATOR SlotIDCounter-»

Slot ID : «parent .SlotID»
Length : «parent .Length»
FramePort : «parent .FramePort»

«ENDFOREACH-»

if your structure is different it would be nice of you share a complete
reproducable example

~Christian
Re: [Galileo, XPAND] Loop using the expression FOREACH [message #869753 is a reply to message #869625] Fri, 04 May 2012 08:12 Go to previous messageGo to next message
Ricardo Ben Amor is currently offline Ricardo Ben Amor
Messages: 51
Registered: March 2012
Member
Sorry you're right, but indeed my structure is different, like this :

«LET this.topLevelPackages.arPackage.elements.get(2).ecuInstance.connectors.flexRayCommunicationConnector.ecuCommPortInstances.framePort AS FramePort-»
«LET this.topLevelPackages.arPackage.elements.get(5).frame.frameLength AS Length-»

«FOREACH  topLevelPackages.arPackage.elements.get(1).flexrayCluster.physicalChannels.flexrayPhysicalChannel.frameTriggeringss.flexrayFrameTriggering.absolutelyScheduledTimings.absolutelyScheduledTiming.slotId AS SlotID ITERATOR SlotIDCounter-»

Slot ID : «SlotID»
Length  : «Length»
FramePort	: «FramePort»

«ENDFOREACH-»

«ENDLET»
«ENDLET»


Regards,
Re: [Galileo, XPAND] Loop using the expression FOREACH [message #869917 is a reply to message #869753] Fri, 04 May 2012 19:42 Go to previous message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6327
Registered: July 2009
Senior Member
Still the question: at which points in your metamodel are the 1..* relationships?
Previous Topic:[acceleo] unable to load JAR-packaged EMTLs on unix
Next Topic:[Acceleo] Test for an undefined enumeration in OCL
Goto Forum:
  


Current Time: Thu Oct 02 02:22:27 GMT 2014

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

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