Преглед изворни кода

bug #IC4JGV PostProcessChainExecuteLifeCycle在有异常的情况下执行不到

everywhere.z пре 3 недеља
родитељ
комит
fb83210b83
1 измењених фајлова са 6 додато и 7 уклоњено
  1. 6 7
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/Chain.java

+ 6 - 7
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.setCurrChainId(chainId);
 				condition.execute(slotIndex);
 				condition.execute(slotIndex);
 			}
 			}
-
-			//如果有生命周期则执行相应生命周期实现
-			if (CollUtil.isNotEmpty(LifeCycleHolder.getPostProcessChainExecuteLifeCycleList())){
-				LifeCycleHolder.getPostProcessChainExecuteLifeCycleList().forEach(
-						postProcessChainExecuteLifeCycle -> postProcessChainExecuteLifeCycle.postProcessAfterChainExecute(chainId, slot)
-				);
-			}
 		}
 		}
 		catch (ChainEndException e) {
 		catch (ChainEndException e) {
 			// 这里单独catch ChainEndException是因为ChainEndException是用户自己setIsEnd抛出的异常
 			// 这里单独catch ChainEndException是因为ChainEndException是用户自己setIsEnd抛出的异常
@@ -150,6 +143,12 @@ public class Chain implements Executable{
 			}
 			}
 			throw e;
 			throw e;
 		}finally {
 		}finally {
+			//如果有生命周期则执行相应生命周期实现
+			if (CollUtil.isNotEmpty(LifeCycleHolder.getPostProcessChainExecuteLifeCycleList())){
+				LifeCycleHolder.getPostProcessChainExecuteLifeCycleList().forEach(
+						postProcessChainExecuteLifeCycle -> postProcessChainExecuteLifeCycle.postProcessAfterChainExecute(chainId, slot)
+				);
+			}
 			runtimeIdTL.remove();
 			runtimeIdTL.remove();
 		}
 		}
 	}
 	}