Skip to main content



      Home
Home » Eclipse Projects » Sirius » Stange behavior associated elements for edges
Stange behavior associated elements for edges [message #1739436] Mon, 01 August 2016 07:03 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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:03
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 #1739470 is a reply to message #1739468] Tue, 02 August 2016 04:16 Go to previous messageGo to next message
Eclipse UserFriend
Hi Laurent,

I think I understand your point and it is more or less (as far as I understand) correct in case I would have used a relation based edge. However, my VSP is using an element based edge and in that case the target semantic element of the edge is the element representing the edge itself.

However, I tried changing the 'associated elements' expression into what you suggested: aql: Sequence { self.sourceNode.target, self.sourceNode.target.source } and that didn't work.

Strangely, I get the following error message in the console (of the development eclipse instance from which I started the runtime I used to test) when I validate the vsp with your suggestion:

Caused by: java.lang.NumberFormatException: For input string: "self.sourceNode.target,self.sourceNode.target.source"

Greetings,
Wilbert.

[Updated on: Tue, 02 August 2016 04:18] by Moderator

Re: Stange behavior associated elements for edges [message #1739472 is a reply to message #1739470] Tue, 02 August 2016 04:26 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Obeo designer 9.0 under Win 7 is not started
Next Topic:Context menu
Goto Forum:
  


Current Time: Tue Mar 25 03:00:13 EDT 2025

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

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

Back to the top