From fb83210b83a1b7b6d328793456dfd97237a238f2 Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Mon, 28 Apr 2025 11:52:12 +0800 Subject: [PATCH] =?UTF-8?q?bug=20#IC4JGV=20PostProcessChainExecuteLifeCycl?= =?UTF-8?q?e=E5=9C=A8=E6=9C=89=E5=BC=82=E5=B8=B8=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E6=89=A7=E8=A1=8C=E4=B8=8D=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yomahub/liteflow/flow/element/Chain.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/Chain.java b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/Chain.java index 82472fac7..af7f2d5df 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/Chain.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/Chain.java @@ -127,13 +127,6 @@ public class Chain implements Executable{ condition.setCurrChainId(chainId); condition.execute(slotIndex); } - - //如果有生命周期则执行相应生命周期实现 - if (CollUtil.isNotEmpty(LifeCycleHolder.getPostProcessChainExecuteLifeCycleList())){ - LifeCycleHolder.getPostProcessChainExecuteLifeCycleList().forEach( - postProcessChainExecuteLifeCycle -> postProcessChainExecuteLifeCycle.postProcessAfterChainExecute(chainId, slot) - ); - } } catch (ChainEndException e) { // 这里单独catch ChainEndException是因为ChainEndException是用户自己setIsEnd抛出的异常 @@ -150,6 +143,12 @@ public class Chain implements Executable{ } throw e; }finally { + //如果有生命周期则执行相应生命周期实现 + if (CollUtil.isNotEmpty(LifeCycleHolder.getPostProcessChainExecuteLifeCycleList())){ + LifeCycleHolder.getPostProcessChainExecuteLifeCycleList().forEach( + postProcessChainExecuteLifeCycle -> postProcessChainExecuteLifeCycle.postProcessAfterChainExecute(chainId, slot) + ); + } runtimeIdTL.remove(); } }