Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:05 Go to next message
Mohammad Inayatullah is currently offline Mohammad InayatullahFriend
Messages: 21
Registered: May 2019
Junior Member
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 13:16 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7680
Registered: July 2009
Senior Member
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: Thu Dec 05 11:10:55 GMT 2024

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

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

Back to the top