Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Iterate on classes using associations
Iterate on classes using associations [message #1788395] Wed, 30 May 2018 17:19 Go to next message
Dim Gle is currently offline Dim GleFriend
Messages: 5
Registered: April 2018
Junior Member
I need to travel from a class to another using an association and I need to have the 'Class Object' in Acceleo because I have to iterate on its methods.
I am able to obtain the name of the target class of the association but I can't use the same trick to obtain the class object because I have a type 'Type'.

I attach my code to explain better my environment .

[template public getPOSTHandler(c : Class)]
[for (a : Association | c.getAssociations())]
[for (s : Stereotype | a.getAppliedStereotypes())]
[if ('ConcreteObjectRef')) and (not a.ownedEnd.getOtherEnd()->at(1) )]

# Obtain Name
# What I need to do:



[template public findPOSTHandler(c : Class)]
[for (op:Operation | c.getAllOperations()) ]
[for (s : Stereotype | op.getAppliedStereotypes())]

Thank you in advance.
Re: Iterate on classes using associations [message #1788632 is a reply to message #1788395] Wed, 30 May 2018 19:17 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7665
Registered: July 2009
Senior Member

In OCL you use oclAsType(T) to cast to a T,


Ed Willink
Previous Topic:Problem in selecting SoaML MetaModel Uri while creating Acceleo Project?
Next Topic:Does Acceleo support Break and Continue in for loops ?
Goto Forum:

Current Time: Mon Jul 22 09:22:57 GMT 2024

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

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

Back to the top