bug #I6ASNG 采用sql数据源形式,FlowExecutor项目初始化时,如果没有配置流程FlowBus.getChainMap()会判空则抛出异常

This commit is contained in:
everywhere.z
2023-01-20 11:25:53 +08:00
parent 2d57b5392b
commit 64f97ede93

View File

@@ -9,6 +9,7 @@
package com.yomahub.liteflow.core;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.*;
import com.yomahub.liteflow.enums.InnerChainTypeEnum;
import com.yomahub.liteflow.exception.*;
@@ -166,9 +167,11 @@ public class FlowExecutor {
}
//如果是ruleSource方式的最后判断下有没有解析出来,如果没有解析出来则报错
if (FlowBus.getChainMap().isEmpty()){
String errMsg = StrUtil.format("no valid rule config found in rule path [{}]", liteflowConfig.getRuleSource());
throw new ConfigErrorException(errMsg);
if (StrUtil.isBlank(liteflowConfig.getRuleSourceExtData()) && MapUtil.isEmpty(liteflowConfig.getRuleSourceExtDataMap())){
if (FlowBus.getChainMap().isEmpty()){
String errMsg = StrUtil.format("no valid rule config found in rule path [{}]", liteflowConfig.getRuleSource());
throw new ConfigErrorException(errMsg);
}
}
//执行钩子