Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Loop in Acceleo(break a loop)
Loop in Acceleo [message #1731463] Thu, 05 May 2016 15:17 Go to next message
walter arboleda is currently offline walter arboledaFriend
Messages: 4
Registered: May 2016
Junior Member
How i can break a loop in acceleo?, i need only one ocurrence of the finded element. Or there is other form?
Re: Loop in Acceleo [message #1731509 is a reply to message #1731463] Fri, 06 May 2016 10:35 Go to previous messageGo to next message
Eclipse UserFriend
If you only need the first ocurrence, why are you using a loop?
You can directly get a single occurence from a collection using OCL.

El 05/05/2016 a las 19:32, walter arboleda escribió:
> How i can break a loop in acceleo?, i need only one ocurrence of the
> finded element. Or there is other form?
Re: Loop in Acceleo [message #1732589 is a reply to message #1731509] Wed, 18 May 2016 11:36 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

It is not possible to break a loop in Acceleo. You'll have to reduce the list of elements to only those on which you want to iterate beforehand, or as the anonymous poster above mentionned, directly retrieve the one element you want.

For example, [list->first()/] will return the first element of a sequence.

Laurent Goubet
Obeo
Previous Topic:Acceleo does not regenerate
Next Topic:tag []
Goto Forum:
  


Current Time: Tue Apr 23 07:38:33 GMT 2024

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

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

Back to the top