Skip to content

Commit

Permalink
fix interactive edge (#3659)
Browse files Browse the repository at this point in the history
* fix interactive edge

* fix
  • Loading branch information
newfish-cmyk authored Jan 25, 2025
1 parent ab0fc51 commit 991fbe2
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions packages/global/core/workflow/runtime/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,30 @@ export const checkNodeRunStatus = ({
currentNode: node
});

// check skip(其中一组边,全 skip)
// check active(其中一组边,至少有一个 active,且没有 waiting 即可运行)
if (
commonEdges.length > 0 &&
commonEdges.some((item) => item.status === 'active') &&
commonEdges.every((item) => item.status !== 'waiting')
) {
return 'run';
}
if (
recursiveEdges.length > 0 &&
recursiveEdges.some((item) => item.status === 'active') &&
recursiveEdges.every((item) => item.status !== 'waiting')
) {
return 'run';
}

// check skip(其中一组边,全是 skiped 则跳过运行)
if (commonEdges.length > 0 && commonEdges.every((item) => item.status === 'skipped')) {
return 'skip';
}
if (recursiveEdges.length > 0 && recursiveEdges.every((item) => item.status === 'skipped')) {
return 'skip';
}

// check active(有一类边,不全是 wait 即可运行)
if (commonEdges.length > 0 && commonEdges.every((item) => item.status !== 'waiting')) {
return 'run';
}
if (recursiveEdges.length > 0 && recursiveEdges.every((item) => item.status !== 'waiting')) {
return 'run';
}

return 'wait';
};

Expand Down

0 comments on commit 991fbe2

Please sign in to comment.