From a676cfd9ba9fe0146a03f338d44f2ec9f8a85656 Mon Sep 17 00:00:00 2001 From: bryan31 Date: Sat, 26 Feb 2022 23:26:11 +0800 Subject: [PATCH] =?UTF-8?q?bug=20#I4VEV2=20=E7=94=A8spring=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E7=BB=84=E4=BB=B6=EF=BC=8C=E4=BD=86=E6=98=AF=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E7=94=A8=E5=8A=A8=E6=80=81=E4=BB=A3=E7=A0=81=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=EF=BC=8C=E4=BC=9A=E5=87=BA=E7=8E=B0slot=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=88=86=E9=85=8D=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../liteflow/builder/LiteFlowConditionBuilder.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowConditionBuilder.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowConditionBuilder.java index 2782a95e3..97228e77e 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowConditionBuilder.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowConditionBuilder.java @@ -87,15 +87,17 @@ public class LiteFlowConditionBuilder { Chain chain = FlowBus.getChain(item.getId()); this.condition.getNodeList().add(chain); } else { - //元数据没有的话,从spring上下文再取一遍,这部分是为了防止标有@Lazy懒加载的组件 + //元数据没有的话,从spring上下文再取一遍 + //这部分有2个目的 + //一是为了防止标有@Lazy懒加载的组件,二是spring负责扫描,而用代码的形式加载chain这种情况。 NodeComponent nodeComponent = ContextAwareHolder.loadContextAware().getBean(item.getId()); if (ObjectUtil.isNotNull(nodeComponent)){ FlowBus.addSpringScanNode(item.getId(), nodeComponent); - return setValue(value); + setValue(item.getId()); + } else{ + String errorMsg = StrUtil.format("executable node[{}] is not found!", regexEntity.getItem().getId()); + throw new ExecutableItemNotFoundException(errorMsg); } - - String errorMsg = StrUtil.format("executable node[{}] is not found!", regexEntity.getItem().getId()); - throw new ExecutableItemNotFoundException(errorMsg); } } return this;