Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Access to Esuper classes of an Eclass in Acceleo
Access to Esuper classes of an Eclass in Acceleo [message #1787161] Sun, 20 May 2018 17:35 Go to next message
mamad . is currently offline mamad .Friend
Messages: 15
Registered: March 2018
Junior Member
hi guys,
I have a relationship in my MetaModel like below :
eclass3 -> eclass2 -> eclass1
it means eclass1 is Esupertype of eclass2 and eclass2 is Esupertype of eclass3 .
Can i access to eclass1 from eclass3 in Acceleo Templates?
some thing like [eclass1->parent->parent /] !!
Re: Access to Esuper classes of an Eclass in Acceleo [message #1787167 is a reply to message #1787161] Mon, 21 May 2018 07:34 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

eClass3.eSuperTypes.eSuperTypes should work, but remember that this is a shortform for eClass3.eSuperTypes->collect(c:EClass | c.eSuperTypes) so that the first eSuperTypes return a Collection whose member's eSuperTypes are gathhered into a flat, rather than nested Collection.

Often eClass3->closure(eSuperTypes) which is short for eClass3.oclAsSet()->closure(c:EClass | c.eSuperTypes) is more useful.

If you really want an exactly two level eSuperType ancestor and you are sure that exactly one exists: eClass3.eSuperTypes->any(true).eSuperTypes->any(true)

Regards

Ed Willink
Re: Access to Esuper classes of an Eclass in Acceleo [message #1787184 is a reply to message #1787167] Mon, 21 May 2018 14:07 Go to previous messageGo to next message
mamad . is currently offline mamad .Friend
Messages: 15
Registered: March 2018
Junior Member
Hi ,dear Ed Willink
Thanks for your reply.
I try [let eclass2 _temp : eclass2 = eclass3.eClass().eSuperTypes->any(true) ]
It runs without error but it gives me a warning and also don't works properly.
Warning is : Possible incompatible type between 'eclass2 ' and 'EClass'.

[Updated on: Mon, 21 May 2018 14:08]

Report message to a moderator

Re: Access to Esuper classes of an Eclass in Acceleo [message #1787185 is a reply to message #1787184] Mon, 21 May 2018 14:48 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Not surprising. What you are typing seems to be a total meta-mess. Cannot comment usefully without a repro.

Regards

Ed Wllink
Previous Topic:obtain class from operation
Next Topic:Problem in selecting SoaML MetaModel Uri while creating Acceleo Project?
Goto Forum:
  


Current Time: Thu Apr 25 04:02:56 GMT 2024

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

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

Back to the top