Bug 191326 - Links can be created which should not be createable
Summary: Links can be created which should not be createable
Status: NEW
Alias: None
Product: GMF-Tooling (ARCHIVED)
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows Vista
: P3 minor (vote)
Target Milestone: 3.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 148275
Blocks:
  Show dependency tree
 
Reported: 2007-06-06 14:19 EDT by Steffen Becker CLA
Modified: 2011-05-01 08:39 EDT (History)
0 users

See Also:


Attachments
domain model (968 bytes, text/plain)
2007-06-12 07:12 EDT, Dmitry Stadnik CLA
no flags Details
gen model (1.22 KB, text/plain)
2007-06-12 07:13 EDT, Dmitry Stadnik CLA
no flags Details
sketch model (503 bytes, text/plain)
2007-06-12 07:14 EDT, Dmitry Stadnik CLA
no flags Details
diagram gen model (3.71 KB, text/plain)
2007-06-12 07:14 EDT, Dmitry Stadnik CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Becker CLA 2007-06-06 14:19:33 EDT
Build ID: 3.3M7

Steps To Reproduce:
1. Create a Meta-Model having a container class containing nodes. A node has a bidirectional link with roles successor and predeccessor both of cardinality 0..1
2. Create respective GMF Mapping, Map container to canvas and node to node, the link to a link mapping
3. Generate diagram code
4. Run the diagram, create Node A, B, C. Connect A->B. Ensure predecessor and successor are set correctly. Now create a link C->B. Now predecessor of B is set to C instead of A. However, on the diagram now we have two links which is not in sync with the model. As far as I remember in some earlier version of GMF the second link was not createable

Workaround exists: Create a target link creation constraint checking whether the target node also has an incomming edge


More information:
I'm using GMF 2.0M7 on Eclipse 3.3M7
Comment 1 Dmitry Stadnik CLA 2007-06-12 07:12:41 EDT
Created attachment 70988 [details]
domain model
Comment 2 Dmitry Stadnik CLA 2007-06-12 07:13:17 EDT
Created attachment 70989 [details]
gen model
Comment 3 Dmitry Stadnik CLA 2007-06-12 07:14:02 EDT
Created attachment 70990 [details]
sketch model
Comment 4 Dmitry Stadnik CLA 2007-06-12 07:14:40 EDT
Created attachment 70991 [details]
diagram gen model
Comment 5 Dmitry Stadnik CLA 2007-06-12 07:23:10 EDT
I've attached models that allow to reproduce the problem.
There are two possible solutions: you may wish to forbid link creation if this leads to existing link destruction (that's what you've done with ocl constraints) and automatic link destruction (canonical edit policy should handle this).

I propose to do the following: if you want to forbid creation - add corresponding constraints, but GMF should destroy stale links anyway (and it does this actually but only when diagram is reopened). So I reassign this to Alexander Shatalin since he maintains canonical edit policies.
Comment 6 Alex Shatalin CLA 2007-06-12 12:27:19 EDT
Canonical Synchronization issue was reported as a part of Bug #148275
Comment 7 Artem Tikhomirov CLA 2007-06-21 07:03:48 EDT
Aligned milestone to match bug #148275
Comment 8 Alex Shatalin CLA 2008-06-04 11:56:02 EDT
Moving to the next version.
Comment 9 Eclipse Webmaster CLA 2010-07-19 22:21:57 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Generation was the original product and component for this bug