From a01aa3fc6395ffe0865d40a4d925909f917aed14 Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Tue, 2 Apr 2024 14:15:20 +0800 Subject: [PATCH] =?UTF-8?q?feature=20#I96A33=20=E4=B8=BALF=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=86=B3=E7=AD=96=E8=A1=A8=E7=89=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yomahub/liteflow/core/FlowExecutor.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java b/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java index 58048e0e3..02c6a085e 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java @@ -532,11 +532,18 @@ public class FlowExecutor { throw new RouteChainNotFoundException("cannot find any route chain"); } + String finalRequestId; + if (StrUtil.isBlank(requestId)){ + finalRequestId = IdGeneratorHolder.getInstance().generate(); + }else{ + finalRequestId = requestId; + } + // 异步执行route el List routeTupleList = new ArrayList<>(); for (Chain routeChain : routeChainList){ CompletableFuture f = CompletableFuture.supplyAsync( - () -> doExecute(routeChain.getChainId(), param, null, contextBeanClazzArray, contextBeanArray, null, InnerChainTypeEnum.NONE, ChainExecuteModeEnum.ROUTE) + () -> doExecute(routeChain.getChainId(), param, finalRequestId, contextBeanClazzArray, contextBeanArray, null, InnerChainTypeEnum.NONE, ChainExecuteModeEnum.ROUTE) ); routeTupleList.add(new Tuple(routeChain, f)); @@ -572,7 +579,7 @@ public class FlowExecutor { List> executeChainCfList = new ArrayList<>(); for (Chain chain : matchedRouteChainList){ CompletableFuture cf = CompletableFuture.supplyAsync( - () -> doExecute(chain.getChainId(), param, requestId, contextBeanClazzArray, contextBeanArray, null, InnerChainTypeEnum.NONE, ChainExecuteModeEnum.BODY) + () -> doExecute(chain.getChainId(), param, finalRequestId, contextBeanClazzArray, contextBeanArray, null, InnerChainTypeEnum.NONE, ChainExecuteModeEnum.BODY) ); executeChainCfList.add(cf); }