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

Bug 508556

Summary: Variables missing in the precondition of the reconnect edge tool
Product: [Modeling] Sirius Reporter: Amine Kechaou <aminekechaou>
Component: DiagramAssignee: Jessy Mallet <jessy.mallet>
Status: CLOSED FIXED QA Contact: Julien Dupont <julien.dupont>
Severity: enhancement    
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   
See Also: https://git.eclipse.org/r/101504
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=7d83ced3b2347d2e888e3a4898e15aab66cd7d3f
Whiteboard: siriuscon2016

Description Amine Kechaou CLA 2016-12-01 14:17:01 EST
In the precondition of the reconnect edge tool, it would be nice to have access to other variables like source and target (like in the edge creation tool), rather than just to container.
Comment 1 Maxime Porhel CLA 2016-12-09 04:50:18 EST
Hi Amine, 

Note that the variable are not displayed in the completion and will make the validation fail but they are available at runtime for the evaluation of Reconnection tool's precondition, here are the name and meaning of those variables:
 . 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.
 . diagram : the current Diagram.

It seems you already have access to edgeView and otherEnd, so its possible to use edge.sourceNode and edge.targetNode to retrieve the source and target of the edge) but also to the "other end" ie the fixed end of the edge during the reconnect (as illustrated in the Reconnect Edge section of https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html).

Note that we recommend to create two reconnect tools (one with kind Source, the other with kind Target) instead of one single "kind=both" tool. This simplify the preconditions and the model operation as each tools knows its context: ie "sourceView/targetView" are the old/new  source or target regarding the reconnection kind of the tool and the specifier has no need to try to identify the kind from the user interaction (if the tool is configured with kind=both). 

Having the currently hidden variable in the completion would be a great help. Nevertheless, it's not yet in the scope of a future release.

Regards

Maxime
Comment 2 Pierre-Charles David CLA 2017-05-18 05:55:27 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 3 Eclipse Genie CLA 2017-07-19 05:23:54 EDT
New Gerrit change created: https://git.eclipse.org/r/101504
Comment 4 Jessy Mallet CLA 2017-07-24 06:43:21 EDT
Step to reproduce: 
 . create a modeling project with odesign file inside
 . Open the odesign file and unfold Rectilinear>MyRectilinearEdgeViewpoint>ClassDiag>Default>Section
 . Click on tool "Reconnect Edge" and open properties view
 . On Precondition field, make sure that you have access to "container"/"source"/"sourceView"/"target"/"targetView" variables with autocompletion.
 . Launch a validation on the tool, no errors should be detected
Comment 6 Pierre-Charles David CLA 2017-07-27 02:53:56 EDT
Fixed by 7d83ced3b2347d2e888e3a4898e15aab66cd7d3f.
Comment 7 Pierre-Charles David CLA 2017-11-08 03:37:00 EST
Available in Sirius 5.1.0, see https://wiki.eclipse.org/Sirius/5.1.0.