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

Bug 329684

Summary: problem when persisting a tree using PersistViewsCommand/DiagramEventBroker
Product: [Modeling] GMF-Runtime Reporter: Pierre Kubryk <Pierre.Kubryk>
Component: GeneralAssignee: Project Inbox <gmf-runtime-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Pierre Kubryk CLA 2010-11-08 11:07:34 EST
Build Identifier: 200806091744

I'm currently trying to persist a tree of nodes and edges. 
I have a tree like this one :
A (B (C->D))
I obtain it by a single drag'n drop of the root node.
If i save it and then re open it , the edge between C and D is no more available. The persisted file looks like that :

[..]
<children xmi:type="notation:Node" xmi:id="_eATo8OtGEd-pzv8plxZdWg" type="2003" element="_eARzwetGEd-pzv8plxZdWg">
      <children xmi:type="notation:Node" xmi:id="_eAU3EOtGEd-pzv8plxZdWg" type="5007"/>
      <children xmi:type="notation:Node" xmi:id="_eAU3EetGEd-pzv8plxZdWg" type="7001">
        <styles xmi:type="notation:DrawerStyle" xmi:id="_eAVeIOtGEd-pzv8plxZdWg"/>
        <styles xmi:type="notation:SortingStyle" xmi:id="_eAVeIetGEd-pzv8plxZdWg"/>
        <styles xmi:type="notation:FilteringStyle" xmi:id="_eAVeIutGEd-pzv8plxZdWg"/>
      </children>
      <styles xmi:type="notation:ShapeStyle" xmi:id="_eATo8etGEd-pzv8plxZdWg" fontName="Segoe UI"/>
      <styles xmi:type="notation:HintedDiagramLinkStyle" xmi:id="_eATo8utGEd-pzv8plxZdWg"/>
      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eATo8-tGEd-pzv8plxZdWg" x="272" y="105"/>
    </children>
[..]

In this case, the DiagramEventBroker.getViewToPersist only returns the Edge between C and D. When diagram.persistEdges() is executed in the PersistsViewCommand,only C and D are persisted since the containment features for these nodes are not transient.


If i move one of the nodes (for instance C) before saving the graph the problem will not happens. The DiagramEventBroker will find A as top view to persist. Then the persisted file will looks like that :

[..]
   <children xmi:type="notation:Node" xmi:id="_--magOs8Ed-pzv8plxZdWg" type="2003" element="_--jXMOs8Ed-pzv8plxZdWg">
      <children xmi:type="notation:Node" xmi:id="_--nooOs8Ed-pzv8plxZdWg" type="5007"/>
      <children xmi:type="notation:Node" xmi:id="_--oPsOs8Ed-pzv8plxZdWg" type="7001">
        <children xmi:type="notation:Node" xmi:id="_--tIMOs8Ed-pzv8plxZdWg" type="3003" element="_--jXMes8Ed-pzv8plxZdWg">
          <children xmi:type="notation:Node" xmi:id="_--uWUOs8Ed-pzv8plxZdWg" type="5006"/>
          <children xmi:type="notation:Node" xmi:id="_--uWUes8Ed-pzv8plxZdWg" type="7002">
            <children xmi:type="notation:Node" xmi:id="_--ynwOs8Ed-pzv8plxZdWg" type="3004" element="_--jXMus8Ed-pzv8plxZdWg">
              <children xmi:type="notation:Node" xmi:id="_--z14Os8Ed-pzv8plxZdWg" type="5005"/>
              <styles xmi:type="notation:ShapeStyle" xmi:id="_--ynwes8Ed-pzv8plxZdWg" fontName="Segoe UI"/>
              <layoutConstraint xmi:type="notation:Bounds" xmi:id="_--ynwus8Ed-pzv8plxZdWg" y="2"/>
            </children>
            <children xmi:type="notation:Node" xmi:id="_--0c8Os8Ed-pzv8plxZdWg" type="3004" element="_--jXM-s8Ed-pzv8plxZdWg">
              <children xmi:type="notation:Node" xmi:id="_--1EAOs8Ed-pzv8plxZdWg" type="5005"/>
              <styles xmi:type="notation:ShapeStyle" xmi:id="_--0c8es8Ed-pzv8plxZdWg" fontName="Segoe UI"/>
              <layoutConstraint xmi:type="notation:Bounds" xmi:id="_--0c8us8Ed-pzv8plxZdWg" y="102"/>
            </children>
            <styles xmi:type="notation:DrawerStyle" xmi:id="_--uWUus8Ed-pzv8plxZdWg"/>
            <styles xmi:type="notation:SortingStyle" xmi:id="_--uWU-s8Ed-pzv8plxZdWg"/>
            <styles xmi:type="notation:FilteringStyle" xmi:id="_--u9YOs8Ed-pzv8plxZdWg"/>
          </children>
          <styles xmi:type="notation:ShapeStyle" xmi:id="_--tIMes8Ed-pzv8plxZdWg" fontName="Segoe UI"/>
          <styles xmi:type="notation:HintedDiagramLinkStyle" xmi:id="_--tIMus8Ed-pzv8plxZdWg"/>
          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_--tIM-s8Ed-pzv8plxZdWg" y="9"/>
        </children>
        <styles xmi:type="notation:DrawerStyle" xmi:id="_--oPses8Ed-pzv8plxZdWg"/>
        <styles xmi:type="notation:SortingStyle" xmi:id="_--oPsus8Ed-pzv8plxZdWg"/>
        <styles xmi:type="notation:FilteringStyle" xmi:id="_--oPs-s8Ed-pzv8plxZdWg"/>
      </children>
      <styles xmi:type="notation:ShapeStyle" xmi:id="_--mages8Ed-pzv8plxZdWg" fontName="Segoe UI"/>
      <styles xmi:type="notation:HintedDiagramLinkStyle" xmi:id="_--magus8Ed-pzv8plxZdWg"/>
      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_--mag-s8Ed-pzv8plxZdWg" x="285" y="34"/>
    </children>
[..]

Did i miss something ?

Thanks



Reproducible: Always