修正 pr332 出现的问题

This commit is contained in:
everywhere.z
2025-07-15 11:39:24 +08:00
parent d3b8daef58
commit 2dd7d54418
3 changed files with 9 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ package com.yomahub.liteflow.builder.el;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.*;
import cn.hutool.crypto.digest.MD5;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ql.util.express.DefaultContext;
@@ -26,6 +27,7 @@ import com.yomahub.liteflow.log.LFLog;
import com.yomahub.liteflow.log.LFLoggerManager;
import com.yomahub.liteflow.property.LiteflowConfig;
import com.yomahub.liteflow.property.LiteflowConfigGetter;
import com.yomahub.liteflow.util.ElRegexUtil;
import java.util.*;
@@ -182,6 +184,10 @@ public class LiteFlowChainELBuilder {
}
this.chain.setEl(elStr);
String elMd5 = MD5.create().digestHex(ElRegexUtil.normalize(elStr));
this.chain.setElMd5(elMd5);
LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
// 如果设置了不检查Node是否存在那么这里是不解析的
if (liteflowConfig.getParseMode().equals(ParseModeEnum.PARSE_ONE_ON_FIRST_EXEC)){

View File

@@ -108,7 +108,9 @@ public class FlowBus {
chainMap.put(chain.getChainId(), chain);
elMd5Map.put(chain.getElMd5(), chain.getChainId());
if (StrUtil.isNotBlank(chain.getEl())){
elMd5Map.put(chain.getElMd5(), chain.getChainId());
}
//如果有生命周期则执行相应生命周期实现
if (CollUtil.isNotEmpty(LifeCycleHolder.getPostProcessChainBuildLifeCycleList())){

View File

@@ -254,10 +254,6 @@ public class Chain implements Executable {
}
public String getElMd5() {
// 若为 null 时,先规范化 EL再计算 MD5
if (elMd5 == null) {
elMd5 = MD5.create().digestHex(ElRegexUtil.normalize(el));
}
return elMd5;
}