Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Eclipse Sirius: How to access ancestors of the EObject of a line mapping?(I am try to create a column for name of an ancestor of the line mapping object. What field in the line/featureColumn mapping must be used for this? How would the expression look? )
Eclipse Sirius: How to access ancestors of the EObject of a line mapping? [message #1695259] Wed, 13 May 2015 06:21 Go to next message
Vijetha Shivarudraiah is currently offline Vijetha ShivarudraiahFriend
Messages: 3
Registered: May 2015
Junior Member
I have tried giving this value to the LabelExpression of the column"[lineSemantic.oclAsType(<myClassForTheLineMapping>).ancestors().eContainer(<AncestorClassName>)/]. This doesn't seem to work.

I have tried giving "[thisEObject.ancestors()/]" value to the Associated Elements expression. But I don't know how to make us of it to display the value in the column.

Re: Eclipse Sirius: How to access ancestors of the EObject of a line mapping? [message #1695974 is a reply to message #1695259] Wed, 20 May 2015 16:46 Go to previous message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 174
Registered: October 2014
Senior Member
Le 13/05/2015 15:23, Vijetha Shivarudraiah a écrit :
> I have tried giving this value to the LabelExpression of the
> column"[lineSemantic.oclAsType(<myClassForTheLineMapping>).ancestors().eContainer(<AncestorClassName>)/].
> This doesn't seem to work.
>
> I have tried giving "[thisEObject.ancestors()/]" value to the Associated
> Elements expression. But I don't know how to make us of it to display
> the value in the column.
>
>
Hi
Could you precise what you expect as a result please.

> column"[lineSemantic.oclAsType(<myClassForTheLineMapping>).ancestors()
As ancestors is not a method specific to <myClassForTheLineMapping> you
can do without oclAsType

Based of what I guessed :
> ... .ancestors().eContainer(<AncestorClassName>)
If you want the first ancestor of type <AncestorClassName> just use
eContainer(<AncestorClassName>)
Or if you want all ancestors of type <AncestorClassName> use
ancestors(<AncestorClassName>)

So it would become [lineSemantic.eContainer(<AncestorClassName>)/] or
[lineSemantic.ancestors(<AncestorClassName>)/]


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Filter elements according to an attribute
Next Topic:Display Semantic properties on the Label
Goto Forum:
  


Current Time: Wed Jan 20 04:54:16 GMT 2021

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

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

Back to the top