Community
Participate
Working Groups
Created attachment 265558 [details] test case Steps to reproduce: * Import the attached test case and open the diagram "new Package" * Create an edge between ClassA and ClassB with the edge creation tool. * The edge is removed by the refresh => OK * Perform undo * With the Model requests interpreter view, select the ClassA Node and test this expression: aql:self.getOutgoingEdges * A DEdge (detached from its parent) appears => KO
In this test case, the edge creation tool create a new DEdge inconsistent with the mapping precondition. Therefore, the refresh will remove this edge in the same transaction. The DEdge is created by org.eclipse.sirius.diagram.business.internal.experimental.sync.DDiagramElementSynchronizer.createNewEdge(...). The setSourceNode and setTargetNode methods are called before the attach to its parent so the changeRecorder does not record those feature changes but only the eOpposite (outgoingEdges). When the DEdge cross references are removed, the sourceNode feature change is created. The changeRecorder consolidation does not know the first setSourceNode that why the undo partially reverse the changes.
New Gerrit change created: https://git.eclipse.org/r/85696
Gerrit change https://git.eclipse.org/r/85696 was merged to [v2.0.x]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=c6a58b1d29c53b0c43f15e2f9713797946c0287d
Created attachment 265568 [details] test case
Created attachment 265569 [details] Use case for validation (comment 5) Steps used to validate (validated on a Sirius 2.0.7 stable 2.0.7-S20161124-100058): * Import project from useCase_508106.zip * Open the diagram "new Package" * Open the "Model requests interpreter" view * Write expression <%self.outgoingEdges%> * Select the node "ClassA" * Number of returned elements must be 0. * Use the tool "Create Reference" between ClassA and ClassB (the edge is not visible, as expected) * Undo * Select again the node "ClassA" * Number of returned elements must be 0. It is 1 with the bug.
New Gerrit change created: https://git.eclipse.org/r/85872
Gerrit change https://git.eclipse.org/r/85872 was merged to [v2.0.x]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=109a36762de9cae10295d713ae4b6d940323f1a9
Available in Sirius 2.0.7, see https://wiki.eclipse.org/Sirius/2.0.7.