@@ -148,15 +148,8 @@ qx.Class.define("osparc.data.model.Workbench", {
148148 return node ;
149149 } ,
150150
151-
152- __deserializeEdges : function ( workbenchData ) {
153- for ( const nodeId in workbenchData ) {
154- const node = this . getNode ( nodeId ) ;
155- if ( node === null ) {
156- continue ;
157- }
158- const nodeData = workbenchData [ nodeId ] ;
159- const inputNodeIds = nodeData . inputNodes || [ ] ;
151+ __deserializeEdge : function ( node , inputNodes = [ ] ) {
152+ const inputNodeIds = inputNodes || [ ] ;
160153 inputNodeIds . forEach ( inputNodeId => {
161154 const inputNode = this . getNode ( inputNodeId ) ;
162155 if ( inputNode === null ) {
@@ -166,6 +159,17 @@ qx.Class.define("osparc.data.model.Workbench", {
166159 this . addEdge ( edge ) ;
167160 node . addInputNode ( inputNodeId ) ;
168161 } ) ;
162+ } ,
163+
164+ __deserializeEdges : function ( workbenchData ) {
165+ for ( const nodeId in workbenchData ) {
166+ const node = this . getNode ( nodeId ) ;
167+ if ( node === null ) {
168+ continue ;
169+ }
170+ const nodeData = workbenchData [ nodeId ] ;
171+ const inputNodeIds = nodeData . inputNodes || [ ] ;
172+ this . __deserializeEdge ( node , inputNodeIds ) ;
169173 }
170174 } ,
171175
@@ -907,6 +911,7 @@ qx.Class.define("osparc.data.model.Workbench", {
907911 const node = this . __createNode ( nodeData [ "key" ] , nodeData [ "version" ] , nodeId ) ;
908912 node . fetchMetadataAndPopulate ( nodeData , nodeUiData )
909913 . then ( ( ) => {
914+ this . __deserializeEdges ( workbenchData ) ;
910915 this . fireDataEvent ( "nodeAdded" , node ) ;
911916 node . checkState ( ) ;
912917 } ) ;
0 commit comments