Community
Participate
Working Groups
CanonicalConnectionEditPolicy is intended to be installed to an EditPart which represents link source and create/remove link from there. Due to the current contract, CanonicalConnectionEditPolicy invoke refresh semantic children first and then invoke update for all the outgoing connection. It is not possible to correctly update all the outgoing connection including links to the inner elements in this situation. Example. User model instance was created on diagram: Node1 Node2 Then user close the diagram, changes the model to the following state: Node1 SubNode1 LinkToSubNode2 Node2 SubNode2 On next diagram opening, update process will be executed by activating all the CanonicalConnectionEditPolicyes. In this situation if CanonicalConnectionEditPolicy installed on Node1 will be activated first, then SubNode1 will be created on diagram and CanonicalConnectionEditPolicy will try to create LinkToSubNode2. The problem is: SubNode2 was not created on diagram yet, so it will not be possible to create this link (destination notation model element absent on diagram). CanonicalConnectionEditPolicy contract should be modified to handle such situations. Ideas how to make this working: - Split updating process on two steps. For example - create two types of requests “CanonicalNodesUpdateRequest”, “CanonicalConnectionsUpdateRequest” and ask first to respond for NodesUpdate and then corresponding command will be finished – process ConnectionsUpdate - Perform Semantic update twice. - Move update logic from the CanonicalConnectionEditPolicy installed for each EditPart to some central place with an updating code for the entire diagram. This place should listed for the notifications from the domain model as well - Allow creation of incoming connections from CanonicalConnectionEditPolicy
E-mail thread with Steven: Alex Shatalin: Links should be updated by an edit policy installed to link source edit part. As we discussed, CanonicalConnectionEditPolicy is intended to be installed to an EditPart which represents link source and create/remove link from there. In current state, I'm generating only one instance of CanonicalConnectionEditPolicy which will be installed to DiagramEditPart and will update all the links at once. The problem why I've implemented it in this way is: AFAIU "intended" solution does not work if an EditPart corresponding to the link destination was not created yet. This is possible because there is no guarantee that all the CanonicalEditPolicies will finish refreshing its semantic children before starting refresh process for links. I suggest splitting refreshing process on two parts: refresh diagram nodes contents first and then refresh all the links. In this case all the link target nodes/editparts will be created on first step and it'll be much easy to create links in this situation. Steven Shaw: Mohammed is exploring this issue currently. He is introducing an "isActivating" api on the diagram will perhaps allow us to identify if additional refresh are necessary. In the CanonicalConnectionEditPolicy itself, it is already separating this refresh to do the semantic children first and then the semantic connections. @see CanonicalConnectionEditPolicy#refreshSemantic.
Can we found a solution for this problem till 2.0 M1?
Updated target milestone.
reassign to inbox
Moving to the next release, GMF 2.1.
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug