Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 508555

Summary: Reconnect edge tool does not work as described in the documentation at the .odesign level
Product: [Modeling] Sirius Reporter: Amine Kechaou <aminekechaou>
Component: DiagramAssignee: Jessy Mallet <jessy.mallet>
Status: CLOSED FIXED QA Contact: Julien Dupont <julien.dupont>
Severity: normal    
Priority: P3 CC: julien.dupont, maxime.porhel, pierre-charles.david
Version: 4.1.1Keywords: triaged
Target Milestone: 5.1.0   
Hardware: PC   
OS: Windows 10   
Whiteboard: siriuscon2016, backport

Description Amine Kechaou CLA 2016-12-01 14:13:14 EST
We've experienced that variables in the reconnect edge tool do not point on the objects they are expected to point on as described in the documentation https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#edges

For example, source should be the semantic element which is pointed before the reconnect and target should be the semantic element which is pointed after the reconnect. However, in the reconnect edge tool, source points on the element at the source end of the edge and target points on the element at the target end.

Interestingly, this behavior is only manifested at the .odesign file level. If you try to pass all the variables as parameters to an external java action and test their type and the elements on which they point on, you will find that they work as expected, as described in the documentation.

Also, we've noticed that variables do not change accordingly when switching between a reconnect source, target or both.
Comment 1 Maxime Porhel CLA 2016-12-09 03:41:00 EST
Hi Amine, 

Note: https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#edges documentation describes the behavior of the different edge mappings. The reconnection tools section is below (but there is no direct link, look for "Reconnect Edge" section in the same page)

For the Reconnection Tool case, you documentation indicates: 
> The body of the tool is evaluated on the target semantic element of the edge that the user wants to reconnect,
> with the following variables available to describe the reconnection:
>  . source: the semantic element which is pointed before the reconnect.
>  . target: the semantic element which is pointed after the reconnect.
>  . sourceView : the graphical element which is pointed before the reconnect.
>  . targetView : the graphical element which is pointed after the reconnect.
>  . otherEnd : the edge end (graphical element) that has not changed during the reconnection
>  . edgeView : the Edge after the graphical reconnection
>  . diagram : the current Diagram.
>  . element: the semantic element of the current edge.

There is also an image to illustrate this on the reconnectTarget case. 

Note that if you are dealing with a reconnect tool for a Relation based Edge, the semantic element of the edge will be the semantic element fo the source node.

Note that we recommend to avoid the creation of reconnect "both" tools, as making two distincts tools for reconnect source and reconnect target is generally simpler and easier to maintain.
Comment 2 Maxime Porhel CLA 2016-12-09 03:43:28 EST
Hi Amine, 

Thanks for your detailed bug report. It seems that there is effectively an issue around the completion and the validation mechanism on the VSM side. Nevertheless, it's not yet in the scope of a future release.

Regards,

Maxime
Comment 3 Maxime Porhel CLA 2016-12-09 04:07:27 EST
org.eclipse.sirius.diagram.business.internal.dialect.description.DiagramToolInterpretedExpressionTargetSwitch might need to have a specific behavior for the caseReconnectEdgeDescription

an other entry possible entry point might be org.eclipse.sirius.business.api.dialect.description.AbstractInterpretedExpressionQuery.getAvailableVariables()
Comment 4 Pierre-Charles David CLA 2017-05-18 05:55:15 EDT
Sorry to move this, but we won't have the resources to work on this for 5.0. Marking as a backport candidate for a future 5.0.x if possible.
Comment 6 Pierre-Charles David CLA 2017-11-08 03:37:46 EST
Available in Sirius 5.1.0, see https://wiki.eclipse.org/Sirius/5.1.0.