Stange behavior associated elements for edges [message #1739436] |
Mon, 01 August 2016 07:03  |
Eclipse User |
|
|
|
Hi,
I have a simple metamodel that contains Systems and Connections. Connections a source and destination association to a System.
I also created a vsp allowing visualization of such structures. In that, I attempted to visualize information about the source and the destination when selecting the Connection. This can be done with the associated elements expressions. I used two forms:
1) [ Sequence { self, self.source } /]
2) aql: Sequence { self, self.source }
So the first is done by MTL, the second one by aql. The first one works as expected, the second one doesn't.
Am I making a mistake or is sirius doing it? I attached the metamodel, vsp and example model.
Greetings,
Wilbert
|
|
|
Re: Stange behavior associated elements for edges [message #1739468 is a reply to message #1739436] |
Tue, 02 August 2016 03:38   |
Eclipse User |
|
|
|
Hello
For an EdgeMapping, in the "Associated Elements Expression", self is the target semantic element of the DDiagramElement (DEdge in your case). The target semantic element of a DEdge is the target semantic element of the source DNode, that is the System, in your case. In your meta model, source is not a feature of System but Connection.
Note that in the "Associated elements Expression", a variable named view, is available and corresponds to the DEdge.
Then you more explicitly access to what you want.
For example: aql: Sequence{view.sourceNode.target, view.targetNode.target} will give you the semantic element of the source and target node.
Note also that, in that way, you need to know the sirius meta-model (viewpoint.ecore [1])
Regards
Laurent
[1] https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/tree/plugins/org.eclipse.sirius/model/viewpoint.ecore
Wilbert Alberts wrote on Mon, 01 August 2016 11:03Hi,
I have a simple metamodel that contains Systems and Connections. Connections a source and destination association to a System.
I also created a vsp allowing visualization of such structures. In that, I attempted to visualize information about the source and the destination when selecting the Connection. This can be done with the associated elements expressions. I used two forms:
1) [ Sequence { self, self.source } /]
2) aql: Sequence { self, self.source }
So the first is done by MTL, the second one by aql. The first one works as expected, the second one doesn't.
Am I making a mistake or is sirius doing it? I attached the metamodel, vsp and example model.
Greetings,
Wilbert
|
|
|
|
Re: Stange behavior associated elements for edges [message #1739472 is a reply to message #1739470] |
Tue, 02 August 2016 04:26  |
Eclipse User |
|
|
|
Wow,
I found it! And this seems to be a bug to me.
This one does not work:
aql: Sequence { self, self.destination }
This one does work:
aql: Sequence{ self, self.destination }
The difference? The one that does work has no space between 'Sequence' and '{'. The one that doesn't work has a space.
Do I need to file a bug for this one?
Greetings,
Wilbert.
|
|
|
Powered by
FUDForum. Page generated in 0.04401 seconds