Browse Source

Live modeling demo: Initialization of model should depend on current value of 'initial' edge. We force a dependency by overwriting this edge with its current value.

Joeri Exelmans 2 years ago
parent
commit
28275b2850
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/frontend/demos/demo_live.tsx

+ 2 - 0
src/frontend/demos/demo_live.tsx

@@ -347,6 +347,8 @@ export function getDemoLive() {
           model.graphState.exec(nodeCreation);
           model.graphState.exec(primitiveRegistry.newEdgeCreation(nodeCreation, "type", "RuntimeModel"));
           model.graphState.exec(primitiveRegistry.newEdgeCreation(nodeCreation, "design", runtimeStuff.modelNode!.creation));
+          // overwrite 'initial' pointer with its current value:
+          runtimeStuff.modelNode!.getDeltasForSetEdge(primitiveRegistry, "initial", runtimeStuff.initial!.creation).forEach(d => model.graphState.exec(d));
           model.graphState.exec(primitiveRegistry.newEdgeCreation(nodeCreation, "current", runtimeStuff.initial!.creation));
           return {compositeLabel: "initialize"};
         });