From 9bf3be222a3e973769166e864473d2e25821307d Mon Sep 17 00:00:00 2001 From: Junyi Date: Sat, 2 Dec 2023 13:32:43 +0800 Subject: [PATCH] fix(plugin-workflow): fix condition branch node finding logic (fix #3082) (#3128) --- .../plugin-workflow/src/server/instructions/condition.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/plugins/@nocobase/plugin-workflow/src/server/instructions/condition.ts b/packages/plugins/@nocobase/plugin-workflow/src/server/instructions/condition.ts index dba5482c4..a0fcd33c3 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/server/instructions/condition.ts +++ b/packages/plugins/@nocobase/plugin-workflow/src/server/instructions/condition.ts @@ -149,7 +149,9 @@ export default { upstreamId: (prevJob && prevJob.id) || null, }; - const branchNode = processor.nodes.find((item) => item.upstream === node && Boolean(item.branchIndex) === result); + const branchNode = processor.nodes.find( + (item) => item.upstreamId === node.id && item.branchIndex != null && Boolean(item.branchIndex) === result, + ); if (!branchNode) { return job;