|
@@ -13,6 +13,7 @@ import com.yomahub.liteflow.exception.LiteFlowException;
|
|
|
import com.yomahub.liteflow.exception.ProxyException;
|
|
|
import com.yomahub.liteflow.log.LFLog;
|
|
|
import com.yomahub.liteflow.log.LFLoggerManager;
|
|
|
+import com.yomahub.liteflow.spi.holder.LiteflowComponentSupportHolder;
|
|
|
import com.yomahub.liteflow.util.LiteFlowProxyUtil;
|
|
|
import com.yomahub.liteflow.util.SerialsUtil;
|
|
|
import net.bytebuddy.ByteBuddy;
|
|
@@ -28,6 +29,7 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
+import java.util.function.Predicate;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -94,8 +96,23 @@ public class ComponentProxy {
|
|
|
boolean legal = classes.size() == 1;
|
|
|
if (!legal) {
|
|
|
throw new LiteFlowException("The cmpClass of the same nodeId must be the same,you declared nodeId:"
|
|
|
- + activeNodeId + ",cmpClass:" + classes);
|
|
|
+ + activeNodeId + ",cmpClass:" + clazz);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ String activeNodeName;
|
|
|
+ if (isMethodCreate){
|
|
|
+ // 获取process上的LiteflowMethod
|
|
|
+ LiteflowMethod mainliteflowMethod = methodList.stream().filter(liteflowMethod -> liteflowMethod.value().isMainMethod()).findFirst().orElse(null);
|
|
|
+ if (mainliteflowMethod == null){
|
|
|
+ String errMsg = StrUtil.format("you have not defined @LiteFlowMethod on the processXXX method in class {}", clazz.getName());
|
|
|
+ throw new LiteFlowException(errMsg);
|
|
|
+ }
|
|
|
+ activeNodeName = mainliteflowMethod.nodeName();
|
|
|
+ }else{
|
|
|
+ activeNodeName = LiteflowComponentSupportHolder.loadLiteflowComponentSupport().getCmpName(bean);
|
|
|
+ }
|
|
|
+
|
|
|
// 当前节点实际LiteflowRetry注解
|
|
|
AtomicReference<LiteflowRetry> liteflowRetryAtomicReference = new AtomicReference<>(null);
|
|
|
// 相同nodeId只能有一个LiteflowRetry定义方法,且必须再Process方法上
|
|
@@ -151,6 +168,8 @@ public class ComponentProxy {
|
|
|
NodeComponent nodeComponent = (NodeComponent) instance;
|
|
|
// 重设nodeId
|
|
|
nodeComponent.setNodeId(activeNodeId);
|
|
|
+ // 重设nodeName
|
|
|
+ nodeComponent.setName(activeNodeName);
|
|
|
return nodeComponent;
|
|
|
}
|
|
|
catch (Exception e) {
|