siykt 1 rok pred
rodič
commit
48bb6d1b19
1 zmenil súbory, kde vykonal 23 pridanie a 0 odobranie
  1. 23 0
      src/workflowEngine/WorkflowWorker.js

+ 23 - 0
src/workflowEngine/WorkflowWorker.js

@@ -141,6 +141,29 @@ class WorkflowWorker {
     prevBlockData,
     prevBlockData,
     nextBlockBreakpointCount = null
     nextBlockBreakpointCount = null
   ) {
   ) {
+    // pre check
+    for (const connection of connections) {
+      const id = typeof connection === 'string' ? connection : connection.id;
+
+      const block = this.engine.blocks[id];
+
+      if (!block) {
+        console.error(`Block ${id} doesn't exist`);
+        this.engine.destroy('stopped');
+        return;
+      }
+
+      // pass disabled block
+      // eslint-disable-next-line no-continue
+      if (!block.data.disableBlock) continue;
+
+      // check if the next block is breakpoint
+      if (block.data?.$breakpoint) {
+        // set breakpoint state
+        nextBlockBreakpointCount = 0;
+      }
+    }
+
     connections.forEach((connection, index) => {
     connections.forEach((connection, index) => {
       const { id, targetHandle, sourceHandle } =
       const { id, targetHandle, sourceHandle } =
         typeof connection === 'string'
         typeof connection === 'string'