Bug 117592 - CanonicalConnectionEditPolicy makes diagram dirty when creating edge if source is non-transient
Summary: CanonicalConnectionEditPolicy makes diagram dirty when creating edge if sourc...
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 major
Target Milestone: 1.0   Edit
Assignee: Mohammed Mostafa CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2005-11-22 17:19 EST by Min Idzelis CLA
Modified: 2008-08-13 13:06 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Min Idzelis CLA 2005-11-22 17:19:27 EST
In createConnectionView() (which is final, so it really makes extending a pain) there is a TODO - remove hack. This hack makes the edge view that will be created persisted if the edge source or target is not transient. I have a transient connection between a transient source, and a non-transient target. This makes my diagram come up dirty.
Comment 1 Min Idzelis CLA 2005-11-22 18:30:19 EST
After removing the hack, I see that the diagram is being set to dirty because of two reaons. SetConnectionEndsCommand is setting the source and target on the edge. 

This is causing the inverse relationship to add the edge to the views source edges/target edges. If the view that it's being connected to is persisted, the notification triggers the dirty adapter to change the dirty state. Maybe View should contain transientSources and transientTargets. 

Additionally, the SetConnectionBendpointsCommand is executed which sets bendspoints on the Edge. The DirtyAdapter is setting the diagram to dirty because a non-transient feature of RelativeBendpoints object is being set. 

My suggesion here is that since this object is contained within a completely transient object (the edge), it should not affect the dirty state. 

Please give this defect high priority, since this problem is hard to work around and its affecting my progress. 
Comment 2 Steven R. Shaw CLA 2005-11-22 19:23:35 EST
We considered a fix for this before but it required notation meta-model change.  The fix was to add a non-persisted source and target edge features on a node.
Comment 3 Min Idzelis CLA 2005-11-30 18:45:35 EST
I'm requesting that priority be given to this defect. I found another serious flaw that is exposed by this problem. 

When creating a connection from a transient node to a non transient node, the create edge command sets the node's sourceEdges feature to the new edge. This feature is non-transient, so it causes the EMF model to serialize the transient node (and all of its transient parents) the next time it is saved. 

During re-load, these transient children (managed by canonical edit policies) are removed and cause the diagram to turn dirty. 

Comment 4 Min Idzelis CLA 2006-01-04 13:55:43 EST
Could I have a status update? This is a major item for me since it causes the diagram to show dirty on open. 
Comment 5 Steven R. Shaw CLA 2006-01-20 12:05:47 EST
adding api keyword since this change requires notation meta-model changes...
Comment 6 Mohammed Mostafa CLA 2006-02-01 14:13:31 EST
- Changed the Notation meta model and the Canonical connection edit policy to support the creation of Transient edges across Persisted views. The change will affect the file format, it is forward compatible  
Comment 7 Richard Gronback CLA 2008-08-13 13:06:53 EDT
[target cleanup] 1.0 M5 was the original target milestone for this bug
Comment 8 Eclipse Webmaster CLA 2010-07-19 12:30:27 EDT
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug