Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » Loop in the query of acceleo(Loop in the query of acceleo)
Loop in the query of acceleo [message #1809078] Mon, 08 July 2019 09:05 Go to next message
Eclipse UserFriend
Can any one please give some example of loop inside query of acceleo. i want to implement loop inside following query.

[query public getClassPropertyFromAssociation(p : Property) : OclAny =
if p.upper = -1 then
'public IList<'+p.type.name+'> '+ p.type.name.toUpperFirst() +'s { get; set; }'
else
'public '+ p.type.name+' '+p.type.name.toUpperFirst()+' { get; set; }'
endif/]
Re: Loop in the query of acceleo [message #1809080 is a reply to message #1809078] Mon, 08 July 2019 09:16 Go to previous message
Eclipse UserFriend
Hi

You don't provide any clue as to what ou want to loop over or with waht.

One common idiom is

Sequence{1..anOrderedCollection->size()}->iterate(i : Integer ... anOrderedCollection->at(i) ... )

Regards

Ed Willink
Previous Topic:Class properties from Element
Next Topic:Refer one mtl file in another
Goto Forum:
  


Current Time: Mon Jul 14 05:55:40 EDT 2025

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

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

Back to the top