Kaynağa Gözat

Merge remote-tracking branch 'origin/dev' into issues/IAUS2R-v2

# Conflicts:
#	pom.xml
tkc 6 ay önce
ebeveyn
işleme
d692f6f1f0
100 değiştirilmiş dosya ile 2487 ekleme ve 994 silme
  1. 5 0
      liteflow-core/pom.xml
  2. 89 8
      liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java
  3. 24 7
      liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ThreadPoolOperator.java
  4. 1 4
      liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/WhenOperator.java
  5. 6 0
      liteflow-core/src/main/java/com/yomahub/liteflow/common/ChainConstant.java
  6. 11 2
      liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java
  7. 4 0
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/LiteflowResponse.java
  8. 14 4
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/Chain.java
  9. 77 34
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/Node.java
  10. 3 1
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/ForCondition.java
  11. 9 1
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/IteratorCondition.java
  12. 11 9
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/LoopCondition.java
  13. 3 1
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/WhileCondition.java
  14. 23 1
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/entity/CmpStep.java
  15. 5 25
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/strategy/ParallelStrategyExecutor.java
  16. 5 1
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/strategy/SpecifyParallelExecutor.java
  17. 18 19
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/helper/ParserHelper.java
  18. 62 90
      liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfig.java
  19. 2 1
      liteflow-core/src/main/java/com/yomahub/liteflow/slot/DataBus.java
  20. 17 0
      liteflow-core/src/main/java/com/yomahub/liteflow/slot/Slot.java
  21. 1 1
      liteflow-core/src/main/java/com/yomahub/liteflow/spi/local/LocalContextAware.java
  22. 48 0
      liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorCondition/ExecutorCondition.java
  23. 64 0
      liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorCondition/ExecutorConditionBuilder.java
  24. 60 18
      liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorHelper.java
  25. 6 6
      liteflow-core/src/main/java/com/yomahub/liteflow/thread/LiteFlowDefaultGlobalExecutorBuilder.java
  26. 0 17
      liteflow-core/src/main/java/com/yomahub/liteflow/util/ElRegexUtil.java
  27. 1 0
      liteflow-core/src/main/resources/dtd/liteflow.dtd
  28. 108 4
      liteflow-el-builder/src/main/java/com/yomahub/liteflow/builder/el/CommonNodeELWrapper.java
  29. 28 37
      liteflow-el-builder/src/main/java/com/yomahub/liteflow/builder/el/ELBus.java
  30. 4 4
      liteflow-el-builder/src/main/java/com/yomahub/liteflow/builder/el/IfELWrapper.java
  31. 5 109
      liteflow-el-builder/src/main/java/com/yomahub/liteflow/builder/el/NodeELWrapper.java
  32. 15 0
      liteflow-rule-plugin/liteflow-rule-redis/pom.xml
  33. 6 6
      liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowAutoConfiguration.java
  34. 74 0
      liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowProperty.java
  35. 4 3
      liteflow-solon-plugin/src/main/resources/META-INF/liteflow-default.properties
  36. 59 65
      liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java
  37. 5 6
      liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/config/LiteflowPropertyAutoConfiguration.java
  38. 14 28
      liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  39. 4 6
      liteflow-spring-boot-starter/src/main/resources/META-INF/liteflow-default.properties
  40. 3 1
      liteflow-testcase-el/.gitignore
  41. 20 20
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/CatchELBuilderTest.java
  42. 13 15
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/ComplexELBuilderTest.java
  43. 72 72
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/IfELBuilderTest.java
  44. 35 35
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/LogicELBuilderTest.java
  45. 74 74
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/LoopELBuilderTest.java
  46. 2 14
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/MaxWaitSecondBuilderTest.java
  47. 7 8
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/NodeELBuilderTest.java
  48. 37 38
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/ParELBuilderTest.java
  49. 7 16
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/RetryBuilderTest.java
  50. 41 40
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/SerELBuilderTest.java
  51. 24 24
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/SwitchELBuilderTest.java
  52. 43 43
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/ThenELBuilderTest.java
  53. 37 38
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/WhenELBuilderTest.java
  54. 3 2
      liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/customTreadExecutor/CustomThreadExecutor1.java
  55. 72 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/ChainThreadPoolELSpringbootTest.java
  56. 73 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/ConditionThreadPoolELSpringbootTest.java
  57. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomChainThreadExecutor.java
  58. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomGlobalThreadExecutor.java
  59. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomLoopThreadExecutor.java
  60. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomWhenThreadExecutor.java
  61. 71 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/GlobalThreadPoolELSpringbootTest.java
  62. 81 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/cmp/CmpConfig.java
  63. 2 2
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java
  64. 2 2
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java
  65. 2 2
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java
  66. 1 1
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolELDeclMultiSpringbootTest.java
  67. 2 2
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/parallelLoop/CustomThreadExecutor.java
  68. 1 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/chainThreadPool/application.properties
  69. 2 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/chainThreadPool/application2.properties
  70. 4 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/chainThreadPool/application3.properties
  71. 22 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/chainThreadPool/flow.el.xml
  72. 22 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/chainThreadPool/flow2.el.xml
  73. 19 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/chainThreadPool/flow3.el.xml
  74. 3 5
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/comments/flow.el.xml
  75. 3 3
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/parallelLoop/application.properties
  76. 79 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/ChainThreadPoolELSpringbootTest.java
  77. 79 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/ConditionThreadPoolELSpringbootTest.java
  78. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomChainThreadExecutor.java
  79. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomGlobalThreadExecutor.java
  80. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomLoopThreadExecutor.java
  81. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomWhenThreadExecutor.java
  82. 79 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/GlobalThreadPoolELSpringbootTest.java
  83. 81 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/cmp/CmpConfig.java
  84. 2 2
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java
  85. 2 2
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java
  86. 2 2
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java
  87. 2 3
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolELDeclMultiSpringbootTest.java
  88. 2 2
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/parallelLoop/CustomThreadExecutor.java
  89. 1 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/chainThreadPool/application.properties
  90. 2 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/chainThreadPool/application2.properties
  91. 4 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/chainThreadPool/application3.properties
  92. 22 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/chainThreadPool/flow.el.xml
  93. 22 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/chainThreadPool/flow2.el.xml
  94. 19 0
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/chainThreadPool/flow3.el.xml
  95. 3 5
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/comments/flow.el.xml
  96. 3 3
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/parallelLoop/application.properties
  97. 79 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/ChainThreadPoolELSpringbootTest.java
  98. 79 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/ConditionThreadPoolELSpringbootTest.java
  99. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomChainThreadExecutor.java
  100. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomGlobalThreadExecutor.java

+ 5 - 0
liteflow-core/pom.xml

@@ -18,6 +18,11 @@
 			<groupId>cn.hutool</groupId>
 			<artifactId>hutool-core</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>cn.hutool</groupId>
+			<artifactId>hutool-crypto</artifactId>
+			<version>${hutool.version}</version>
+		</dependency>
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-api</artifactId>

+ 89 - 8
liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java

@@ -1,8 +1,11 @@
 package com.yomahub.liteflow.builder.el;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.*;
+import cn.hutool.crypto.digest.MD5;
 import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.ql.util.express.DefaultContext;
 import com.ql.util.express.ExpressRunner;
@@ -24,18 +27,24 @@ 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.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-import java.util.function.Consumer;
+import java.io.File;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static com.yomahub.liteflow.common.ChainConstant.NODE_INSTANCE_PATH;
+import static com.yomahub.liteflow.common.ChainConstant.USER_DIR;
+import static com.yomahub.liteflow.util.JsonUtil.parseObject;
+import static com.yomahub.liteflow.util.JsonUtil.toJsonString;
+import static com.yomahub.liteflow.util.SerialsUtil.generateShortUUID;
+
 
 /**
  * Chain基于代码形式的组装器 EL表达式规则专属组装器
  *
  * @author Bryan.Zhang
+ * @author Jay li
+ * @author jason
  * @since 2.8.0
  */
 public class LiteFlowChainELBuilder {
@@ -215,6 +224,10 @@ public class LiteFlowChainELBuilder {
 				throw new QLException(StrUtil.format("parse el fail,el:[{}]", elStr));
 			}
 
+			if (liteflowConfig.getEnableNodeInstanceId()) {
+				setNodesInstanceId(condition);
+			}
+
 			// 把主要的condition加入
 			this.conditionList.add(condition);
 			return this;
@@ -235,6 +248,71 @@ public class LiteFlowChainELBuilder {
 		}
 	}
 
+    private void setNodesInstanceId(Condition condition) {
+        File nodeDir = new File(System.getProperty(USER_DIR)+  File.separator + NODE_INSTANCE_PATH + File.separator + this.chain.getChainId());
+        String elMd5 = MD5.create().digestHex(chain.getEl());
+
+        // 如果文件不存在,或者文件内容不是当前el,则写入
+        if (FileUtil.isEmpty(nodeDir) || !FileUtil.readLines(nodeDir.getPath(), CharsetUtil.UTF_8).get(0).equals(elMd5)) {
+            writeNodeInstanceId(nodeDir, condition, elMd5);
+        } else {
+            // 文件存在,则直接读取
+            List<String> nodeList = FileUtil.readLines(nodeDir.getPath(), CharsetUtil.UTF_8);
+
+            Map<String, List<String>> executableMap = new HashMap<>();
+            for (int i = 1; i < nodeList.size(); i++) {
+                JsonNode groupKeyAndInstanceIds = parseObject(nodeList.get(i));
+
+				Iterator<String> fieldNames = groupKeyAndInstanceIds.fieldNames();
+				while (fieldNames.hasNext()) {
+					String key = fieldNames.next();
+					JsonNode valueNode = groupKeyAndInstanceIds.get(key);
+					if (valueNode.isArray()) {
+						List<String> valueList = new ArrayList<>();
+						for (JsonNode item : valueNode) {
+							valueList.add(item.asText());
+						}
+						executableMap.put(key, valueList);
+					}
+	            }
+			}
+
+            condition.getExecutableGroup().forEach((key, executables) -> {
+                AtomicInteger index = new AtomicInteger(0);
+                executables.forEach(executable -> {
+                    if (executableMap.containsKey(key)) {
+                        if (executable instanceof Node) {
+                            ((Node) executable).setInstanceId((executableMap.get(key).get(index.getAndIncrement())));
+                        }
+                    }
+                });
+            });
+        }
+    }
+
+    // 写入时第一行为el的md5,第二行为json格式的groupKey和对应的实例id
+    private void writeNodeInstanceId(File nodeDir, Condition condition, String elMd5) {
+        ArrayList<String> writeList = new ArrayList<>();
+        writeList.add(elMd5);
+
+        condition.getExecutableGroup().forEach((key, executables) -> {
+            Map<String, List<String>> groupKeyAndInstanceIds = new HashMap<>();
+            List<String> instanceIds = new ArrayList<>();
+
+            executables.forEach(executable -> {
+                if (executable instanceof Node) {
+                    ((Node) executable).setInstanceId(generateShortUUID());
+                    instanceIds.add(((Node) executable).getInstanceId());
+                }
+            });
+
+			groupKeyAndInstanceIds.put(key, instanceIds);
+			writeList.add(toJsonString(groupKeyAndInstanceIds));
+		});
+
+        FileUtil.writeLines(writeList, nodeDir.getPath(), CharsetUtil.UTF_8);
+    }
+
 	public LiteFlowChainELBuilder setNamespace(String nameSpace){
 		if (StrUtil.isBlank(nameSpace)) {
 			nameSpace = ChainConstant.DEFAULT_NAMESPACE;
@@ -243,6 +321,11 @@ public class LiteFlowChainELBuilder {
 		return this;
 	}
 
+	public LiteFlowChainELBuilder setThreadPoolExecutorClass(String threadPoolExecutorClass) {
+		this.chain.setThreadPoolExecutorClass(threadPoolExecutorClass);
+		return this;
+	}
+
     /**
      * EL表达式校验,此方法已经过时,请使用 {@link LiteFlowChainELBuilder#validateWithEx(String)}
      *
@@ -263,8 +346,6 @@ public class LiteFlowChainELBuilder {
     public static ValidationResp validateWithEx(String elStr) {
         ValidationResp resp = new ValidationResp();
         try {
-            // 移除注释
-            elStr = ElRegexUtil.removeComments(elStr);
             LiteFlowChainELBuilder.createChain().setEL(elStr);
             resp.setSuccess(true);
         } catch (Exception e) {

+ 24 - 7
liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ThreadPoolOperator.java

@@ -1,27 +1,44 @@
 package com.yomahub.liteflow.builder.el.operator;
 
+import com.ql.util.express.exception.QLException;
 import com.yomahub.liteflow.builder.el.operator.base.BaseOperator;
 import com.yomahub.liteflow.builder.el.operator.base.OperatorHelper;
+import com.yomahub.liteflow.flow.element.Condition;
+import com.yomahub.liteflow.flow.element.condition.LoopCondition;
 import com.yomahub.liteflow.flow.element.condition.WhenCondition;
 
 /**
- * EL规则中的threadPool的操作符
+ * EL规则中的threadPool的操作符 有四种用法  WHEN().threadPool() FOR...DO().threadPool() WHILE...DO.threadPool() ITERATOR...DO
+ * .threadPool()
  *
  * @author Bryan.Zhang
+ * @author jason
  * @since 2.8.0
  */
-public class ThreadPoolOperator extends BaseOperator<WhenCondition> {
+public class ThreadPoolOperator extends BaseOperator<Condition> {
 
 	@Override
-	public WhenCondition build(Object[] objects) throws Exception {
+	public Condition build(Object[] objects) throws Exception {
 		OperatorHelper.checkObjectSizeEqTwo(objects);
 
-		String errorMsg = "The caller must be WhenCondition item";
-		WhenCondition whenCondition = OperatorHelper.convert(objects[0], WhenCondition.class, errorMsg);
+		if (objects[0] instanceof WhenCondition) {
+			String errorMsg = "The caller must be WhenCondition item";
 
-		whenCondition.setThreadExecutorClass(OperatorHelper.convert(objects[1], String.class));
+			WhenCondition condition = OperatorHelper.convert(objects[0], WhenCondition.class, errorMsg);
 
-		return whenCondition;
+			condition.setThreadExecutorClass(OperatorHelper.convert(objects[1], String.class));
+			return condition;
+		} else if (objects[0] instanceof LoopCondition) {
+			String errorMsg = "The caller must be LoopCondition item";
+
+			LoopCondition condition = OperatorHelper.convert(objects[0], LoopCondition.class, errorMsg);
+
+			condition.setThreadPoolExecutorClass(OperatorHelper.convert(objects[1], String.class));
+			return condition;
+		} else {
+            String errorMsg = "The caller must be WhenCondition or LoopCondition item";
+			throw new QLException(errorMsg);
+		}
 	}
 
 }

+ 1 - 4
liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/WhenOperator.java

@@ -4,13 +4,12 @@ import com.yomahub.liteflow.builder.el.operator.base.BaseOperator;
 import com.yomahub.liteflow.builder.el.operator.base.OperatorHelper;
 import com.yomahub.liteflow.flow.element.Executable;
 import com.yomahub.liteflow.flow.element.condition.WhenCondition;
-import com.yomahub.liteflow.property.LiteflowConfig;
-import com.yomahub.liteflow.property.LiteflowConfigGetter;
 
 /**
  * EL规则中的WHEN的操作符
  *
  * @author Bryan.Zhang
+ * @author jason
  * @since 2.8.0
  */
 public class WhenOperator extends BaseOperator<WhenCondition> {
@@ -21,11 +20,9 @@ public class WhenOperator extends BaseOperator<WhenCondition> {
 
 		WhenCondition whenCondition = new WhenCondition();
 
-		LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
 		for (Object obj : objects) {
 			OperatorHelper.checkObjMustBeCommonTypeItem(obj);
 			whenCondition.addExecutable(OperatorHelper.convert(obj, Executable.class));
-			whenCondition.setThreadExecutorClass(liteflowConfig.getThreadExecutorClass());
 		}
 		return whenCondition;
 	}

+ 6 - 0
liteflow-core/src/main/java/com/yomahub/liteflow/common/ChainConstant.java

@@ -4,6 +4,7 @@ package com.yomahub.liteflow.common;
  * Chain 常量
  *
  * @author tangkc
+ * @author jason
  */
 public interface ChainConstant {
 	String PARALLEL = "parallel";
@@ -34,6 +35,8 @@ public interface ChainConstant {
 
 	String NAMESPACE = "namespace";
 
+    String THREAD_POOL_EXECUTOR_CLASS = "thread-pool-executor-class";
+
 	String DEFAULT_NAMESPACE = "default";
 
 	String VALUE = "value";
@@ -106,4 +109,7 @@ public interface ChainConstant {
 
 	String RETRY = "retry";
 
+	String NODE_INSTANCE_PATH = ".node_instance_id";
+
+	String USER_DIR = "user.dir";
 }

+ 11 - 2
liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java

@@ -37,6 +37,7 @@ import java.util.Stack;
  *
  * @author Bryan.Zhang
  * @author luo yi
+ * @author Jay li
  */
 public abstract class NodeComponent{
 
@@ -48,6 +49,8 @@ public abstract class NodeComponent{
 
 	private String name;
 
+	private String instanceId;
+
 	private NodeTypeEnum type;
 
 	// 这是自己的实例,取代this
@@ -85,7 +88,7 @@ public abstract class NodeComponent{
 		Slot slot = this.getSlot();
 
 		// 在元数据里加入step信息
-		CmpStep cmpStep = new CmpStep(nodeId, name, CmpStepTypeEnum.SINGLE);
+		CmpStep cmpStep = new CmpStep(nodeId, name, CmpStepTypeEnum.SINGLE, instanceId);
 		cmpStep.setTag(this.getTag());
 		cmpStep.setInstance(this);
 		cmpStep.setRefNode(this.getRefNode());
@@ -153,7 +156,7 @@ public abstract class NodeComponent{
 			return;
 		}
 
-		CmpStep cmpStep = new CmpStep(nodeId, name, CmpStepTypeEnum.SINGLE);
+		CmpStep cmpStep = new CmpStep(nodeId, name, CmpStepTypeEnum.SINGLE, instanceId);
 		cmpStep.setTag(this.getTag());
 		cmpStep.setInstance(this);
 		cmpStep.setRefNode(this.getRefNode());
@@ -320,7 +323,13 @@ public abstract class NodeComponent{
 	public void setNodeExecutorClass(Class<? extends NodeExecutor> nodeExecutorClass) {
 		this.nodeExecutorClass = nodeExecutorClass;
 	}
+	public String getInstanceId() {
+		return instanceId;
+	}
 
+	public void setInstanceId(String instanceId) {
+		this.instanceId = instanceId;
+	}
 	public String getTag() {
 		return this.getRefNode().getTag();
 	}

+ 4 - 0
liteflow-core/src/main/java/com/yomahub/liteflow/flow/LiteflowResponse.java

@@ -156,6 +156,10 @@ public class LiteflowResponse {
 		return getExecuteStepStrWithoutTime();
 	}
 
+	public String getExecuteStepStrWithInstanceId() {
+		return this.getSlot().getExecuteStepStrWithInstanceId();
+	}
+
 	public String getExecuteStepStrWithTime() {
 		return this.getSlot().getExecuteStepStr(true);
 	}

+ 14 - 4
liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/Chain.java

@@ -12,23 +12,23 @@ import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.BooleanUtil;
 import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
 import com.yomahub.liteflow.common.ChainConstant;
+import com.yomahub.liteflow.enums.ExecuteableTypeEnum;
 import com.yomahub.liteflow.exception.ChainEndException;
+import com.yomahub.liteflow.exception.FlowSystemException;
 import com.yomahub.liteflow.lifecycle.LifeCycleHolder;
-import com.yomahub.liteflow.lifecycle.PostProcessChainExecuteLifeCycle;
 import com.yomahub.liteflow.log.LFLog;
 import com.yomahub.liteflow.log.LFLoggerManager;
 import com.yomahub.liteflow.slot.DataBus;
 import com.yomahub.liteflow.slot.Slot;
-import com.yomahub.liteflow.enums.ExecuteableTypeEnum;
-import com.yomahub.liteflow.exception.FlowSystemException;
+
 import java.util.ArrayList;
 import java.util.List;
-import java.util.function.Consumer;
 
 /**
  * chain对象,实现可执行器
  *
  * @author Bryan.Zhang
+ * @author jason
  */
 public class Chain implements Executable{
 
@@ -46,6 +46,8 @@ public class Chain implements Executable{
 
 	private String namespace = ChainConstant.DEFAULT_NAMESPACE;
 
+    private String threadPoolExecutorClass;
+
 	public Chain(String chainName) {
 		this.chainId = chainName;
 	}
@@ -223,4 +225,12 @@ public class Chain implements Executable{
 	public void setNamespace(String namespace) {
 		this.namespace = namespace;
 	}
+
+    public String getThreadPoolExecutorClass() {
+        return threadPoolExecutorClass;
+    }
+
+    public void setThreadPoolExecutorClass(String threadPoolExecutorClass) {
+        this.threadPoolExecutorClass = threadPoolExecutorClass;
+    }
 }

+ 77 - 34
liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/Node.java

@@ -27,12 +27,14 @@ import com.yomahub.liteflow.slot.Slot;
 import com.yomahub.liteflow.util.TupleOf2;
 
 import java.util.Stack;
+import java.util.concurrent.locks.ReentrantLock;
 
 /**
  * Node节点,实现可执行器 Node节点并不是单例的,每构建一次都会copy出一个新的实例
  *
  * @author Bryan.Zhang
  * @author luo yi
+ * @author Jay li
  */
 public class Node implements Executable, Cloneable, Rollbackable{
 
@@ -40,6 +42,8 @@ public class Node implements Executable, Cloneable, Rollbackable{
 
 	private String id;
 
+	private String instanceId;
+
 	private String name;
 
 	private String clazz;
@@ -95,6 +99,14 @@ public class Node implements Executable, Cloneable, Rollbackable{
 		return id;
 	}
 
+	public String getInstanceId() {
+		return instanceId;
+	}
+
+	public void setInstanceId(String instanceId) {
+		this.instanceId = instanceId;
+	}
+
 	@Override
 	public void setId(String id) {
 		this.id = id;
@@ -146,6 +158,7 @@ public class Node implements Executable, Cloneable, Rollbackable{
 			// 把线程属性赋值给组件对象
 			this.setSlotIndex(slotIndex);
 			instance.setRefNode(this);
+			instance.setInstanceId(this.instanceId);
 
 			// 判断是否可执行,所以isAccess经常作为一个组件进入的实际判断要素,用作检查slot里的参数的完备性
 			if (getAccessResult() || instance.isAccess()) {
@@ -294,22 +307,31 @@ public class Node implements Executable, Cloneable, Rollbackable{
 		this.isContinueOnErrorResult.remove();
 	}
 
+	// 这个锁用于异步循环场景
+	private ReentrantLock lock4LoopIndex = new ReentrantLock();
+
 	public void setLoopIndex(LoopCondition condition, int index) {
-		if (this.loopIndexTL.get() == null){
-			Stack<TupleOf2<Integer, Integer>> stack = new Stack<>();
-			TupleOf2<Integer, Integer> tuple = new TupleOf2<>(condition.hashCode(), index);
-			stack.push(tuple);
-			this.loopIndexTL.set(stack);
-		}else{
-			Stack<TupleOf2<Integer, Integer>> stack = this.loopIndexTL.get();
-			TupleOf2<Integer, Integer> thisConditionTuple =  stack.stream().filter(tuple -> tuple.getA().equals(condition.hashCode())).findFirst().orElse(null);
-			if (thisConditionTuple != null){
-				thisConditionTuple.setB(index);
-			}else{
+		try{
+			lock4LoopIndex.lock();
+			if (this.loopIndexTL.get() == null){
+				Stack<TupleOf2<Integer, Integer>> stack = new Stack<>();
 				TupleOf2<Integer, Integer> tuple = new TupleOf2<>(condition.hashCode(), index);
 				stack.push(tuple);
+				this.loopIndexTL.set(stack);
+			}else{
+				Stack<TupleOf2<Integer, Integer>> stack = this.loopIndexTL.get();
+				TupleOf2<Integer, Integer> thisConditionTuple =  stack.stream().filter(tuple -> tuple.getA().equals(condition.hashCode())).findFirst().orElse(null);
+				if (thisConditionTuple != null){
+					thisConditionTuple.setB(index);
+				}else{
+					TupleOf2<Integer, Integer> tuple = new TupleOf2<>(condition.hashCode(), index);
+					stack.push(tuple);
+				}
 			}
+		}finally {
+			lock4LoopIndex.unlock();
 		}
+
 	}
 
 	public Integer getLoopIndex() {
@@ -335,31 +357,44 @@ public class Node implements Executable, Cloneable, Rollbackable{
 	}
 
 	public void removeLoopIndex() {
-		Stack<TupleOf2<Integer, Integer>> stack = this.loopIndexTL.get();
-		if (stack != null){
-			if (stack.size() > 1){
-				stack.pop();
-			}else{
-				this.loopIndexTL.remove();
+		try{
+			lock4LoopIndex.lock();
+			Stack<TupleOf2<Integer, Integer>> stack = this.loopIndexTL.get();
+			if (stack != null){
+				if (stack.size() > 1){
+					stack.pop();
+				}else{
+					this.loopIndexTL.remove();
+				}
 			}
+		}finally {
+			lock4LoopIndex.unlock();
 		}
 	}
 
+	// 这个锁用于异步循环场景
+	private ReentrantLock lock4LoopObj = new ReentrantLock();
+
 	public void setCurrLoopObject(LoopCondition condition, Object obj) {
-		if (this.loopObjectTL.get() == null){
-			Stack<TupleOf2<Integer, Object>> stack = new Stack<>();
-			TupleOf2<Integer, Object> tuple = new TupleOf2<>(condition.hashCode(), obj);
-			stack.push(tuple);
-			this.loopObjectTL.set(stack);
-		}else{
-			Stack<TupleOf2<Integer, Object>> stack = this.loopObjectTL.get();
-			TupleOf2<Integer, Object> thisConditionTuple =  stack.stream().filter(tuple -> tuple.getA().equals(condition.hashCode())).findFirst().orElse(null);
-			if (thisConditionTuple != null){
-				thisConditionTuple.setB(obj);
-			}else{
+		try{
+			lock4LoopObj.lock();
+			if (this.loopObjectTL.get() == null){
+				Stack<TupleOf2<Integer, Object>> stack = new Stack<>();
 				TupleOf2<Integer, Object> tuple = new TupleOf2<>(condition.hashCode(), obj);
 				stack.push(tuple);
+				this.loopObjectTL.set(stack);
+			}else{
+				Stack<TupleOf2<Integer, Object>> stack = this.loopObjectTL.get();
+				TupleOf2<Integer, Object> thisConditionTuple =  stack.stream().filter(tuple -> tuple.getA().equals(condition.hashCode())).findFirst().orElse(null);
+				if (thisConditionTuple != null){
+					thisConditionTuple.setB(obj);
+				}else{
+					TupleOf2<Integer, Object> tuple = new TupleOf2<>(condition.hashCode(), obj);
+					stack.push(tuple);
+				}
 			}
+		}finally {
+			lock4LoopObj.unlock();
 		}
 	}
 
@@ -386,14 +421,20 @@ public class Node implements Executable, Cloneable, Rollbackable{
 	}
 
 	public void removeCurrLoopObject() {
-		Stack<TupleOf2<Integer, Object>> stack = this.loopObjectTL.get();
-		if (stack != null){
-			if (stack.size() > 1){
-				stack.pop();
-			}else{
-				this.loopObjectTL.remove();
+		try{
+			lock4LoopObj.lock();
+			Stack<TupleOf2<Integer, Object>> stack = this.loopObjectTL.get();
+			if (stack != null){
+				if (stack.size() > 1){
+					stack.pop();
+				}else{
+					this.loopObjectTL.remove();
+				}
 			}
+		}finally {
+			lock4LoopObj.unlock();
 		}
+
 	}
 
 	public Integer getSlotIndex(){
@@ -442,6 +483,8 @@ public class Node implements Executable, Cloneable, Rollbackable{
 		node.slotIndexTL = new TransmittableThreadLocal<>();
 		node.isEndTL = new TransmittableThreadLocal<>();
 		node.isContinueOnErrorResult = new TransmittableThreadLocal<>();
+		node.lock4LoopIndex = new ReentrantLock();
+		node.lock4LoopObj = new ReentrantLock();
 		return node;
 	}
 }

+ 3 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/ForCondition.java

@@ -20,6 +20,7 @@ import java.util.concurrent.ExecutorService;
  * 循环次数Condition
  *
  * @author Bryan.Zhang
+ * @author jason
  * @since 2.9.0
  */
 public class ForCondition extends LoopCondition {
@@ -77,7 +78,8 @@ public class ForCondition extends LoopCondition {
                 //存储所有的并行执行子项的CompletableFuture
                 List<CompletableFuture<LoopFutureObj>> futureList = new ArrayList<>();
                 //获取并行循环的线程池
-                ExecutorService parallelExecutor = ExecutorHelper.loadInstance().buildLoopParallelExecutor();
+                ExecutorService parallelExecutor = ExecutorHelper.loadInstance().buildExecutorService(this, slotIndex
+                        , this.getConditionType());
                 for (int i = 0; i < forCount; i++){
                     //提交异步任务
                     CompletableFuture<LoopFutureObj> future =

+ 9 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/IteratorCondition.java

@@ -17,6 +17,13 @@ import java.util.List;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutorService;
 
+/**
+ * 迭代次数Condition
+ *
+ * @author jason
+ * @since 2.9.0
+ */
+
 public class IteratorCondition extends LoopCondition {
 
     @Override
@@ -80,7 +87,8 @@ public class IteratorCondition extends LoopCondition {
                 //存储所有的并行执行子项的CompletableFuture
                 List<CompletableFuture<LoopFutureObj>> futureList = new ArrayList<>();
                 //获取并行循环的线程池
-                ExecutorService parallelExecutor = ExecutorHelper.loadInstance().buildLoopParallelExecutor();
+                ExecutorService parallelExecutor = ExecutorHelper.loadInstance().buildExecutorService(this, slotIndex
+                        , this.getConditionType());
                 while (it.hasNext()) {
                     Object itObj = it.next();
                     //提交异步任务

+ 11 - 9
liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/LoopCondition.java

@@ -8,18 +8,20 @@ import com.yomahub.liteflow.flow.parallel.LoopFutureObj;
 
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.locks.ReentrantLock;
 import java.util.function.Supplier;
 
 /**
  * 循环Condition的抽象类 主要继承对象有ForCondition和WhileCondition
  *
  * @author Bryan.Zhang
+ * @author jason
  * @since 2.9.0
  */
 public abstract class LoopCondition extends Condition {
     //判断循环是否并行执行,默认为false
     private boolean parallel = false;
+    //loop condition层级的线程池
+    private String threadPoolExecutorClass;
 
     protected Executable getBreakItem() {
         return this.getExecutableOne(ConditionKey.BREAK_KEY);
@@ -37,6 +39,14 @@ public abstract class LoopCondition extends Condition {
         this.addExecutable(ConditionKey.DO_KEY, executable);
     }
 
+    public String getThreadPoolExecutorClass() {
+        return threadPoolExecutorClass;
+    }
+
+    public void setThreadPoolExecutorClass(String threadPoolExecutorClass) {
+        this.threadPoolExecutorClass = threadPoolExecutorClass;
+    }
+
     protected void setLoopIndex(Executable executableItem, int index) {
         if (executableItem instanceof Chain) {
             ((Chain) executableItem).getConditionList().forEach(condition -> setLoopIndex(condition, index));
@@ -102,11 +112,6 @@ public abstract class LoopCondition extends Condition {
         }
     }
 
-    // 这个锁用于异步循环场景
-    // 当异步循环时,其实等同于所有的循环的子项在一个线程池内进行提交。
-    // 这时候如果不加锁的话,在Node对象中的迭代TL对象以及循环下标TL对象,由于要进行stream的循环,但是原stack对象会被其他线程修改掉,从而报错
-    private final ReentrantLock lock = new ReentrantLock();
-
     // 循环并行执行的Supplier封装
     public class LoopParallelSupplier implements Supplier<LoopFutureObj> {
         private final Executable executableItem;
@@ -134,7 +139,6 @@ public abstract class LoopCondition extends Condition {
 
         @Override
         public LoopFutureObj get() {
-            lock.lock();
             try {
                 executableItem.setCurrChainId(this.currChainId);
                 // 设置循环index
@@ -147,8 +151,6 @@ public abstract class LoopCondition extends Condition {
                 return LoopFutureObj.success(executableItem.getId());
             } catch (Exception e) {
                 return LoopFutureObj.fail(executableItem.getId(), e);
-            }finally {
-                lock.unlock();
             }
         }
     }

+ 3 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/WhileCondition.java

@@ -15,6 +15,7 @@ import java.util.concurrent.ExecutorService;
  * 循环条件Condition
  *
  * @author Bryan.Zhang
+ * @author jason
  * @since 2.9.0
  */
 public class WhileCondition extends LoopCondition {
@@ -61,7 +62,8 @@ public class WhileCondition extends LoopCondition {
 			//并行循环逻辑
 			List<CompletableFuture<LoopFutureObj>> futureList = new ArrayList<>();
 			//获取并行循环的线程池
-			ExecutorService parallelExecutor = ExecutorHelper.loadInstance().buildLoopParallelExecutor();
+			ExecutorService parallelExecutor = ExecutorHelper.loadInstance().buildExecutorService(this, slotIndex,
+																								  this.getConditionType());
 			while (getWhileResult(slotIndex, index)){
 				CompletableFuture<LoopFutureObj> future =
 						CompletableFuture.supplyAsync(new LoopParallelSupplier(executableItem, this.getCurrChainId(), slotIndex, index), parallelExecutor);

+ 23 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/flow/entity/CmpStep.java

@@ -20,9 +20,12 @@ import java.util.Date;
  * 组件步骤对象
  *
  * @author Bryan.Zhang
+ * @author Jay li
  */
 public class CmpStep {
 
+	private String instanceId;
+
 	private String nodeId;
 
 	private String nodeName;
@@ -54,10 +57,19 @@ public class CmpStep {
 	private Node refNode;
 
 
-	public CmpStep(String nodeId, String nodeName, CmpStepTypeEnum stepType) {
+	public CmpStep(String nodeId, String nodeName, CmpStepTypeEnum stepType, String instanceId) {
 		this.nodeId = nodeId;
 		this.nodeName = nodeName;
 		this.stepType = stepType;
+		this.instanceId = instanceId;
+	}
+
+	public String getInstanceId() {
+		return instanceId;
+	}
+
+	public void setInstanceId(String instanceId) {
+		this.instanceId = instanceId;
 	}
 
 	public String getNodeId() {
@@ -147,6 +159,16 @@ public class CmpStep {
 		}
 	}
 
+	public String buildStringWithInstanceId() {
+		if (stepType.equals(CmpStepTypeEnum.SINGLE)) {
+			return StrUtil.format("{}[{}]", nodeId, instanceId);
+		}
+		else {
+			// 目前没有其他的类型
+			return null;
+		}
+	}
+
 	public String buildStringWithTime() {
 		if (stepType.equals(CmpStepTypeEnum.SINGLE)) {
 			if (StrUtil.isBlank(nodeName)) {

+ 5 - 25
liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/strategy/ParallelStrategyExecutor.java

@@ -1,6 +1,5 @@
 package com.yomahub.liteflow.flow.parallel.strategy;
 
-import cn.hutool.core.util.BooleanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.yomahub.liteflow.enums.ParallelStrategyEnum;
@@ -34,6 +33,7 @@ import java.util.stream.Stream;
  *
  * @author luo yi
  * @author Bryan.Zhang
+ * @author jason
  * @since 2.11.0
  */
 public abstract class ParallelStrategyExecutor {
@@ -117,29 +117,6 @@ public abstract class ParallelStrategyExecutor {
         });
     }
 
-    /**
-     * 获取 WHEN 所需线程池
-     * @param whenCondition
-     * @return
-     */
-    protected ExecutorService getWhenExecutorService(WhenCondition whenCondition) {
-
-        LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
-
-        // 如果设置了线程池隔离,则每个 when 都会有对应的线程池,这是为了避免多层嵌套时如果线程池数量不够时出现单个线程池死锁。用线程池隔离的方式会更加好
-        // 如果 when 没有超多层的嵌套,还是用默认的比较好。
-        // 默认设置不隔离。也就是说,默认情况是一个线程池类一个实例,如果什么都不配置,那也就是在 when 的情况下,全局一个线程池。
-        ExecutorService parallelExecutor;
-
-        if (BooleanUtil.isTrue(liteflowConfig.getWhenThreadPoolIsolate())) {
-            parallelExecutor = ExecutorHelper.loadInstance().buildWhenExecutorWithHash(whenCondition.getThreadExecutorClass(), String.valueOf(whenCondition.hashCode()));
-        } else {
-            parallelExecutor = ExecutorHelper.loadInstance().buildWhenExecutor(whenCondition.getThreadExecutorClass());
-        }
-
-        return parallelExecutor;
-
-    }
 
     /**
      * 获取所有任务 CompletableFuture 集合
@@ -155,7 +132,10 @@ public abstract class ParallelStrategyExecutor {
         this.setWhenConditionParams(whenCondition);
 
         // 获取 WHEN 所需线程池
-        ExecutorService parallelExecutor = getWhenExecutorService(whenCondition);
+        ExecutorService parallelExecutor = ExecutorHelper.loadInstance().buildExecutorService(whenCondition,
+                                                                                              slotIndex,
+                                                                                              whenCondition.getConditionType());
+
 
         // 这里主要是做了封装 CompletableFuture 对象,用 lambda 表达式做了很多事情,这句代码要仔细理清
         // 根据 condition.getNodeList() 的集合进行流处理,用 map 进行把 executable 对象转换成 List<CompletableFuture<WhenFutureObj>>

+ 5 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/strategy/SpecifyParallelExecutor.java

@@ -3,6 +3,7 @@ package com.yomahub.liteflow.flow.parallel.strategy;
 import cn.hutool.core.collection.CollUtil;
 import com.yomahub.liteflow.flow.element.condition.WhenCondition;
 import com.yomahub.liteflow.flow.parallel.WhenFutureObj;
+import com.yomahub.liteflow.thread.ExecutorHelper;
 
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
@@ -13,6 +14,7 @@ import java.util.concurrent.ExecutorService;
  *
  * @author luo yi
  * @author Bryan.Zhang
+ * @author jason
  * @since 2.11.0
  */
 public class SpecifyParallelExecutor extends ParallelStrategyExecutor {
@@ -26,7 +28,9 @@ public class SpecifyParallelExecutor extends ParallelStrategyExecutor {
         this.setWhenConditionParams(whenCondition);
 
         // 获取 WHEN 所需线程池
-        ExecutorService parallelExecutor = getWhenExecutorService(whenCondition);
+        ExecutorService parallelExecutor = ExecutorHelper.loadInstance().buildExecutorService(whenCondition,
+                                                                                              slotIndex,
+                                                                                              whenCondition.getConditionType());
 
         // 指定完成的任务
         CompletableFuture<?> specifyTask;

+ 18 - 19
liteflow-core/src/main/java/com/yomahub/liteflow/parser/helper/ParserHelper.java

@@ -1,6 +1,5 @@
 package com.yomahub.liteflow.parser.helper;
 
-import cn.hutool.core.util.BooleanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.fasterxml.jackson.databind.JsonNode;
@@ -17,15 +16,8 @@ import com.yomahub.liteflow.util.ElRegexUtil;
 import org.dom4j.Document;
 import org.dom4j.Element;
 
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
+import java.util.*;
 import java.util.function.Consumer;
-import java.util.function.Function;
 
 import static com.yomahub.liteflow.common.ChainConstant.*;
 
@@ -33,6 +25,7 @@ import static com.yomahub.liteflow.common.ChainConstant.*;
  * Parser 通用 Helper
  *
  * @author tangkc
+ * @author jason
  * @author zy
  */
 public class ParserHelper {
@@ -96,10 +89,6 @@ public class ParserHelper {
                 .build();
     }
 
-    /**
-     * xml 形式的主要解析过程
-     * @param documentList documentList
-     */
     /**
      * xml 形式的主要解析过程
      * @param documentList documentList
@@ -316,7 +305,12 @@ public class ParserHelper {
 
         JsonNode routeJsonNode = chainNode.get(ROUTE);
 
-        LiteFlowChainELBuilder builder = LiteFlowChainELBuilder.createChain().setChainId(chainId).setNamespace(namespace);
+        String threadPoolExecutorClass = chainNode.get(THREAD_POOL_EXECUTOR_CLASS) == null ? null :
+                chainNode.get(THREAD_POOL_EXECUTOR_CLASS).textValue();
+
+        LiteFlowChainELBuilder builder =
+                LiteFlowChainELBuilder.createChain().setChainId(chainId).setNamespace(namespace)
+                .setThreadPoolExecutorClass(threadPoolExecutorClass);
 
         // 如果有route这个标签,说明是决策表chain
         // 决策表链路必须有route和body这两个标签
@@ -347,26 +341,31 @@ public class ParserHelper {
 
         Element routeElement = e.element(ROUTE);
 
-        LiteFlowChainELBuilder builder = LiteFlowChainELBuilder.createChain().setChainId(chainId).setNamespace(namespace);
+        String threadPoolExecutorClass = e.attributeValue(THREAD_POOL_EXECUTOR_CLASS) == null ? null :
+                e.attributeValue(THREAD_POOL_EXECUTOR_CLASS);
+
+        LiteFlowChainELBuilder builder =
+                LiteFlowChainELBuilder.createChain().setChainId(chainId).setNamespace(namespace)
+                .setThreadPoolExecutorClass(threadPoolExecutorClass);
 
         // 如果有route这个标签,说明是决策表chain
         // 决策表链路必须有route和body这两个标签
         if (routeElement != null){
-            builder.setRoute(ElRegexUtil.removeComments(routeElement.getText()));
+            builder.setRoute(routeElement.getText());
 
             Element bodyElement = e.element(BODY);
             if (bodyElement == null){
                 String errMsg = StrUtil.format("If you have defined the tag <route>, then you must define the tag <body> in chain[{}]", chainId);
                 throw new FlowSystemException(errMsg);
             }
-            builder.setEL(ElRegexUtil.removeComments(bodyElement.getText()));
+            builder.setEL(bodyElement.getText());
         }else{
             // 即使没有route这个标签,body标签单独写也是被允许的
             Element bodyElement = e.element(BODY);
             if (bodyElement != null){
-                builder.setEL(ElRegexUtil.removeComments(bodyElement.getText()));
+                builder.setEL(bodyElement.getText());
             }else{
-                builder.setEL(ElRegexUtil.removeComments(e.getText()));
+                builder.setEL(e.getText());
             }
         }
 

+ 62 - 90
liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfig.java

@@ -13,7 +13,6 @@ import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.yomahub.liteflow.enums.ParseModeEnum;
 
-import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
@@ -23,6 +22,7 @@ import java.util.concurrent.TimeUnit;
  * 所以为了要有null值出现,这里采用包装类型
  *
  * @author Bryan.Zhang
+ * @author jason
  */
 public class LiteflowConfig {
 
@@ -42,9 +42,6 @@ public class LiteflowConfig {
 	// slot的数量
 	private Integer slotSize;
 
-	// 并行线程执行器class路径
-	private String threadExecutorClass;
-
 	// 异步线程最大等待秒数
 	@Deprecated
 	private Integer whenMaxWaitSeconds;
@@ -68,10 +65,8 @@ public class LiteflowConfig {
 	// 每隔多少秒打印
 	private Long period;
 
-	// 异步线程池最大线程数
-	private Integer whenMaxWorkers;
-
 	// 异步线程池最大队列数量
+	@Deprecated
 	private Integer whenQueueLimit;
 
 	// 解析模式,一共有三种,具体看其定义
@@ -105,15 +100,6 @@ public class LiteflowConfig {
 
 	// 规则文件/脚本文件变更监听
 	private Boolean enableMonitorFile = Boolean.FALSE;
-
-	//并行循环线程池所用class路径
-	private String parallelLoopExecutorClass;
-
-	//使用默认并行循环线程池时,最大线程数
-	private Integer parallelMaxWorkers;
-
-	//使用默认并行循环线程池时,最大队列数
-	private Integer parallelQueueLimit;
 	
 	// 是否启用组件降级
 	private Boolean fallbackCmpEnable;
@@ -124,6 +110,9 @@ public class LiteflowConfig {
 	//脚本特殊设置选项
 	private Map<String, String> scriptSetting;
 
+	//是否启用节点实例ID
+	private Boolean enableNodeInstanceId;
+
 	public Boolean getEnableMonitorFile() {
 		return enableMonitorFile;
 	}
@@ -132,6 +121,15 @@ public class LiteflowConfig {
 		this.enableMonitorFile = enableMonitorFile;
 	}
 
+	//全局线程池所用class路径(when+异步循环)
+	private String globalThreadPoolExecutorClass;
+
+	//全局线程池最大线程数(when+异步循环)
+	private Integer globalThreadPoolSize;
+
+	//全局线程池最大队列数(when+异步循环)
+	private Integer globalThreadPoolQueueSize;
+
 	public Boolean getEnable() {
 		if (ObjectUtil.isNull(enable)) {
 			return Boolean.TRUE;
@@ -231,32 +229,6 @@ public class LiteflowConfig {
 		this.enableLog = enableLog;
 	}
 
-	public Integer getWhenMaxWorkers() {
-		if (ObjectUtil.isNull(whenMaxWorkers)) {
-			return 16;
-		}
-		else {
-			return whenMaxWorkers;
-		}
-	}
-
-	public void setWhenMaxWorkers(Integer whenMaxWorkers) {
-		this.whenMaxWorkers = whenMaxWorkers;
-	}
-
-	public Integer getWhenQueueLimit() {
-		if (ObjectUtil.isNull(whenQueueLimit)) {
-			return 512;
-		}
-		else {
-			return whenQueueLimit;
-		}
-	}
-
-	public void setWhenQueueLimit(Integer whenQueueLimit) {
-		this.whenQueueLimit = whenQueueLimit;
-	}
-
 	public Boolean isSupportMultipleType() {
 		if (ObjectUtil.isNull(supportMultipleType)) {
 			return Boolean.FALSE;
@@ -298,18 +270,6 @@ public class LiteflowConfig {
 		this.printBanner = printBanner;
 	}
 
-	public String getThreadExecutorClass() {
-		if (StrUtil.isBlank(threadExecutorClass)) {
-			return "com.yomahub.liteflow.thread.LiteFlowDefaultWhenExecutorBuilder";
-		}
-		else {
-			return threadExecutorClass;
-		}
-	}
-
-	public void setThreadExecutorClass(String threadExecutorClass) {
-		this.threadExecutorClass = threadExecutorClass;
-	}
 
 	public String getNodeExecutorClass() {
 		if (StrUtil.isBlank(nodeExecutorClass)) {
@@ -411,42 +371,6 @@ public class LiteflowConfig {
 	public void setWhenMaxWaitTimeUnit(TimeUnit whenMaxWaitTimeUnit) {
 		this.whenMaxWaitTimeUnit = whenMaxWaitTimeUnit;
 	}
-
-	public Integer getParallelMaxWorkers() {
-		if(ObjectUtil.isNull(parallelMaxWorkers)){
-			return 16;
-		}else{
-			return parallelMaxWorkers;
-		}
-	}
-
-	public void setParallelMaxWorkers(Integer parallelMaxWorkers) {
-		this.parallelMaxWorkers = parallelMaxWorkers;
-	}
-
-	public Integer getParallelQueueLimit() {
-		if(ObjectUtil.isNull(parallelQueueLimit)){
-			return 512;
-		}else{
-			return parallelQueueLimit;
-		}
-	}
-
-	public void setParallelQueueLimit(Integer parallelQueueLimit) {
-		this.parallelQueueLimit = parallelQueueLimit;
-	}
-
-	public String getParallelLoopExecutorClass() {
-		if (StrUtil.isBlank(parallelLoopExecutorClass)) {
-			return "com.yomahub.liteflow.thread.LiteFlowDefaultParallelLoopExecutorBuilder";
-		}
-		else {
-			return parallelLoopExecutorClass;
-		}
-	}
-	public void setParallelLoopExecutorClass(String parallelLoopExecutorClass) {
-		this.parallelLoopExecutorClass = parallelLoopExecutorClass;
-	}
 	
 	public Boolean getFallbackCmpEnable() {
 		if (ObjectUtil.isNull(this.fallbackCmpEnable)) {
@@ -509,4 +433,52 @@ public class LiteflowConfig {
 	public void setScriptSetting(Map<String, String> scriptSetting) {
 		this.scriptSetting = scriptSetting;
 	}
+
+	public Integer getGlobalThreadPoolSize() {
+		if (ObjectUtil.isNull(globalThreadPoolSize)) {
+			return 16;
+		} else {
+			return globalThreadPoolSize;
+		}
+	}
+
+	public void setGlobalThreadPoolSize(Integer globalThreadPoolSize) {
+		this.globalThreadPoolSize = globalThreadPoolSize;
+	}
+
+	public Integer getGlobalThreadPoolQueueSize() {
+		if (ObjectUtil.isNull(globalThreadPoolQueueSize)) {
+			return 512;
+		} else {
+			return globalThreadPoolQueueSize;
+		}
+	}
+
+	public void setGlobalThreadPoolQueueSize(Integer globalThreadPoolQueueSize) {
+		this.globalThreadPoolQueueSize = globalThreadPoolQueueSize;
+	}
+
+	public String getGlobalThreadPoolExecutorClass() {
+		if (StrUtil.isBlank(globalThreadPoolExecutorClass)) {
+			return "com.yomahub.liteflow.thread.LiteFlowDefaultGlobalExecutorBuilder";
+		} else {
+			return globalThreadPoolExecutorClass;
+		}
+	}
+
+	public void setGlobalThreadPoolExecutorClass(String globalThreadPoolExecutorClass) {
+		this.globalThreadPoolExecutorClass = globalThreadPoolExecutorClass;
+	}
+
+	public Boolean getEnableNodeInstanceId() {
+        if (ObjectUtil.isNull(enableNodeInstanceId)) {
+            return Boolean.FALSE;
+        } else {
+            return enableNodeInstanceId;
+        }
+    }
+
+	public void setEnableNodeInstanceId(Boolean enableNodeInstanceId) {
+		this.enableNodeInstanceId = enableNodeInstanceId;
+	}
 }

+ 2 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/slot/DataBus.java

@@ -21,6 +21,7 @@ import com.yomahub.liteflow.property.LiteflowConfig;
 import com.yomahub.liteflow.property.LiteflowConfigGetter;
 
 import java.util.List;
+import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -82,7 +83,7 @@ public class DataBus {
 	}
 
 	public static int offerSlotByBean(List<Object> contextList) {
-		List<Tuple> contextBeanList = contextList.stream().map(object -> {
+		List<Tuple> contextBeanList = contextList.stream().filter(Objects::nonNull).map(object -> {
             ContextBean contextBean = AnnoUtil.getAnnotation(object.getClass(), ContextBean.class);
             String contextKey;
             if (contextBean != null && StrUtil.isNotBlank(contextBean.value())){

+ 17 - 0
liteflow-core/src/main/java/com/yomahub/liteflow/slot/Slot.java

@@ -35,6 +35,7 @@ import java.util.function.Predicate;
  * @author Bryan.Zhang
  * @author LeoLee
  * @author DaleLee
+ * @author Jay li
  */
 @SuppressWarnings("unchecked")
 public class Slot {
@@ -357,6 +358,22 @@ public class Slot {
 		return this.executeStepsStr;
 	}
 
+
+	public String getExecuteStepStrWithInstanceId() {
+		StringBuilder str = new StringBuilder();
+		CmpStep cmpStep;
+		for (Iterator<CmpStep> it = executeSteps.iterator(); it.hasNext();) {
+			cmpStep = it.next();
+			str.append(cmpStep.buildStringWithInstanceId());
+
+			if (it.hasNext()) {
+				str.append("==>");
+			}
+		}
+		this.executeStepsStr = str.toString();
+		return this.executeStepsStr;
+	}
+
 	public String getExecuteStepStr() {
 		return getExecuteStepStr(false);
 	}

+ 1 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/spi/local/LocalContextAware.java

@@ -26,7 +26,7 @@ public class LocalContextAware implements ContextAware {
 
     @Override
     public <T> T registerBean(String beanName, Class<T> clazz) {
-        return ReflectUtil.newInstance(clazz);
+        return ReflectUtil.newInstanceIfPossible(clazz);
     }
 
     @Override

+ 48 - 0
liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorCondition/ExecutorCondition.java

@@ -0,0 +1,48 @@
+package com.yomahub.liteflow.thread.ExecutorCondition;
+
+
+/**
+ * <p>Title: ExecutorCondition</p>
+ * <p>Description: 执行器条件对象</p>
+ *
+ * @author jason
+ * @Date 2024/11/12
+ */
+public class ExecutorCondition {
+    private final boolean conditionLevel;
+    private final boolean chainLevel;
+    private final String conditionExecutorClass;
+
+    private ExecutorCondition(
+            boolean conditionLevel,
+            boolean chainLevel,
+            String conditionExecutorClass) {
+        this.conditionLevel = conditionLevel;
+        this.chainLevel = chainLevel;
+        this.conditionExecutorClass = conditionExecutorClass;
+    }
+
+    public static ExecutorCondition create(
+            boolean conditionLevel,
+            boolean chainLevel,
+            String conditionExecutorClass
+    ) {
+        return new ExecutorCondition(
+                conditionLevel,
+                chainLevel,
+                conditionExecutorClass
+        );
+    }
+
+    public boolean isConditionLevel() {
+        return conditionLevel;
+    }
+
+    public boolean isChainLevel() {
+        return chainLevel;
+    }
+
+    public String getConditionExecutorClass() {
+        return conditionExecutorClass;
+    }
+}

+ 64 - 0
liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorCondition/ExecutorConditionBuilder.java

@@ -0,0 +1,64 @@
+package com.yomahub.liteflow.thread.ExecutorCondition;
+
+
+import cn.hutool.core.util.BooleanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.enums.ConditionTypeEnum;
+import com.yomahub.liteflow.flow.element.Chain;
+import com.yomahub.liteflow.flow.element.Condition;
+import com.yomahub.liteflow.flow.element.condition.LoopCondition;
+import com.yomahub.liteflow.flow.element.condition.WhenCondition;
+import com.yomahub.liteflow.property.LiteflowConfig;
+
+/**
+ * <p>Title: ExecutorConditionBuilder</p>
+ * <p>Description: 执行器构建对象</p>
+ *
+ * @author jason
+ * @Date 2024/11/12
+ */
+
+public class ExecutorConditionBuilder {
+
+    /**
+     * 构建执行器条件
+     */
+    public static ExecutorCondition buildExecutorCondition(
+            Condition condition,
+            Chain chain,
+            LiteflowConfig liteflowConfig,
+            ConditionTypeEnum type) {
+
+        boolean conditionLevel;
+        boolean chainLevel;
+        String conditionExecutorClass;
+
+        switch (type) {
+            case TYPE_FOR:
+            case TYPE_WHILE:
+            case TYPE_ITERATOR:
+                LoopCondition loopCondition = (LoopCondition) condition;
+                conditionLevel = ObjectUtil.isNotEmpty(loopCondition.getThreadPoolExecutorClass());
+                conditionExecutorClass = loopCondition.getThreadPoolExecutorClass();
+                chainLevel = ObjectUtil.isNotEmpty(chain.getThreadPoolExecutorClass());
+                break;
+            case TYPE_WHEN:
+                WhenCondition whenCondition = (WhenCondition) condition;
+                conditionLevel =
+                        (BooleanUtil.isTrue(liteflowConfig.getWhenThreadPoolIsolate())) || (ObjectUtil.isNotEmpty(whenCondition.getThreadExecutorClass()));
+                //当whenThreadPoolIsolate为true,需要有默认值
+                conditionExecutorClass = whenCondition.getThreadExecutorClass() == null ?
+                        liteflowConfig.getGlobalThreadPoolExecutorClass() : whenCondition.getThreadExecutorClass();
+                chainLevel = ObjectUtil.isNotEmpty(chain.getThreadPoolExecutorClass());
+                break;
+            default:
+                throw new IllegalArgumentException("Unsupported condition type: " + type);
+        }
+
+        return ExecutorCondition.create(
+                conditionLevel,
+                chainLevel,
+                conditionExecutorClass
+        );
+    }
+}

+ 60 - 18
liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorHelper.java

@@ -11,22 +11,29 @@ package com.yomahub.liteflow.thread;
 import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import com.yomahub.liteflow.enums.ConditionTypeEnum;
 import com.yomahub.liteflow.exception.ThreadExecutorServiceCreateException;
+import com.yomahub.liteflow.flow.FlowBus;
+import com.yomahub.liteflow.flow.element.Chain;
+import com.yomahub.liteflow.flow.element.Condition;
 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.slot.DataBus;
 import com.yomahub.liteflow.spi.holder.ContextAwareHolder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import com.yomahub.liteflow.thread.ExecutorCondition.ExecutorCondition;
+import com.yomahub.liteflow.thread.ExecutorCondition.ExecutorConditionBuilder;
 
 import java.util.Map;
-import java.util.concurrent.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.TimeUnit;
 
 /**
  * 线程池工具类
  *
  * @author Bryan.Zhang
+ * @author jason
  */
 public class ExecutorHelper {
 
@@ -89,7 +96,7 @@ public class ExecutorHelper {
 	// 构建默认when线程池
 	public ExecutorService buildWhenExecutor() {
 		LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
-		return buildWhenExecutor(liteflowConfig.getThreadExecutorClass());
+		return buildWhenExecutor(liteflowConfig.getGlobalThreadPoolExecutorClass());
 	}
 
 	// 构建when线程池 - 支持多个when公用一个线程池
@@ -101,17 +108,17 @@ public class ExecutorHelper {
 	}
 
 	// 构建when线程池 - clazz和condition的hash值共同作为缓存key
-	public ExecutorService buildWhenExecutorWithHash(String conditionHash) {
+	public ExecutorService buildWhenExecutorWithHash(String hash) {
 		LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
-		return buildWhenExecutorWithHash(liteflowConfig.getThreadExecutorClass(), conditionHash);
+		return buildWhenExecutorWithHash(liteflowConfig.getGlobalThreadPoolExecutorClass(), hash);
 	}
 
 	// 构建when线程池 - clazz和condition的hash值共同作为缓存key
-	public ExecutorService buildWhenExecutorWithHash(String clazz, String conditionHash) {
+	public ExecutorService buildWhenExecutorWithHash(String clazz, String hash) {
 		if (StrUtil.isBlank(clazz)) {
-			return buildWhenExecutorWithHash(conditionHash);
+			return buildWhenExecutorWithHash(hash);
 		}
-		return getExecutorService(clazz, conditionHash);
+		return getExecutorService(clazz, hash);
 	}
 
 	// 构建默认的FlowExecutor线程池,用于execute2Future方法
@@ -127,12 +134,6 @@ public class ExecutorHelper {
 		return getExecutorService(clazz);
 	}
 
-	//构造并行循环的线程池
-	public ExecutorService buildLoopParallelExecutor(){
-		LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
-		return getExecutorService(liteflowConfig.getParallelLoopExecutorClass());
-	}
-
 	private ExecutorService getExecutorService(String clazz){
 		return getExecutorService(clazz, null);
 	}
@@ -140,13 +141,13 @@ public class ExecutorHelper {
 	/**
 	 * 根据线程执行构建者Class类名获取ExecutorService实例
 	 */
-	private ExecutorService getExecutorService(String clazz, String conditionHash) {
+	private ExecutorService getExecutorService(String clazz, String hash) {
 		try {
 			String key;
-			if (StrUtil.isBlank(conditionHash)){
+			if (StrUtil.isBlank(hash)) {
 				key = clazz;
 			}else{
-				key = StrUtil.format("{}_{}", clazz, conditionHash);
+				key = StrUtil.format("{}_{}", clazz, hash);
 			}
 
 			ExecutorService executorServiceFromCache = executorServiceMap.get(key);
@@ -173,4 +174,45 @@ public class ExecutorHelper {
 		}
 	}
 
+	/**
+	 * 构建执行器服务
+	 *
+	 * @param condition 条件对象(Loop或When条件)
+	 * @param slotIndex 槽索引
+	 * @param type      condition类型
+	 * @return ExecutorService
+	 */
+	public ExecutorService buildExecutorService(Condition condition, Integer slotIndex, ConditionTypeEnum type) {
+		ExecutorService executor;
+		LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
+		String chainId = DataBus.getSlot(slotIndex).getChainId();
+		Chain chain = FlowBus.getChain(chainId);
+
+		// 构建条件判断对象
+		ExecutorCondition execCondition = ExecutorConditionBuilder.buildExecutorCondition(
+				condition,
+				chain,
+				liteflowConfig,
+				type
+		);
+
+		// 根据条件选择执行器
+		if (execCondition.isConditionLevel()) {
+			// condition层级线程池
+			executor = getExecutorService(execCondition.getConditionExecutorClass(),
+										  String.valueOf(condition.hashCode()));
+
+		} else if (execCondition.isChainLevel()) {
+			// chain层级线程池
+			executor = getExecutorService(chain.getThreadPoolExecutorClass(),
+										  String.valueOf(chain.hashCode()));
+		} else {
+			// 全局线程池
+			executor = getExecutorService(liteflowConfig.getGlobalThreadPoolExecutorClass());
+		}
+
+		return executor;
+	}
+
+
 }

+ 6 - 6
liteflow-core/src/main/java/com/yomahub/liteflow/thread/LiteFlowDefaultParallelLoopExecutorBuilder.java → liteflow-core/src/main/java/com/yomahub/liteflow/thread/LiteFlowDefaultGlobalExecutorBuilder.java

@@ -7,13 +7,12 @@ import com.yomahub.liteflow.property.LiteflowConfigGetter;
 import java.util.concurrent.ExecutorService;
 
 /**
- * LiteFlow默认的并行循环执行器实现
+ * LiteFlow默认全局线程池执行器实现
  *
- * @author zhhhhy
- * @since 2.11.0
+ * @author jason
  */
+public class LiteFlowDefaultGlobalExecutorBuilder implements ExecutorBuilder {
 
-public class LiteFlowDefaultParallelLoopExecutorBuilder implements ExecutorBuilder {
     @Override
     public ExecutorService buildExecutor() {
         LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
@@ -21,7 +20,8 @@ public class LiteFlowDefaultParallelLoopExecutorBuilder implements ExecutorBuild
         if (ObjectUtil.isNull(liteflowConfig)) {
             liteflowConfig = new LiteflowConfig();
         }
-        return buildDefaultExecutor(liteflowConfig.getParallelMaxWorkers(), liteflowConfig.getParallelMaxWorkers(),
-                liteflowConfig.getParallelQueueLimit(), "loop-thread-");
+        return buildDefaultExecutor(liteflowConfig.getGlobalThreadPoolSize(), liteflowConfig.getGlobalThreadPoolSize(),
+                                    liteflowConfig.getGlobalThreadPoolQueueSize(), "global-thread-");
     }
+
 }

+ 0 - 17
liteflow-core/src/main/java/com/yomahub/liteflow/util/ElRegexUtil.java

@@ -21,23 +21,6 @@ public class ElRegexUtil {
     // abstractChain 占位符正则表达式
     private static final String REGEX_ABSTRACT_HOLDER = "\\{\\{\\s*([a-zA-Z_][a-zA-Z_\\d]*|\\d+)\\s*\\}\\}(?![\\s]*=)";
 
-    /**
-     * 移除 el 表达式中的注释,支持 java 的注释,包括单行注释、多行注释, 会压缩字符串,移除空格和换行符
-     *
-     * @param elStr el 表达式
-     * @return 移除注释后的 el 表达式
-     */
-    public static String removeComments(String elStr) {
-        if (StrUtil.isBlank(elStr)) {
-            return elStr;
-        }
-
-        return Pattern.compile(REGEX_COMMENT)
-                .matcher(elStr)
-                // 移除注释
-                .replaceAll(CharSequenceUtil.EMPTY);
-    }
-
     /**
      * 根据抽象EL和实现EL,替换抽象EL中的占位符
      *

+ 1 - 0
liteflow-core/src/main/resources/dtd/liteflow.dtd

@@ -22,4 +22,5 @@
         extends CDATA #IMPLIED
         enable (true|false) #IMPLIED
         namespace CDATA #IMPLIED
+        thread-pool-executor-class CDATA #IMPLIED
         >

+ 108 - 4
liteflow-el-builder/src/main/java/com/yomahub/liteflow/builder/el/CommonNodeELWrapper.java

@@ -1,25 +1,129 @@
 package com.yomahub.liteflow.builder.el;
 
+import cn.hutool.core.util.StrUtil;
+import com.yomahub.liteflow.util.JsonUtil;
+
+import java.util.Map;
+
 /**
  * 普通节点表示
  *
  * @author luo yi
  * @since 2.12.3
  */
-public class CommonNodeELWrapper extends NodeELWrapper {
+public class CommonNodeELWrapper extends ELWrapper {
+
+    private String nodeId;
+
+    private String tag;
 
     public CommonNodeELWrapper(String nodeId) {
-        super(nodeId);
+        this.nodeId = nodeId;
+        this.setNodeWrapper(this);
+    }
+
+    private void setNodeWrapper(ELWrapper elWrapper){
+        this.addWrapper(elWrapper, 0);
+    }
+
+    private CommonNodeELWrapper getNodeWrapper(){
+        return (CommonNodeELWrapper) this.getFirstWrapper();
+    }
+
+    protected String getNodeId() {
+        return nodeId;
+    }
+
+    protected void setNodeId(String nodeId) {
+        this.nodeId = nodeId;
+    }
+
+    @Override
+    public CommonNodeELWrapper tag(String tag) {
+        this.setTag(tag);
+        return this;
+    }
+
+    /**
+     * 单节点不允许定义 id,重载为protected修饰
+     *
+     * @param id 节点id
+     * @return {@link CommonNodeELWrapper}
+     */
+    @Override
+    public CommonNodeELWrapper id(String id) {
+        this.setId(id);
+        return this;
+    }
+
+    @Override
+    public CommonNodeELWrapper data(String dataName, Object object) {
+        setData("'" + JsonUtil.toJsonString(object) + "'");
+        setDataName(dataName);
+        return this;
+    }
+
+    @Override
+    public CommonNodeELWrapper data(String dataName, String jsonString) {
+        setData("'" + jsonString + "'");
+        setDataName(dataName);
+        return this;
+    }
+
+    @Override
+    public CommonNodeELWrapper data(String dataName, Map<String, Object> jsonMap) {
+        setData("'" + JsonUtil.toJsonString(jsonMap) + "'");
+        setDataName(dataName);
+        return this;
+    }
+
+    @Override
+    public CommonNodeELWrapper maxWaitSeconds(Integer maxWaitSeconds){
+        setMaxWaitSeconds(maxWaitSeconds);
+        return this;
+    }
+
+    public CommonNodeELWrapper retry(Integer count){
+        super.retry(count);
+        return this;
+    }
+
+    public CommonNodeELWrapper retry(Integer count, String... exceptions){
+        super.retry(count, exceptions);
+        return this;
     }
 
     @Override
     protected String toEL(Integer depth, StringBuilder paramContext) {
-        CommonNodeELWrapper nodeElWrapper = (CommonNodeELWrapper) this.getFirstWrapper();
+        CommonNodeELWrapper commonNodeElWrapper = this.getNodeWrapper();
         StringBuilder sb = new StringBuilder();
         processWrapperTabs(sb, depth);
-        sb.append(nodeElWrapper.getNodeId());
+        sb.append(commonNodeElWrapper.getNodeId());
         processWrapperProperty(sb, paramContext);
         return sb.toString();
     }
 
+    /**
+     * Node的公共属性不包括id,对父类方法重载。
+     *
+     * @param elContext    EL 上下文
+     * @param paramContext 参数上下文
+     */
+    @Override
+    protected void processWrapperProperty(StringBuilder elContext, StringBuilder paramContext){
+        if(this.getTag() != null){
+            elContext.append(StrUtil.format(".tag(\"{}\")", this.getTag()));
+        }
+        if(this.getData() != null){
+            elContext.append(StrUtil.format(".data({})", this.getDataName()));
+            paramContext.append(StrUtil.format("{} = {}", this.getDataName(), this.getData())).append(";\n");
+        }
+        if(this.getMaxWaitSeconds() != null){
+            elContext.append(StrUtil.format(".maxWaitSeconds({})", String.valueOf(this.getMaxWaitSeconds())));
+        }
+        if (this.getRetry() != null){
+            elContext.append(StrUtil.format(".retry({})", this.getRetry().toString()));
+        }
+    }
+
 }

+ 28 - 37
liteflow-el-builder/src/main/java/com/yomahub/liteflow/builder/el/ELBus.java

@@ -13,8 +13,6 @@ public class ELBus {
 
     public static final String TAB = "\t";
 
-    private static boolean nodeWrapper = true;
-
     /**
      * 创建 then 串行组件
      *
@@ -82,12 +80,12 @@ public class ELBus {
      * @param falseElWrapper 判断节点返回false时执行的组件
      * @return {@link IfELWrapper}
      */
-    public static IfELWrapper ifOpt(NodeELWrapper ifElWrapper, Object trueElWrapper, Object falseElWrapper){
+    public static IfELWrapper ifOpt(CommonNodeELWrapper ifElWrapper, Object trueElWrapper, Object falseElWrapper){
         return new IfELWrapper(ifElWrapper, convertToNonBooleanOpt(trueElWrapper), convertToNonBooleanOpt(falseElWrapper));
     }
 
     public static IfELWrapper ifOpt(String ifElWrapper, Object trueElWrapper, Object falseElWrapper){
-        return new IfELWrapper((NodeELWrapper) convertToBooleanOpt(ifElWrapper), convertToNonBooleanOpt(trueElWrapper), convertToNonBooleanOpt(falseElWrapper));
+        return new IfELWrapper((CommonNodeELWrapper) convertToBooleanOpt(ifElWrapper), convertToNonBooleanOpt(trueElWrapper), convertToNonBooleanOpt(falseElWrapper));
     }
 
     public static IfELWrapper ifOpt(AndELWrapper ifElWrapper, Object trueElWrapper, Object falseElWrapper){
@@ -102,12 +100,12 @@ public class ELBus {
         return new IfELWrapper(ifElWrapper, convertToNonBooleanOpt(trueElWrapper), convertToNonBooleanOpt(falseElWrapper));
     }
 
-    public static IfELWrapper ifOpt(NodeELWrapper ifElWrapper, Object trueElWrapper){
+    public static IfELWrapper ifOpt(CommonNodeELWrapper ifElWrapper, Object trueElWrapper){
         return new IfELWrapper(ifElWrapper, convertToNonBooleanOpt(trueElWrapper));
     }
 
     public static IfELWrapper ifOpt(String ifElWrapper, Object trueElWrapper){
-        return new IfELWrapper((NodeELWrapper) convertToBooleanOpt(ifElWrapper), convertToNonBooleanOpt(trueElWrapper));
+        return new IfELWrapper((CommonNodeELWrapper) convertToBooleanOpt(ifElWrapper), convertToNonBooleanOpt(trueElWrapper));
     }
 
     public static IfELWrapper ifOpt(AndELWrapper ifElWrapper, Object trueElWrapper){
@@ -123,33 +121,33 @@ public class ELBus {
     }
 
     /**
-     * 创建 node 单节点表达式
+     * 创建 commonNode 单节点表达式
      *
      * @param nodeId 节点id
-     * @return {@link NodeELWrapper}
+     * @return {@link CommonNodeELWrapper}
      */
-    public static NodeELWrapper node(String nodeId){
-        return new NodeELWrapper(nodeId);
+    public static CommonNodeELWrapper commonNode(String nodeId){
+        return new CommonNodeELWrapper(nodeId);
     }
 
     /**
-     * 创建普通 node 单节点表达式
+     * 创建降级 commonNode 单节点表达式
      *
      * @param nodeId 节点 id
-     * @return {@link CommonNodeELWrapper}
+     * @return {@link NodeELWrapper}
      */
-    public static CommonNodeELWrapper commonNode(String nodeId){
-        return new CommonNodeELWrapper(nodeId);
+    public static NodeELWrapper node(String nodeId){
+        return new NodeELWrapper(nodeId);
     }
 
     /**
      * 创建 switch 选择表达式
      *
-     * @param nodeElWrapper 选择节点
+     * @param commonNodeElWrapper 选择节点
      * @return {@link SwitchELWrapper}
      */
-    public static SwitchELWrapper switchOpt(NodeELWrapper nodeElWrapper){
-        return new SwitchELWrapper(nodeElWrapper);
+    public static SwitchELWrapper switchOpt(CommonNodeELWrapper commonNodeElWrapper){
+        return new SwitchELWrapper(commonNodeElWrapper);
     }
 
     public static SwitchELWrapper switchOpt(String nodeElWrapper){
@@ -169,11 +167,11 @@ public class ELBus {
     /**
      * 创建 for 次数循环表达式
      *
-     * @param nodeElWrapper 返回循环次数的节点
+     * @param commonNodeElWrapper 返回循环次数的节点
      * @return {@link LoopELWrapper}
      */
-    public static LoopELWrapper forOpt(NodeELWrapper nodeElWrapper){
-        return new LoopELWrapper(nodeElWrapper, LoopELWrapper.FOR);
+    public static LoopELWrapper forOpt(CommonNodeELWrapper commonNodeElWrapper){
+        return new LoopELWrapper(commonNodeElWrapper, LoopELWrapper.FOR);
     }
 
     /**
@@ -189,11 +187,11 @@ public class ELBus {
     /**
      * 创建 while 条件循环表达式
      *
-     * @param nodeElWrapper 返回布尔值的节点
+     * @param commonNodeElWrapper 返回布尔值的节点
      * @return {@link LoopELWrapper}
      */
-    public static LoopELWrapper whileOpt(NodeELWrapper nodeElWrapper){
-        return new LoopELWrapper(nodeElWrapper, LoopELWrapper.WHILE);
+    public static LoopELWrapper whileOpt(CommonNodeELWrapper commonNodeElWrapper){
+        return new LoopELWrapper(commonNodeElWrapper, LoopELWrapper.WHILE);
     }
 
     public static LoopELWrapper whileOpt(String nodeElWrapper){
@@ -215,11 +213,11 @@ public class ELBus {
     /**
      * 创建迭代循环表达式
      *
-     * @param nodeElWrapper 迭代节点
+     * @param commonNodeElWrapper 迭代节点
      * @return {@link LoopELWrapper}
      */
-    public static LoopELWrapper iteratorOpt(NodeELWrapper nodeElWrapper){
-        return new LoopELWrapper(nodeElWrapper, LoopELWrapper.ITERATOR);
+    public static LoopELWrapper iteratorOpt(CommonNodeELWrapper commonNodeElWrapper){
+        return new LoopELWrapper(commonNodeElWrapper, LoopELWrapper.ITERATOR);
     }
 
     public static LoopELWrapper iteratorOpt(String nodeElWrapper){
@@ -264,7 +262,7 @@ public class ELBus {
      * @param notElWrapper 返回布尔值的表达式
      * @return {@link NotELWrapper}
      */
-    public static NotELWrapper not(NodeELWrapper notElWrapper){
+    public static NotELWrapper not(CommonNodeELWrapper notElWrapper){
         return new NotELWrapper(notElWrapper);
     }
 
@@ -294,7 +292,7 @@ public class ELBus {
     public static ELWrapper[] convert(Object... objects){
         return Arrays.stream(objects).map(o -> {
             if (o instanceof String) {
-                return new NodeELWrapper(o.toString());
+                return new CommonNodeELWrapper(o.toString());
             } else if (o instanceof ELWrapper) {
                 return (ELWrapper) o;
             } else {
@@ -305,7 +303,7 @@ public class ELBus {
 
     public static ELWrapper convert(Object object){
         if (object instanceof String) {
-            return new NodeELWrapper(object.toString());
+            return new CommonNodeELWrapper(object.toString());
         } else if (object instanceof ELWrapper) {
             return (ELWrapper) object;
         } else {
@@ -376,17 +374,10 @@ public class ELBus {
             if(!(elWrapper instanceof AndELWrapper)
                     && !(elWrapper instanceof OrELWrapper)
                     && !(elWrapper instanceof NotELWrapper)
-                    && !(elWrapper instanceof NodeELWrapper)){
+                    && !(elWrapper instanceof CommonNodeELWrapper)){
                 throw new RuntimeException("param is error");
             }
         }
     }
 
-    public static boolean isNodeWrapper() {
-        return nodeWrapper;
-    }
-
-    public static void setNodeWrapper(boolean nodeWrapper) {
-        ELBus.nodeWrapper = nodeWrapper;
-    }
 }

+ 4 - 4
liteflow-el-builder/src/main/java/com/yomahub/liteflow/builder/el/IfELWrapper.java

@@ -32,14 +32,14 @@ public class IfELWrapper extends ELWrapper {
      * @param trueWrapper  判断节点返回true时执行的表达式
      * @param falseWrapper 判断节点返回false时执行的表达式
      */
-    public IfELWrapper(NodeELWrapper ifWrapper, ELWrapper trueWrapper, ELWrapper falseWrapper) {
+    public IfELWrapper(CommonNodeELWrapper ifWrapper, ELWrapper trueWrapper, ELWrapper falseWrapper) {
         this.setIfWrapper(ifWrapper);
         this.setTrueWrapper(trueWrapper);
         this.setFalseWrapper(falseWrapper);
         this.format = IF_FORMAT;
     }
 
-    public IfELWrapper(NodeELWrapper ifWrapper, ELWrapper trueWrapper) {
+    public IfELWrapper(CommonNodeELWrapper ifWrapper, ELWrapper trueWrapper) {
         this.setIfWrapper(ifWrapper);
         this.setTrueWrapper(trueWrapper);
         this.format = IF_ELSE_FORMAT;
@@ -139,8 +139,8 @@ public class IfELWrapper extends ELWrapper {
         ELWrapper ifWrapper = ELBus.convertToBooleanOpt(ifObject);
         ELWrapper trueWrapper = ELBus.convertToNonBooleanOpt(trueObject);
         IfELWrapper elIfWrapper;
-        if(ifWrapper instanceof NodeELWrapper){
-            elIfWrapper = new IfELWrapper((NodeELWrapper) ifWrapper, trueWrapper);
+        if(ifWrapper instanceof CommonNodeELWrapper){
+            elIfWrapper = new IfELWrapper((CommonNodeELWrapper) ifWrapper, trueWrapper);
         } else if (ifWrapper instanceof AndELWrapper){
             elIfWrapper = new IfELWrapper((AndELWrapper) ifWrapper, trueWrapper);
         } else if (ifWrapper instanceof OrELWrapper){

+ 5 - 109
liteflow-el-builder/src/main/java/com/yomahub/liteflow/builder/el/NodeELWrapper.java

@@ -1,9 +1,6 @@
 package com.yomahub.liteflow.builder.el;
 
 import cn.hutool.core.util.StrUtil;
-import com.yomahub.liteflow.util.JsonUtil;
-
-import java.util.Map;
 
 /**
  * 单节点表达式
@@ -11,124 +8,23 @@ import java.util.Map;
  * 支持设置 tag data maxWaitSeconds 属性
  *
  * @author gezuao
+ * @author luo yi
  * @since 2.11.1
  */
-public class NodeELWrapper extends ELWrapper {
-
-    private String nodeId;
-
-    private String tag;
+public class NodeELWrapper extends CommonNodeELWrapper {
 
     public NodeELWrapper(String nodeId) {
-        this.nodeId = nodeId;
-        this.setNodeWrapper(this);
-    }
-
-    private void setNodeWrapper(ELWrapper elWrapper){
-        this.addWrapper(elWrapper, 0);
-    }
-
-    private NodeELWrapper getNodeWrapper(){
-        return (NodeELWrapper) this.getFirstWrapper();
-    }
-
-    protected String getNodeId() {
-        return nodeId;
-    }
-
-    protected void setNodeId(String nodeId) {
-        this.nodeId = nodeId;
-    }
-
-    @Override
-    public NodeELWrapper tag(String tag) {
-        this.setTag(tag);
-        return this;
-    }
-
-    /**
-     * 单节点不允许定义 id,重载为protected修饰
-     *
-     * @param id 节点id
-     * @return {@link NodeELWrapper}
-     */
-    @Override
-    public NodeELWrapper id(String id) {
-        this.setId(id);
-        return this;
-    }
-
-    @Override
-    public NodeELWrapper data(String dataName, Object object) {
-        setData("'" + JsonUtil.toJsonString(object) + "'");
-        setDataName(dataName);
-        return this;
-    }
-
-    @Override
-    public NodeELWrapper data(String dataName, String jsonString) {
-        setData("'" + jsonString + "'");
-        setDataName(dataName);
-        return this;
-    }
-
-    @Override
-    public NodeELWrapper data(String dataName, Map<String, Object> jsonMap) {
-        setData("'" + JsonUtil.toJsonString(jsonMap) + "'");
-        setDataName(dataName);
-        return this;
-    }
-
-    @Override
-    public NodeELWrapper maxWaitSeconds(Integer maxWaitSeconds){
-        setMaxWaitSeconds(maxWaitSeconds);
-        return this;
-    }
-
-    public NodeELWrapper retry(Integer count){
-        super.retry(count);
-        return this;
-    }
-
-    public NodeELWrapper retry(Integer count, String... exceptions){
-        super.retry(count, exceptions);
-        return this;
+        super(nodeId);
     }
 
     @Override
     protected String toEL(Integer depth, StringBuilder paramContext) {
-        NodeELWrapper nodeElWrapper = this.getNodeWrapper();
+        NodeELWrapper nodeElWrapper = (NodeELWrapper) this.getFirstWrapper();
         StringBuilder sb = new StringBuilder();
         processWrapperTabs(sb, depth);
-        if (ELBus.isNodeWrapper()){
-            sb.append(StrUtil.format("node(\"{}\")", nodeElWrapper.getNodeId()));
-        }else{
-            sb.append(StrUtil.format("{}", nodeElWrapper.getNodeId()));
-        }
+        sb.append(StrUtil.format("node(\"{}\")", nodeElWrapper.getNodeId()));
         processWrapperProperty(sb, paramContext);
         return sb.toString();
     }
 
-    /**
-     * Node的公共属性不包括id,对父类方法重载。
-     *
-     * @param elContext    EL 上下文
-     * @param paramContext 参数上下文
-     */
-    @Override
-    protected void processWrapperProperty(StringBuilder elContext, StringBuilder paramContext){
-        if(this.getTag() != null){
-            elContext.append(StrUtil.format(".tag(\"{}\")", this.getTag()));
-        }
-        if(this.getData() != null){
-            elContext.append(StrUtil.format(".data({})", this.getDataName()));
-            paramContext.append(StrUtil.format("{} = {}", this.getDataName(), this.getData())).append(";\n");
-        }
-        if(this.getMaxWaitSeconds() != null){
-            elContext.append(StrUtil.format(".maxWaitSeconds({})", String.valueOf(this.getMaxWaitSeconds())));
-        }
-        if (this.getRetry() != null){
-            elContext.append(StrUtil.format(".retry({})", this.getRetry().toString()));
-        }
-    }
 }

+ 15 - 0
liteflow-rule-plugin/liteflow-rule-redis/pom.xml

@@ -21,9 +21,24 @@
             <scope>provided</scope>
         </dependency>
 
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>org.redisson</groupId>
             <artifactId>redisson</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-databind</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-core</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <dependency>

+ 6 - 6
liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowAutoConfiguration.java

@@ -14,6 +14,7 @@ import org.noear.solon.annotation.Inject;
  *
  * @author Bryan.Zhang
  * @author noear
+ * @author jason
  * @since 2.9
  */
 @Configuration
@@ -29,14 +30,11 @@ public class LiteflowAutoConfiguration {
 		liteflowConfig.setRuleSourceExtData(property.getRuleSourceExtData());
 		liteflowConfig.setRuleSourceExtDataMap(property.getRuleSourceExtDataMap());
 		liteflowConfig.setSlotSize(property.getSlotSize());
-		liteflowConfig.setThreadExecutorClass(property.getThreadExecutorClass());
 		liteflowConfig.setWhenMaxWaitSeconds(property.getWhenMaxWaitSeconds());
 		liteflowConfig.setEnableLog(liteflowMonitorProperty.isEnableLog());
 		liteflowConfig.setQueueLimit(liteflowMonitorProperty.getQueueLimit());
 		liteflowConfig.setDelay(liteflowMonitorProperty.getDelay());
 		liteflowConfig.setPeriod(liteflowMonitorProperty.getPeriod());
-		liteflowConfig.setWhenMaxWorkers(property.getWhenMaxWorkers());
-		liteflowConfig.setWhenQueueLimit(property.getWhenQueueLimit());
 		liteflowConfig.setParseMode(property.getParseMode());
 		liteflowConfig.setEnable(property.isEnable());
 		liteflowConfig.setSupportMultipleType(property.isSupportMultipleType());
@@ -47,10 +45,12 @@ public class LiteflowAutoConfiguration {
 		liteflowConfig.setMainExecutorWorks(property.getMainExecutorWorks());
 		liteflowConfig.setMainExecutorClass(property.getMainExecutorClass());
 		liteflowConfig.setPrintExecutionLog(property.isPrintExecutionLog());
-		liteflowConfig.setParallelMaxWorkers(property.getParallelMaxWorkers());
-		liteflowConfig.setParallelQueueLimit(property.getParallelQueueLimit());
-		liteflowConfig.setParallelLoopExecutorClass(property.getParallelLoopExecutorClass());
 		liteflowConfig.setFallbackCmpEnable(property.isFallbackCmpEnable());
+        liteflowConfig.setGlobalThreadPoolExecutorClass(property.getGlobalThreadPoolExecutorClass());
+        liteflowConfig.setGlobalThreadPoolSize(property.getGlobalThreadPoolSize());
+        liteflowConfig.setGlobalThreadPoolQueueSize(property.getGlobalThreadPoolQueueSize());
+        liteflowConfig.setWhenThreadPoolIsolate(property.getWhenThreadPoolIsolate());
+		liteflowConfig.setEnableNodeInstanceId(property.isEnableNodeInstanceId());
 		return liteflowConfig;
 	}
 

+ 74 - 0
liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowProperty.java

@@ -1,5 +1,7 @@
 package com.yomahub.liteflow.solon.config;
 
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
 import com.yomahub.liteflow.enums.ParseModeEnum;
 import org.noear.solon.annotation.Configuration;
 import org.noear.solon.annotation.Inject;
@@ -11,6 +13,7 @@ import java.util.Map;
  *
  * @author Bryan.Zhang
  * @author noear
+ * @author jason
  * @since 2.9
  */
 @Inject("${liteflow}")
@@ -83,6 +86,21 @@ public class LiteflowProperty {
 	// 是否启用组件降级
 	private Boolean fallbackCmpEnable;
 
+    //全局线程池所用class路径
+    private String globalThreadPoolExecutorClass;
+
+    //全局线程池最大线程数
+    private Integer globalThreadPoolSize;
+
+    //全局线程池最大队列数
+    private Integer globalThreadPoolQueueSize;
+
+    // 异步线程池是否隔离
+    private Boolean whenThreadPoolIsolate;
+
+	//是否启用节点实例ID
+	private boolean enableNodeInstanceId;
+
 	public boolean isEnable() {
 		return enable;
 	}
@@ -267,4 +285,60 @@ public class LiteflowProperty {
 	public Boolean getFallbackCmpEnable() {
 		return fallbackCmpEnable;
 	}
+
+    public Integer getGlobalThreadPoolSize() {
+        if (ObjectUtil.isNull(globalThreadPoolSize)) {
+            return 16;
+        } else {
+            return globalThreadPoolSize;
+        }
+    }
+
+    public void setGlobalThreadPoolSize(Integer globalThreadPoolSize) {
+        this.globalThreadPoolSize = globalThreadPoolSize;
+    }
+
+    public Integer getGlobalThreadPoolQueueSize() {
+        if (ObjectUtil.isNull(globalThreadPoolQueueSize)) {
+            return 512;
+        } else {
+            return globalThreadPoolQueueSize;
+        }
+    }
+
+    public void setGlobalThreadPoolQueueSize(Integer globalThreadPoolQueueSize) {
+        this.globalThreadPoolQueueSize = globalThreadPoolQueueSize;
+    }
+
+    public String getGlobalThreadPoolExecutorClass() {
+        if (StrUtil.isBlank(globalThreadPoolExecutorClass)) {
+            return "com.yomahub.liteflow.thread.LiteFlowDefaultGlobalExecutorBuilder";
+        } else {
+            return globalThreadPoolExecutorClass;
+        }
+    }
+
+    public void setGlobalThreadPoolExecutorClass(String globalThreadPoolExecutorClass) {
+        this.globalThreadPoolExecutorClass = globalThreadPoolExecutorClass;
+    }
+
+    public Boolean getWhenThreadPoolIsolate() {
+        if (ObjectUtil.isNull(whenThreadPoolIsolate)) {
+            return Boolean.FALSE;
+        } else {
+            return whenThreadPoolIsolate;
+        }
+    }
+
+    public void setWhenThreadPoolIsolate(Boolean whenThreadPoolIsolate) {
+        this.whenThreadPoolIsolate = whenThreadPoolIsolate;
+    }
+
+	public boolean isEnableNodeInstanceId() {
+		return enableNodeInstanceId;
+	}
+
+	public void setEnableNodeInstanceId(boolean enableNodeInstanceId) {
+		this.enableNodeInstanceId = enableNodeInstanceId;
+	}
 }

+ 4 - 3
liteflow-solon-plugin/src/main/resources/META-INF/liteflow-default.properties

@@ -4,10 +4,7 @@ liteflow.slot-size=1024
 liteflow.main-executor-works=64
 liteflow.main-executor-class=com.yomahub.liteflow.thread.LiteFlowDefaultMainExecutorBuilder
 liteflow.request-id-generator-class=com.yomahub.liteflow.flow.id.DefaultRequestIdGenerator
-liteflow.thread-executor-class=com.yomahub.liteflow.thread.LiteFlowDefaultWhenExecutorBuilder
 liteflow.when-max-wait-seconds=15
-liteflow.when-max-workers=16
-liteflow.when-queue-limit=512
 liteflow.parse-on-start=true
 liteflow.retry-count=0
 liteflow.support-multiple-type=false
@@ -18,3 +15,7 @@ liteflow.monitor.queue-limit=200
 liteflow.monitor.delay=300000
 liteflow.monitor.period=300000
 liteflow.fallback-cmp-enable=false
+liteflow.global-thread-pool-size=16
+liteflow.global-thread-pool-queue-size=512
+liteflow.global-thread-pool-executor-class=com.yomahub.liteflow.thread.LiteFlowDefaultGlobalExecutorBuilder
+liteflow.enable-node-instance-id=true

+ 59 - 65
liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java

@@ -1,5 +1,7 @@
 package com.yomahub.liteflow.springboot;
 
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
 import com.yomahub.liteflow.enums.ParseModeEnum;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
@@ -10,6 +12,7 @@ import java.util.concurrent.TimeUnit;
  * 执行流程主要的参数类
  *
  * @author Bryan.Zhang
+ * @author jason
  */
 @ConfigurationProperties(prefix = "liteflow", ignoreUnknownFields = true)
 public class LiteflowProperty {
@@ -35,9 +38,6 @@ public class LiteflowProperty {
 	// FlowExecutor的execute2Future的自定义线程池
 	private String mainExecutorClass;
 
-	// 并行线程执行器class路径
-	private String threadExecutorClass;
-
 	// 异步线程最大等待描述
 	@Deprecated
 	private int whenMaxWaitSeconds;
@@ -46,12 +46,6 @@ public class LiteflowProperty {
 
 	private TimeUnit whenMaxWaitTimeUnit;
 
-	// 异步线程池最大线程数
-	private int whenMaxWorkers;
-
-	// 异步线程池最大队列数量
-	private int whenQueueLimit;
-
 	// 异步线程池是否隔离
 	private boolean whenThreadPoolIsolate;
 
@@ -80,14 +74,6 @@ public class LiteflowProperty {
 
 	// 规则文件/脚本文件变更监听
 	private boolean enableMonitorFile;
-
-	private String parallelLoopExecutorClass;
-
-	//使用默认并行循环线程池时,最大线程数
-	private int parallelMaxWorkers;
-
-	//使用默认并行循环线程池时,最大队列数
-	private int parallelQueueLimit;
 	
 	// 是否启用组件降级
 	private boolean fallbackCmpEnable;
@@ -101,6 +87,18 @@ public class LiteflowProperty {
 	//脚本特殊设置选项
 	private Map<String, String> scriptSetting;
 
+    //全局线程池所用class路径(when+异步循环)
+    private String globalThreadPoolExecutorClass;
+
+    //全局线程池最大线程数(when+异步循环)
+    private Integer globalThreadPoolSize;
+
+    //全局线程池最大队列数(when+异步循环)
+    private Integer globalThreadPoolQueueSize;
+
+	//是否启用节点实例ID
+	private boolean enableNodeInstanceId;
+
 	public boolean isEnableMonitorFile() {
 		return enableMonitorFile;
 	}
@@ -143,22 +141,6 @@ public class LiteflowProperty {
 		this.whenMaxWaitSeconds = whenMaxWaitSeconds;
 	}
 
-	public int getWhenMaxWorkers() {
-		return whenMaxWorkers;
-	}
-
-	public void setWhenMaxWorkers(int whenMaxWorkers) {
-		this.whenMaxWorkers = whenMaxWorkers;
-	}
-
-	public int getWhenQueueLimit() {
-		return whenQueueLimit;
-	}
-
-	public void setWhenQueueLimit(int whenQueueLimit) {
-		this.whenQueueLimit = whenQueueLimit;
-	}
-
 	public ParseModeEnum getParseMode() {
 		return parseMode;
 	}
@@ -193,14 +175,6 @@ public class LiteflowProperty {
 		this.printBanner = printBanner;
 	}
 
-	public String getThreadExecutorClass() {
-		return threadExecutorClass;
-	}
-
-	public void setThreadExecutorClass(String threadExecutorClass) {
-		this.threadExecutorClass = threadExecutorClass;
-	}
-
 	public String getNodeExecutorClass() {
 		return nodeExecutorClass;
 	}
@@ -273,30 +247,6 @@ public class LiteflowProperty {
 		this.whenMaxWaitTimeUnit = whenMaxWaitTimeUnit;
 	}
 
-	public String getParallelLoopExecutorClass() {
-		return parallelLoopExecutorClass;
-	}
-
-	public void setParallelLoopExecutorClass(String parallelLoopExecutorClass) {
-		this.parallelLoopExecutorClass = parallelLoopExecutorClass;
-	}
-
-	public int getParallelMaxWorkers() {
-		return parallelMaxWorkers;
-	}
-
-	public void setParallelMaxWorkers(int parallelMaxWorkers) {
-		this.parallelMaxWorkers = parallelMaxWorkers;
-	}
-
-	public int getParallelQueueLimit() {
-		return parallelQueueLimit;
-	}
-
-	public void setParallelQueueLimit(int parallelQueueLimit) {
-		this.parallelQueueLimit = parallelQueueLimit;
-	}
-
 	public boolean isFallbackCmpEnable() {
 		return fallbackCmpEnable;
 	}
@@ -336,4 +286,48 @@ public class LiteflowProperty {
 	public void setScriptSetting(Map<String, String> scriptSetting) {
 		this.scriptSetting = scriptSetting;
 	}
+
+    public Integer getGlobalThreadPoolSize() {
+        if (ObjectUtil.isNull(globalThreadPoolSize)) {
+            return 16;
+        } else {
+            return globalThreadPoolSize;
+        }
+    }
+
+    public void setGlobalThreadPoolSize(Integer globalThreadPoolSize) {
+        this.globalThreadPoolSize = globalThreadPoolSize;
+    }
+
+    public Integer getGlobalThreadPoolQueueSize() {
+        if (ObjectUtil.isNull(globalThreadPoolQueueSize)) {
+            return 512;
+        } else {
+            return globalThreadPoolQueueSize;
+        }
+    }
+
+    public void setGlobalThreadPoolQueueSize(Integer globalThreadPoolQueueSize) {
+        this.globalThreadPoolQueueSize = globalThreadPoolQueueSize;
+    }
+
+    public String getGlobalThreadPoolExecutorClass() {
+        if (StrUtil.isBlank(globalThreadPoolExecutorClass)) {
+            return "com.yomahub.liteflow.thread.LiteFlowDefaultGlobalExecutorBuilder";
+        } else {
+            return globalThreadPoolExecutorClass;
+        }
+    }
+
+    public void setGlobalThreadPoolExecutorClass(String globalThreadPoolExecutorClass) {
+        this.globalThreadPoolExecutorClass = globalThreadPoolExecutorClass;
+    }
+
+	public boolean isEnableNodeInstanceId() {
+		return enableNodeInstanceId;
+	}
+
+	public void setEnableNodeInstanceId(boolean enableNodeInstanceId) {
+		this.enableNodeInstanceId = enableNodeInstanceId;
+	}
 }

+ 5 - 6
liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/config/LiteflowPropertyAutoConfiguration.java

@@ -13,6 +13,7 @@ import org.springframework.context.annotation.PropertySource;
  * 同时这里设置了默认的参数路径,如果在springboot的application.properties/yml里没取到的话,就取默认值
  *
  * @author Bryan.Zhang
+ * @author jason
  */
 @Configuration
 @EnableConfigurationProperties({ LiteflowProperty.class, LiteflowMonitorProperty.class })
@@ -26,12 +27,9 @@ public class LiteflowPropertyAutoConfiguration {
 		liteflowConfig.setRuleSourceExtData(property.getRuleSourceExtData());
 		liteflowConfig.setRuleSourceExtDataMap(property.getRuleSourceExtDataMap());
 		liteflowConfig.setSlotSize(property.getSlotSize());
-		liteflowConfig.setThreadExecutorClass(property.getThreadExecutorClass());
 		liteflowConfig.setWhenMaxWaitSeconds(property.getWhenMaxWaitSeconds());
 		liteflowConfig.setWhenMaxWaitTime(property.getWhenMaxWaitTime());
 		liteflowConfig.setWhenMaxWaitTimeUnit(property.getWhenMaxWaitTimeUnit());
-		liteflowConfig.setWhenMaxWorkers(property.getWhenMaxWorkers());
-		liteflowConfig.setWhenQueueLimit(property.getWhenQueueLimit());
 		liteflowConfig.setWhenThreadPoolIsolate(property.isWhenThreadPoolIsolate());
 		liteflowConfig.setParseMode(property.getParseMode());
 		liteflowConfig.setEnable(property.isEnable());
@@ -44,9 +42,6 @@ public class LiteflowPropertyAutoConfiguration {
 		liteflowConfig.setMainExecutorClass(property.getMainExecutorClass());
 		liteflowConfig.setPrintExecutionLog(property.isPrintExecutionLog());
 		liteflowConfig.setEnableMonitorFile(property.isEnableMonitorFile());
-		liteflowConfig.setParallelMaxWorkers(property.getParallelMaxWorkers());
-		liteflowConfig.setParallelQueueLimit(property.getParallelQueueLimit());
-		liteflowConfig.setParallelLoopExecutorClass(property.getParallelLoopExecutorClass());
 		liteflowConfig.setFallbackCmpEnable(property.isFallbackCmpEnable());
 		liteflowConfig.setFastLoad(property.isFastLoad());
 		liteflowConfig.setEnableLog(liteflowMonitorProperty.isEnableLog());
@@ -54,6 +49,10 @@ public class LiteflowPropertyAutoConfiguration {
 		liteflowConfig.setDelay(liteflowMonitorProperty.getDelay());
 		liteflowConfig.setPeriod(liteflowMonitorProperty.getPeriod());
 		liteflowConfig.setScriptSetting(property.getScriptSetting());
+        liteflowConfig.setGlobalThreadPoolExecutorClass(property.getGlobalThreadPoolExecutorClass());
+        liteflowConfig.setGlobalThreadPoolQueueSize(property.getGlobalThreadPoolQueueSize());
+        liteflowConfig.setGlobalThreadPoolSize(property.getGlobalThreadPoolSize());
+		liteflowConfig.setEnableNodeInstanceId(property.isEnableNodeInstanceId());
 		return liteflowConfig;
 	}
 

+ 14 - 28
liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@@ -61,13 +61,6 @@
       "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
       "defaultValue": "com.yomahub.liteflow.thread.LiteFlowDefaultMainExecutorBuilder"
     },
-    {
-      "name": "liteflow.thread-executor-class",
-      "type": "java.lang.String",
-      "description": "Custom thread pool implement for when executor.",
-      "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
-      "defaultValue": "com.yomahub.liteflow.thread.LiteFlowDefaultWhenExecutorBuilder"
-    },
     {
       "name": "liteflow.when-max-wait-seconds",
       "type": "java.lang.Integer",
@@ -89,20 +82,6 @@
       "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
       "defaultValue": "MILLISECONDS"
     },
-    {
-      "name": "liteflow.when-max-workers",
-      "type": "java.lang.Integer",
-      "description": "Set the async thread pool worker max-size on \" when \" mode.",
-      "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
-      "defaultValue": 16
-    },
-    {
-      "name": "liteflow.when-queue-limit",
-      "type": "java.lang.Integer",
-      "description": "Set the async thread pool queue max-size on \" when \" mode.",
-      "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
-      "defaultValue": 512
-    },
     {
       "name": "liteflow.when-thread-pool-isolate",
       "type": "java.lang.Boolean",
@@ -195,31 +174,38 @@
       "defaultValue": false
     },
     {
-      "name": "liteflow.parallel-max-workers",
+      "name": "liteflow.global-thread-pool-size",
       "type": "java.lang.Integer",
-      "description": "Set the async thread pool worker max-size on \" parallel-loop \" mode.",
+      "description": "Set the global chain thread pool worker max-size.",
       "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
       "defaultValue": 16
     },
     {
-      "name": "liteflow.parallel-queue-limit",
+      "name": "liteflow.global-thread-pool-queue-size",
       "type": "java.lang.Integer",
-      "description": "Set the async thread pool queue max-size on \" parallel-loop \" mode.",
+      "description": "Set the global chain thread pool queue max-size ",
       "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
       "defaultValue": 512
     },
     {
-      "name": "liteflow.parallel-loop-executor-class",
+      "name": "liteflow.global-thread-pool-executor-class",
       "type": "java.lang.String",
-      "description": "Custom thread pool implement for parallel-loop executor.",
+      "description": "Custom the global chain thread pool implement for global chain executor.",
       "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
-      "defaultValue": "com.yomahub.liteflow.thread.LiteFlowDefaultParallelLoopExecutorBuilder"
+      "defaultValue": "com.yomahub.liteflow.thread.LiteFlowDefaultGlobalExecutorBuilder"
     },
     {
       "name": "liteflow.script-setting",
       "type": "java.util.Map",
       "description": "script special settings.",
       "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty"
+    },
+    {
+      "name": "liteflow.enable-node-instance-id",
+      "type": "java.lang.Boolean",
+      "description": "enable node instance id",
+      "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
+      "defaultValue": false
     }
   ]
 }

+ 4 - 6
liteflow-spring-boot-starter/src/main/resources/META-INF/liteflow-default.properties

@@ -4,11 +4,8 @@ liteflow.slot-size=1024
 liteflow.main-executor-works=64
 liteflow.main-executor-class=com.yomahub.liteflow.thread.LiteFlowDefaultMainExecutorBuilder
 liteflow.request-id-generator-class=com.yomahub.liteflow.flow.id.DefaultRequestIdGenerator
-liteflow.thread-executor-class=com.yomahub.liteflow.thread.LiteFlowDefaultWhenExecutorBuilder
 liteflow.when-max-wait-time=15000
 liteflow.when-max-wait-time-unit=MILLISECONDS
-liteflow.when-max-workers=16
-liteflow.when-queue-limit=512
 liteflow.when-thread-pool-isolate=false
 liteflow.parse-mode=PARSE_ALL_ON_START
 liteflow.retry-count=0
@@ -18,12 +15,13 @@ liteflow.print-execution-log=true
 liteflow.fallback-cmp-enable=false
 liteflow.fast-load=false
 liteflow.check-node-exists=true
-liteflow.parallel-max-workers=16
-liteflow.parallel-queue-limit=512
-liteflow.parallel-loop-executor-class=com.yomahub.liteflow.thread.LiteFlowDefaultParallelLoopExecutorBuilder
 liteflow.monitor.enable-log=false
 liteflow.monitor.queue-limit=200
 liteflow.monitor.delay=300000
 liteflow.monitor.period=300000
 liteflow.enable-monitor-file=false
+liteflow.global-thread-pool-size=16
+liteflow.global-thread-pool-queue-size=512
+liteflow.global-thread-pool-executor-class=com.yomahub.liteflow.thread.LiteFlowDefaultGlobalExecutorBuilder
+liteflow.enable-node-instance-id=false
 

+ 3 - 1
liteflow-testcase-el/.gitignore

@@ -80,4 +80,6 @@ atlassian-ide-plugin.xml
 /logs
 */logs
 
-.flattened-pom.xml
+.flattened-pom.xml
+
+.node_instance_id

+ 20 - 20
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/CatchELBuilderTest.java

@@ -25,51 +25,51 @@ public class CatchELBuilderTest extends BaseTest {
     public void testCatch1(){
         String expectedStr = "CATCH(THEN(node(\"a\"),node(\"b\"))).DO(node(\"c\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.catchException(ELBus.then("a", "b")).doOpt("c").toEL());
+                ELBus.catchException(ELBus.then(ELBus.node("a"), ELBus.node("b"))).doOpt(ELBus.node("c")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException(ELBus.then("a", "b")).doOpt("c").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException(ELBus.then(ELBus.node("a"), ELBus.node("b"))).doOpt(ELBus.node("c")).toEL()));
     }
     @Test
     public void testCatch2(){
         String expectedStr = "CATCH(\n\tTHEN(\n\t\tnode(\"a\"),\n\t\tnode(\"b\")\n\t)\n).DO(\n\tnode(\"c\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.catchException(ELBus.then("a", "b")).doOpt("c").toEL(true));
+                ELBus.catchException(ELBus.then(ELBus.node("a"), ELBus.node("b"))).doOpt(ELBus.node("c")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException(ELBus.then("a", "b")).doOpt("c").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException(ELBus.then(ELBus.node("a"), ELBus.node("b"))).doOpt(ELBus.node("c")).toEL(true)));
     }
     // 属性设置测试
     @Test
     public void testCatch3(){
         String expectedStr = "CATCH(node(\"a\")).DO(THEN(node(\"b\"),node(\"c\"))).id(\"this is a id\").tag(\"this is a tag\").maxWaitSeconds(3);";
         Assertions.assertEquals(expectedStr,
-                ELBus.catchException("a").doOpt(ELBus.then("b", "c")).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL());
+                ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException("a").doOpt(ELBus.then("b", "c")).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL()));
     }
     @Test
     public void testCatch4(){
         String expectedStr = "CATCH(\n\tnode(\"a\")\n).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t)\n).id(\"this is a id\").tag(\"this is a tag\").maxWaitSeconds(3);";
         Assertions.assertEquals(expectedStr,
-                ELBus.catchException("a").doOpt(ELBus.then("b", "c")).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL(true));
+                ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException("a").doOpt(ELBus.then("b", "c")).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL(true)));
     }
     // data 设置 jsonStr
     @Test
     public void testCatch5(){
         String expectedStr = "catchData = '{\"name\":\"zhangsan\",\"age\":18}';\nCATCH(node(\"a\")).DO(THEN(node(\"b\"),node(\"c\").data(catchData)));";
         Assertions.assertEquals(expectedStr,
-                ELBus.catchException("a").doOpt(ELBus.then("b", ELBus.node("c").data("catchData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL());
+                ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("catchData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException("a").doOpt(ELBus.then("b", ELBus.node("c").data("catchData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("catchData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL()));
     }
     @Test
     public void testCatch6(){
         String expectedStr = "catchData = '{\"name\":\"zhangsan\",\"age\":18}';\nCATCH(\n\tnode(\"a\")\n).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(catchData)\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.catchException("a").doOpt(ELBus.then("b", ELBus.node("c").data("catchData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL(true));
+                ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("catchData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException("a").doOpt(ELBus.then("b", ELBus.node("c").data("catchData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("catchData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL(true)));
    }
     // data 设置 map
     @Test
@@ -79,9 +79,9 @@ public class CatchELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         String expectedStr = "catchData = '{\"name\":\"zhangsan\",\"age\":18}';\nCATCH(node(\"a\")).DO(THEN(node(\"b\"),node(\"c\").data(catchData)));";
         Assertions.assertEquals(expectedStr,
-                ELBus.catchException("a").doOpt(ELBus.then("b", ELBus.node("c").data("catchData", name2Value))).toEL());
+                ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("catchData", name2Value))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException("a").doOpt(ELBus.then("b", ELBus.node("c").data("catchData", name2Value))).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("catchData", name2Value))).toEL()));
     }
     @Test
     public void testCatch8(){
@@ -90,9 +90,9 @@ public class CatchELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         String expectedStr = "catchData = '{\"name\":\"zhangsan\",\"age\":18}';\nCATCH(\n\tnode(\"a\")\n).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(catchData)\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.catchException("a").doOpt(ELBus.then("b", ELBus.node("c").data("catchData", name2Value))).toEL(true));
+                ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("catchData", name2Value))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException("a").doOpt(ELBus.then("b", ELBus.node("c").data("catchData", name2Value))).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("catchData", name2Value))).toEL(true)));
     }
     private static class ParamClass{
         private String name;
@@ -112,9 +112,9 @@ public class CatchELBuilderTest extends BaseTest {
         name2Value.age = 18;
         String expectedStr = "catchData = '{\"name\":\"zhangsan\",\"age\":18}';\nCATCH(node(\"a\")).DO(THEN(node(\"b\"),node(\"c\").data(catchData)));";
         Assertions.assertEquals(expectedStr,
-                ELBus.catchException("a").doOpt(ELBus.then("b", ELBus.node("c").data("catchData", name2Value))).toEL());
+                ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("catchData", name2Value))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException("a").doOpt(ELBus.then("b", ELBus.node("c").data("catchData", name2Value))).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("catchData", name2Value))).toEL()));
     }
     @Test
     public void testCatch10(){
@@ -123,8 +123,8 @@ public class CatchELBuilderTest extends BaseTest {
         name2Value.age = 18;
         String expectedStr = "catchData = '{\"name\":\"zhangsan\",\"age\":18}';\nCATCH(\n\tnode(\"a\")\n).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(catchData)\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.catchException("a").doOpt(ELBus.then("b", ELBus.node("c").data("catchData", name2Value))).toEL(true));
+                ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("catchData", name2Value))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException("a").doOpt(ELBus.then("b", ELBus.node("c").data("catchData", name2Value))).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.catchException(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("catchData", name2Value))).toEL(true)));
     }
 }

+ 13 - 15
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/ComplexELBuilderTest.java

@@ -8,7 +8,6 @@ import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
 import com.yomahub.liteflow.builder.el.ThenELWrapper;
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.enums.NodeTypeEnum;
-import com.yomahub.liteflow.flow.FlowBus;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
@@ -22,7 +21,6 @@ import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.context.annotation.ComponentScan;
 
 import javax.annotation.Resource;
-import java.util.Date;
 
 /**
  * 复杂编排例子测试
@@ -61,17 +59,17 @@ public class ComplexELBuilderTest extends BaseTest {
         ThenELWrapper complexEl1 = ELBus.then(
                 ELBus.node("A"),
                 ELBus.when(
-                        ELBus.then("B", "C"),
-                        ELBus.then(ELBus.node("D")).then("E").then("F"),
+                        ELBus.then(ELBus.node("B"), ELBus.node("C")),
+                        ELBus.then(ELBus.node("D")).then(ELBus.node("E")).then(ELBus.node("F")),
                         ELBus.then(
-                                ELBus.switchOpt("G").to(
-                                        ELBus.then("H", ELBus.node("I"), ELBus.when("J").when("K")).id("t1"),
-                                        ELBus.then("L", "M").id("t2")
+                                ELBus.switchOpt(ELBus.node("G")).to(
+                                        ELBus.then(ELBus.node("H"), ELBus.node("I"), ELBus.when(ELBus.node("J")).when(ELBus.node("K"))).id("t1"),
+                                        ELBus.then(ELBus.node("L"), ELBus.node("M")).id("t2")
                                 ),
-                                "N"
+                                ELBus.node("N")
                         )
                 ),
-                "Z"
+                ELBus.node("Z")
         );
         String expectedStr = "THEN(node(\"A\"),WHEN(THEN(node(\"B\"),node(\"C\")),THEN(node(\"D\"),node(\"E\"),node(\"F\")),THEN(SWITCH(node(\"G\")).TO(THEN(node(\"H\"),node(\"I\"),WHEN(node(\"J\"),node(\"K\"))).id(\"t1\"),THEN(node(\"L\"),node(\"M\")).id(\"t2\")),node(\"N\"))),node(\"Z\"));";
         Assertions.assertEquals(expectedStr,
@@ -110,18 +108,18 @@ public class ComplexELBuilderTest extends BaseTest {
         ThenELWrapper complexEl2 = ELBus.then(
                 ELBus.node("A"),
                 ELBus.switchOpt(ELBus.node("B")).to(
-                        ELBus.then("D","E").then(ELBus.node("F")).id("t1"),
+                        ELBus.then(ELBus.node("D"),ELBus.node("E")).then(ELBus.node("F")).id("t1"),
                         ELBus.then(
                                 ELBus.node("C"),
                                 ELBus.when(
                                         ELBus.then(
-                                                ELBus.switchOpt("G").to(
-                                                        ELBus.then("H", "I").id("t2"),
-                                                        "J"
+                                                ELBus.switchOpt(ELBus.node("G")).to(
+                                                        ELBus.then(ELBus.node("H"), ELBus.node("I")).id("t2"),
+                                                        ELBus.node("J")
                                                 ),
-                                                "K"
+                                                ELBus.node("K")
                                         ),
-                                        ELBus.then("L", "M")
+                                        ELBus.then(ELBus.node("L"), ELBus.node("M"))
                                 )
                         ).id("t3")
                 ),

+ 72 - 72
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/IfELBuilderTest.java

@@ -25,222 +25,222 @@ public class IfELBuilderTest extends BaseTest {
     public void testIf1(){
         String expectedStr = "IF(node(\"a\"),THEN(node(\"c\"),node(\"d\")),WHEN(node(\"e\"),node(\"f\")));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", ELBus.then("c", "d"), ELBus.when("e", "f")).toEL());
+                ELBus.ifOpt(ELBus.node("a"), ELBus.then(ELBus.node("c"), ELBus.node("d")), ELBus.when(ELBus.node("e"), ELBus.node("f"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", ELBus.then("c", "d"), ELBus.when("e", "f")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.then(ELBus.node("c"), ELBus.node("d")), ELBus.when(ELBus.node("e"), ELBus.node("f"))).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testIf2(){
         String expectedStr = "IF(\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"c\"),\n\t\tnode(\"d\")\n\t),\n\tWHEN(\n\t\tnode(\"e\"),\n\t\tnode(\"f\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.node("a"), ELBus.then("c", "d"), ELBus.when("e", "f")).toEL(true));
+                ELBus.ifOpt(ELBus.node("a"), ELBus.then(ELBus.node("c"), ELBus.node("d")), ELBus.when(ELBus.node("e"), ELBus.node("f"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.then("c", "d"), ELBus.when("e", "f")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.then(ELBus.node("c"), ELBus.node("d")), ELBus.when(ELBus.node("e"), ELBus.node("f"))).toEL(true)));
     }
     // If二元函数测试
     @Test
     public void testIf3(){
         String expectedStr = "IF(node(\"a\"),THEN(node(\"b\"),node(\"c\"))).ELSE(WHEN(node(\"c\"),node(\"d\")));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.node("a"), ELBus.then("b", "c")).elseOpt(ELBus.when("c", "d")).toEL());
+                ELBus.ifOpt(ELBus.node("a"), ELBus.then(ELBus.node("b"), ELBus.node("c"))).elseOpt(ELBus.when(ELBus.node("c"), ELBus.node("d"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.then("b", "c")).elseOpt(ELBus.when("c", "d")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.then(ELBus.node("b"), ELBus.node("c"))).elseOpt(ELBus.when(ELBus.node("c"), ELBus.node("d"))).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testIf4(){
         String expectedStr = "IF(\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t)\n).ELSE(\n\tWHEN(\n\t\tnode(\"c\"),\n\t\tnode(\"d\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", ELBus.then("b", "c")).elseOpt(ELBus.when("c", "d")).toEL(true));
+                ELBus.ifOpt(ELBus.node("a"), ELBus.then(ELBus.node("b"), ELBus.node("c"))).elseOpt(ELBus.when(ELBus.node("c"), ELBus.node("d"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", ELBus.then("b", "c")).elseOpt(ELBus.when("c", "d")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.then(ELBus.node("b"), ELBus.node("c"))).elseOpt(ELBus.when(ELBus.node("c"), ELBus.node("d"))).toEL(true)));
     }
     // ELIF调用测试
     @Test
     public void testIf5(){
         String expectedStr = "IF(node(\"a\"),node(\"b\")).ELIF(node(\"f1\"),node(\"c\")).ELIF(node(\"f2\"),node(\"d\")).ELSE(node(\"e\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b").elIfOpt("f1", "c").elIfOpt("f2","d").elseOpt("e").toEL());
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b")).elIfOpt(ELBus.node("f1"), ELBus.node("c")).elIfOpt(ELBus.node("f2"),ELBus.node("d")).elseOpt(ELBus.node("e")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b").elIfOpt("f1", "c").elIfOpt("f2","d").elseOpt("e").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b")).elIfOpt(ELBus.node("f1"), ELBus.node("c")).elIfOpt(ELBus.node("f2"),ELBus.node("d")).elseOpt(ELBus.node("e")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testIf6(){
         String expectedStr = "IF(\n\tnode(\"a\"),\n\tnode(\"b\")\n).ELIF(\n\tnode(\"f1\"),\n\tnode(\"c\")\n).ELIF(\n\tnode(\"f2\"),\n\tnode(\"d\")\n).ELSE(\n\tnode(\"e\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b").elIfOpt("f1", "c").elIfOpt("f2","d").elseOpt("e").toEL(true));
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b")).elIfOpt(ELBus.node("f1"), ELBus.node("c")).elIfOpt(ELBus.node("f2"),ELBus.node("d")).elseOpt(ELBus.node("e")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b").elIfOpt("f1", "c").elIfOpt("f2","d").elseOpt("e").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b")).elIfOpt(ELBus.node("f1"), ELBus.node("c")).elIfOpt(ELBus.node("f2"),ELBus.node("d")).elseOpt(ELBus.node("e")).toEL(true)));
     }
     // IF嵌套调用测试
     @Test
     public void testIf7(){
         String expectedStr = "IF(node(\"a\"),node(\"b\"),IF(node(\"c\"),node(\"d\")).ELSE(node(\"e\")));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b", ELBus.ifOpt("c", "d").elseOpt("e")).toEL());
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.ifOpt(ELBus.node("c"), ELBus.node("d")).elseOpt(ELBus.node("e"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b", ELBus.ifOpt("c", "d").elseOpt("e")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.ifOpt(ELBus.node("c"), ELBus.node("d")).elseOpt(ELBus.node("e"))).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testIf8(){
         String expectedStr = "IF(\n\tnode(\"a\"),\n\tnode(\"b\"),\n\tIF(\n\t\tnode(\"c\"),\n\t\tnode(\"d\")\n\t).ELSE(\n\t\tnode(\"e\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b", ELBus.ifOpt("c", "d").elseOpt("e")).toEL(true));
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.ifOpt(ELBus.node("c"), ELBus.node("d")).elseOpt(ELBus.node("e"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b", ELBus.ifOpt("c", "d").elseOpt("e")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.ifOpt(ELBus.node("c"), ELBus.node("d")).elseOpt(ELBus.node("e"))).toEL(true)));
     }
     // IF嵌套调用测试
     @Test
     public void testIf9(){
         String expectedStr = "IF(node(\"a\"),node(\"b\")).ELSE(IF(node(\"c\"),node(\"d\"),node(\"e\")));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b").elseOpt(ELBus.ifOpt("c", "d", "e")).toEL());
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b")).elseOpt(ELBus.ifOpt(ELBus.node("c"), ELBus.node("d"), ELBus.node("e"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b").elseOpt(ELBus.ifOpt("c", "d", "e")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b")).elseOpt(ELBus.ifOpt(ELBus.node("c"), ELBus.node("d"), ELBus.node("e"))).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testIf10(){
         String expectedStr = "IF(\n\tnode(\"a\"),\n\tnode(\"b\")\n).ELSE(\n\tIF(\n\t\tnode(\"c\"),\n\t\tnode(\"d\"),\n\t\tnode(\"e\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b").elseOpt(ELBus.ifOpt("c", "d", "e")).toEL(true));
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b")).elseOpt(ELBus.ifOpt(ELBus.node("c"), ELBus.node("d"), ELBus.node("e"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b").elseOpt(ELBus.ifOpt("c", "d", "e")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b")).elseOpt(ELBus.ifOpt(ELBus.node("c"), ELBus.node("d"), ELBus.node("e"))).toEL(true)));
     }
     // 与表达式输出测试
     @Test
     public void testIf11(){
         String expectedStr = "IF(AND(node(\"a\"),node(\"b\"),node(\"c\")),node(\"d\"),node(\"e\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.and("a", "b", "c"), "d", "e").toEL());
+                ELBus.ifOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d"), ELBus.node("e")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.and("a", "b", "c"), "d", "e").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d"), ELBus.node("e")).toEL()));
         expectedStr = "IF(AND(node(\"a\"),node(\"b\"),node(\"c\")),node(\"d\")).ELSE(node(\"e\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.and("a", "b", "c"), "d").elseOpt("e").toEL());
+                ELBus.ifOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elseOpt(ELBus.node("e")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.and("a", "b", "c"), "d").elseOpt("e").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elseOpt(ELBus.node("e")).toEL()));
         expectedStr = "IF(AND(node(\"a\"),node(\"b\"),node(\"c\")),node(\"d\")).ELIF(AND(node(\"f1\"),node(\"f2\")),node(\"e\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.and("a", "b", "c"), "d").elIfOpt(ELBus.and("f1", "f2"), "e").toEL());
+                ELBus.ifOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elIfOpt(ELBus.and(ELBus.node("f1"), ELBus.node("f2")), ELBus.node("e")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.and("a", "b", "c"), "d").elIfOpt(ELBus.and("f1", "f2"), "e").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elIfOpt(ELBus.and(ELBus.node("f1"), ELBus.node("f2")), ELBus.node("e")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testIf12(){
         String expectedStr = "IF(\n\tAND(\n\t\tnode(\"a\"),\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\"),\n\tnode(\"e\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.and("a", "b", "c"), "d", "e").toEL(true));
+                ELBus.ifOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d"), ELBus.node("e")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.and("a", "b", "c"), "d", "e").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d"), ELBus.node("e")).toEL(true)));
         expectedStr = "IF(\n\tAND(\n\t\tnode(\"a\"),\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n).ELSE(\n\tnode(\"e\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.and("a", "b", "c"), "d").elseOpt("e").toEL(true));
+                ELBus.ifOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elseOpt(ELBus.node("e")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.and("a", "b", "c"), "d").elseOpt("e").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elseOpt(ELBus.node("e")).toEL(true)));
         expectedStr = "IF(\n\tAND(\n\t\tnode(\"a\"),\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n).ELIF(\n\tAND(\n\t\tnode(\"f1\"),\n\t\tnode(\"f2\")\n\t),\n\tnode(\"e\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.and("a", "b", "c"), "d").elIfOpt(ELBus.and("f1", "f2"), "e").toEL(true));
+                ELBus.ifOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elIfOpt(ELBus.and(ELBus.node("f1"), ELBus.node("f2")), ELBus.node("e")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.and("a", "b", "c"), "d").elIfOpt(ELBus.and("f1", "f2"), "e").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elIfOpt(ELBus.and(ELBus.node("f1"), ELBus.node("f2")), ELBus.node("e")).toEL(true)));
     }
     // 或表达式测试
     @Test
     public void testIf13(){
         String expectedStr = "IF(OR(node(\"a\"),node(\"b\"),node(\"c\")),node(\"d\"),node(\"e\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.or("a", "b", "c"), "d", "e").toEL());
+                ELBus.ifOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d"), ELBus.node("e")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.or("a", "b", "c"), "d", "e").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d"), ELBus.node("e")).toEL()));
         expectedStr = "IF(OR(node(\"a\"),node(\"b\"),node(\"c\")),node(\"d\")).ELSE(node(\"e\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.or("a", "b", "c"), "d").elseOpt("e").toEL());
+                ELBus.ifOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elseOpt(ELBus.node("e")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.or("a", "b", "c"), "d").elseOpt("e").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elseOpt(ELBus.node("e")).toEL()));
         expectedStr = "IF(OR(node(\"a\"),node(\"b\"),node(\"c\")),node(\"d\")).ELIF(OR(node(\"f1\"),node(\"f2\")),node(\"e\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.or("a", "b", "c"), "d").elIfOpt(ELBus.or("f1", "f2"), "e").toEL());
+                ELBus.ifOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elIfOpt(ELBus.or(ELBus.node("f1"), ELBus.node("f2")), ELBus.node("e")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.or("a", "b", "c"), "d").elIfOpt(ELBus.or("f1", "f2"), "e").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elIfOpt(ELBus.or(ELBus.node("f1"), ELBus.node("f2")), ELBus.node("e")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testIf14(){
         String expectedStr = "IF(\n\tOR(\n\t\tnode(\"a\"),\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\"),\n\tnode(\"e\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.or("a", "b", "c"), "d", "e").toEL(true));
+                ELBus.ifOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d"), ELBus.node("e")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.or("a", "b", "c"), "d", "e").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d"), ELBus.node("e")).toEL(true)));
         expectedStr = "IF(\n\tOR(\n\t\tnode(\"a\"),\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n).ELSE(\n\tnode(\"e\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.or("a", "b", "c"), "d").elseOpt("e").toEL(true));
+                ELBus.ifOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elseOpt(ELBus.node("e")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.or("a", "b", "c"), "d").elseOpt("e").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elseOpt(ELBus.node("e")).toEL(true)));
         expectedStr = "IF(\n\tOR(\n\t\tnode(\"a\"),\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n).ELIF(\n\tOR(\n\t\tnode(\"f1\"),\n\t\tnode(\"f2\")\n\t),\n\tnode(\"e\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.or("a", "b", "c"), "d").elIfOpt(ELBus.or("f1", "f2"), "e").toEL(true));
+                ELBus.ifOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elIfOpt(ELBus.or(ELBus.node("f1"), ELBus.node("f2")), ELBus.node("e")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.or("a", "b", "c"), "d").elIfOpt(ELBus.or("f1", "f2"), "e").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")), ELBus.node("d")).elIfOpt(ELBus.or(ELBus.node("f1"), ELBus.node("f2")), ELBus.node("e")).toEL(true)));
     }
     // 非表达式测试
     @Test
     public void testIf15(){
         String expectedStr = "IF(NOT(node(\"a\")),node(\"b\"),node(\"c\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.not("a"), "b", "c").toEL());
+                ELBus.ifOpt(ELBus.not(ELBus.node("a")), ELBus.node("b"), ELBus.node("c")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.not("a"), "b", "c").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.not(ELBus.node("a")), ELBus.node("b"), ELBus.node("c")).toEL()));
         expectedStr = "IF(NOT(node(\"a\")),node(\"b\")).ELSE(node(\"c\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.not("a"), "b").elseOpt("c").toEL());
+                ELBus.ifOpt(ELBus.not(ELBus.node("a")), ELBus.node("b")).elseOpt(ELBus.node("c")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.not("a"), "b").elseOpt("c").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.not(ELBus.node("a")), ELBus.node("b")).elseOpt(ELBus.node("c")).toEL()));
         expectedStr = "IF(NOT(node(\"a\")),node(\"b\")).ELIF(NOT(node(\"f\")),node(\"c\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.not("a"), "b").elIfOpt(ELBus.not("f"), "c").toEL());
+                ELBus.ifOpt(ELBus.not(ELBus.node("a")), ELBus.node("b")).elIfOpt(ELBus.not(ELBus.node("f")), ELBus.node("c")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.not("a"), "b").elIfOpt(ELBus.not("f"), "c").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.not(ELBus.node("a")), ELBus.node("b")).elIfOpt(ELBus.not(ELBus.node("f")), ELBus.node("c")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testIf16(){
         String expectedStr = "IF(\n\tNOT(\n\t\tnode(\"a\")\n\t),\n\tnode(\"b\"),\n\tnode(\"c\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.not("a"), "b", "c").toEL(true));
+                ELBus.ifOpt(ELBus.not(ELBus.node("a")), ELBus.node("b"), ELBus.node("c")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.not("a"), "b", "c").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.not(ELBus.node("a")), ELBus.node("b"), ELBus.node("c")).toEL(true)));
         expectedStr = "IF(\n\tNOT(\n\t\tnode(\"a\")\n\t),\n\tnode(\"b\")\n).ELSE(\n\tnode(\"c\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.not("a"), "b").elseOpt("c").toEL(true));
+                ELBus.ifOpt(ELBus.not(ELBus.node("a")), ELBus.node("b")).elseOpt(ELBus.node("c")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.not("a"), "b").elseOpt("c").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.not(ELBus.node("a")), ELBus.node("b")).elseOpt(ELBus.node("c")).toEL(true)));
         expectedStr = "IF(\n\tNOT(\n\t\tnode(\"a\")\n\t),\n\tnode(\"b\")\n).ELIF(\n\tNOT(\n\t\tnode(\"f\")\n\t),\n\tnode(\"c\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt(ELBus.not("a"), "b").elIfOpt(ELBus.not("f"), "c").toEL(true));
+                ELBus.ifOpt(ELBus.not(ELBus.node("a")), ELBus.node("b")).elIfOpt(ELBus.not(ELBus.node("f")), ELBus.node("c")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.not("a"), "b").elIfOpt(ELBus.not("f"), "c").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.not(ELBus.node("a")), ELBus.node("b")).elIfOpt(ELBus.not(ELBus.node("f")), ELBus.node("c")).toEL(true)));
     }
     // 属性测试
     @Test
     public void testIf17(){
         String expectedStr = "IF(node(\"a\"),node(\"b\"),node(\"c\")).id(\"this is a id\").tag(\"this is a tag\").maxWaitSeconds(6);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b", "c").id("this is a id").tag("this is a tag").maxWaitSeconds(6).toEL());
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")).id("this is a id").tag("this is a tag").maxWaitSeconds(6).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b", "c").id("this is a id").tag("this is a tag").maxWaitSeconds(6).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")).id("this is a id").tag("this is a tag").maxWaitSeconds(6).toEL()));
     }
     // 格式化输出
     @Test
     public void testIf18(){
         String expectedStr = "IF(\n\tnode(\"a\"),\n\tnode(\"b\"),\n\tnode(\"c\")\n).id(\"this is a id\").tag(\"this is a tag\").maxWaitSeconds(6);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b", "c").id("this is a id").tag("this is a tag").maxWaitSeconds(6).toEL(true));
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")).id("this is a id").tag("this is a tag").maxWaitSeconds(6).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b", "c").id("this is a id").tag("this is a tag").maxWaitSeconds(6).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")).id("this is a id").tag("this is a tag").maxWaitSeconds(6).toEL(true)));
     }
     // data map 测试
     @Test
@@ -250,9 +250,9 @@ public class IfELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         String expectedStr = "ifData = '{\"name\":\"zhangsan\",\"age\":18}';\nIF(node(\"a\"),node(\"b\"),node(\"c\").data(ifData));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b", ELBus.node("c").data("ifData", name2Value)).toEL());
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c").data("ifData", name2Value)).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b", ELBus.node("c").data("ifData", name2Value)).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c").data("ifData", name2Value)).toEL()));
     }
     // 格式化输出
     @Test
@@ -262,27 +262,27 @@ public class IfELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         String expectedStr = "ifData = '{\"name\":\"zhangsan\",\"age\":18}';\nIF(\n\tnode(\"a\"),\n\tnode(\"b\"),\n\tnode(\"c\").data(ifData)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b", ELBus.node("c").data("ifData", name2Value)).toEL(true));
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c").data("ifData", name2Value)).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b", ELBus.node("c").data("ifData", name2Value)).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c").data("ifData", name2Value)).toEL(true)));
     }
     // data JsonStr 测试
     @Test
     public void testIf21(){
         String expectedStr = "ifData = '{\"name\":\"zhangsan\",\"age\":18}';\nIF(node(\"a\"),node(\"b\"),node(\"c\").data(ifData));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b", ELBus.node("c").data("ifData", "{\"name\":\"zhangsan\",\"age\":18}")).toEL());
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c").data("ifData", "{\"name\":\"zhangsan\",\"age\":18}")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b", ELBus.node("c").data("ifData", "{\"name\":\"zhangsan\",\"age\":18}")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c").data("ifData", "{\"name\":\"zhangsan\",\"age\":18}")).toEL()));
     }
     // 格式化输出
     @Test
     public void testIf22(){
         String expectedStr = "ifData = '{\"name\":\"zhangsan\",\"age\":18}';\nIF(\n\tnode(\"a\"),\n\tnode(\"b\"),\n\tnode(\"c\").data(ifData)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b", ELBus.node("c").data("ifData", "{\"name\":\"zhangsan\",\"age\":18}")).toEL(true));
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c").data("ifData", "{\"name\":\"zhangsan\",\"age\":18}")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b", ELBus.node("c").data("ifData", "{\"name\":\"zhangsan\",\"age\":18}")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c").data("ifData", "{\"name\":\"zhangsan\",\"age\":18}")).toEL(true)));
     }
     private static class ParamClass{
         private String name;
@@ -302,9 +302,9 @@ public class IfELBuilderTest extends BaseTest {
         name2Value.age = 18;
         String expectedStr = "ifData = '{\"name\":\"zhangsan\",\"age\":18}';\nIF(node(\"a\"),node(\"b\"),node(\"c\").data(ifData));";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b", ELBus.node("c").data("ifData", name2Value)).toEL());
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c").data("ifData", name2Value)).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b", ELBus.node("c").data("ifData", name2Value)).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c").data("ifData", name2Value)).toEL()));
     }
     // 格式化输出
     @Test
@@ -314,9 +314,9 @@ public class IfELBuilderTest extends BaseTest {
         name2Value.age = 18;
         String expectedStr = "ifData = '{\"name\":\"zhangsan\",\"age\":18}';\nIF(\n\tnode(\"a\"),\n\tnode(\"b\"),\n\tnode(\"c\").data(ifData)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ifOpt("a", "b", ELBus.node("c").data("ifData", name2Value)).toEL(true));
+                ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c").data("ifData", name2Value)).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt("a", "b", ELBus.node("c").data("ifData", name2Value)).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ifOpt(ELBus.node("a"), ELBus.node("b"), ELBus.node("c").data("ifData", name2Value)).toEL(true)));
     }
 
 }

+ 35 - 35
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/LogicELBuilderTest.java

@@ -24,68 +24,68 @@ public class LogicELBuilderTest extends BaseTest {
     public void testlogic1(){
         String expectedStr = "AND(node(\"a\"),OR(node(\"b\"),node(\"c\")),NOT(node(\"d\")));";
         Assertions.assertEquals(expectedStr,
-                ELBus.and("a", ELBus.or("b", "c"), ELBus.not("d")).toEL());
+                ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and("a", ELBus.or("b", "c"), ELBus.not("d")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d"))).toEL()));
     }
     @Test
     public void testlogic2(){
         String expectedStr = "AND(\n\tnode(\"a\"),\n\tOR(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tNOT(\n\t\tnode(\"d\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.and("a", ELBus.or("b", "c"), ELBus.not("d")).toEL(true));
+                ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and("a", ELBus.or("b", "c"), ELBus.not("d")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d"))).toEL(true)));
     }
 
     @Test
     public void testlogic3(){
         String expectedStr = "AND(node(\"a\"),OR(node(\"b\"),node(\"c\")),NOT(node(\"d\")));";
         Assertions.assertEquals(expectedStr,
-                ELBus.and("a").and(ELBus.or("b").or("c")).and(ELBus.not("d")).toEL());
+                ELBus.and(ELBus.node("a")).and(ELBus.or(ELBus.node("b")).or(ELBus.node("c"))).and(ELBus.not(ELBus.node("d"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and("a").and(ELBus.or("b").or("c")).and(ELBus.not("d")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and(ELBus.node("a")).and(ELBus.or(ELBus.node("b")).or(ELBus.node("c"))).and(ELBus.not(ELBus.node("d"))).toEL()));
     }
 
     @Test
     public void testlogic4(){
         String expectedStr = "AND(\n\tnode(\"a\"),\n\tOR(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tNOT(\n\t\tnode(\"d\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.and("a").and(ELBus.or("b").or("c")).and(ELBus.not("d")).toEL(true));
+                ELBus.and(ELBus.node("a")).and(ELBus.or(ELBus.node("b")).or(ELBus.node("c"))).and(ELBus.not(ELBus.node("d"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and("a").and(ELBus.or("b").or("c")).and(ELBus.not("d")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and(ELBus.node("a")).and(ELBus.or(ELBus.node("b")).or(ELBus.node("c"))).and(ELBus.not(ELBus.node("d"))).toEL(true)));
     }
     // 属性设置
     @Test
     public void testlogic5(){
         String expectedStr = "AND(node(\"a\"),OR(node(\"b\"),node(\"c\")).id(\"this is a id\"),NOT(node(\"d\")).tag(\"this is a tag\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.and("a", ELBus.or("b", "c").id("this is a id"), ELBus.not("d").tag("this is a tag")).toEL());
+                ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")).id("this is a id"), ELBus.not(ELBus.node("d")).tag("this is a tag")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and("a", ELBus.or("b", "c").id("this is a id"), ELBus.not("d").tag("this is a tag")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")).id("this is a id"), ELBus.not(ELBus.node("d")).tag("this is a tag")).toEL()));
     }
     @Test
     public void testlogic6(){
         String expectedStr = "AND(\n\tnode(\"a\"),\n\tOR(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tNOT(\n\t\tnode(\"d\")\n\t).tag(\"this is a tag\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.and("a", ELBus.or("b", "c").id("this is a id"), ELBus.not("d").tag("this is a tag")).toEL(true));
+                ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")).id("this is a id"), ELBus.not(ELBus.node("d")).tag("this is a tag")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and("a", ELBus.or("b", "c").id("this is a id"), ELBus.not("d").tag("this is a tag")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")).id("this is a id"), ELBus.not(ELBus.node("d")).tag("this is a tag")).toEL(true)));
     }
     @Test
     public void testlogic7(){
         String expectedStr = "andData = '{\"name\":\"zhangsan\",\"age\":18}';\nAND(node(\"a\"),OR(node(\"b\"),node(\"c\")),NOT(node(\"d\").data(andData)));";
         Assertions.assertEquals(expectedStr,
-                ELBus.and("a", ELBus.or("b", "c"), ELBus.not(ELBus.node("d").data("andData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL());
+                ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d").data("andData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and("a", ELBus.or("b", "c"), ELBus.not(ELBus.node("d").data("andData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d").data("andData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL()));
     }
     @Test
     public void testlogic8(){
         String expectedStr = "andData = '{\"name\":\"zhangsan\",\"age\":18}';\nAND(\n\tnode(\"a\"),\n\tOR(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tNOT(\n\t\tnode(\"d\").data(andData)\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.and("a", ELBus.or("b", "c"), ELBus.not(ELBus.node("d").data("andData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL(true));
+                ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d").data("andData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and("a", ELBus.or("b", "c"), ELBus.not(ELBus.node("d").data("andData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d").data("andData", "{\"name\":\"zhangsan\",\"age\":18}"))).toEL(true)));
     }
     @Test
     public void testlogic9(){
@@ -94,9 +94,9 @@ public class LogicELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         String expectedStr = "orData = '{\"name\":\"zhangsan\",\"age\":18}';\nAND(node(\"a\"),OR(node(\"b\"),node(\"c\")),NOT(node(\"d\").data(orData)));";
         Assertions.assertEquals(expectedStr,
-                ELBus.and("a", ELBus.or("b", "c"), ELBus.not(ELBus.node("d").data("orData", name2Value))).toEL());
+                ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d").data("orData", name2Value))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and("a", ELBus.or("b", "c"), ELBus.not(ELBus.node("d").data("orData", name2Value))).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d").data("orData", name2Value))).toEL()));
     }
     @Test
     public void testlogic10(){
@@ -105,9 +105,9 @@ public class LogicELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         String expectedStr = "orData = '{\"name\":\"zhangsan\",\"age\":18}';\nAND(\n\tnode(\"a\"),\n\tOR(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tNOT(\n\t\tnode(\"d\").data(orData)\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.and("a", ELBus.or("b", "c"), ELBus.not(ELBus.node("d").data("orData", name2Value))).toEL(true));
+                ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d").data("orData", name2Value))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and("a", ELBus.or("b", "c"), ELBus.not(ELBus.node("d").data("orData", name2Value))).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d").data("orData", name2Value))).toEL(true)));
     }
     private static class ParamClass{
         private String name;
@@ -126,9 +126,9 @@ public class LogicELBuilderTest extends BaseTest {
         name2Value.age = 18;
         String expectedStr = "notData = '{\"name\":\"zhangsan\",\"age\":18}';\nAND(node(\"a\"),OR(node(\"b\"),node(\"c\")),NOT(node(\"d\").data(notData)));";
         Assertions.assertEquals(expectedStr,
-                ELBus.and("a", ELBus.or("b", "c"), ELBus.not(ELBus.node("d").data("notData", name2Value))).toEL());
+                ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d").data("notData", name2Value))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and("a", ELBus.or("b", "c"), ELBus.not(ELBus.node("d").data("notData", name2Value))).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d").data("notData", name2Value))).toEL()));
     }
     @Test
     public void testlogic12(){
@@ -137,9 +137,9 @@ public class LogicELBuilderTest extends BaseTest {
         name2Value.age = 18;
         String expectedStr = "notData = '{\"name\":\"zhangsan\",\"age\":18}';\nAND(\n\tnode(\"a\"),\n\tOR(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tNOT(\n\t\tnode(\"d\").data(notData)\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.and("a", ELBus.or("b", "c"), ELBus.not(ELBus.node("d").data("notData", name2Value))).toEL(true));
+                ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d").data("notData", name2Value))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and("a", ELBus.or("b", "c"), ELBus.not(ELBus.node("d").data("notData", name2Value))).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.and(ELBus.node("a"), ELBus.or(ELBus.node("b"), ELBus.node("c")), ELBus.not(ELBus.node("d").data("notData", name2Value))).toEL(true)));
     }
     // NOT调用方法补充测试
     @Test
@@ -151,14 +151,14 @@ public class LogicELBuilderTest extends BaseTest {
         Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.not(ELBus.node("a")).toEL()));
         expectedStr = "NOT(AND(node(\"a\"),node(\"b\"),node(\"c\")));";
         Assertions.assertEquals(expectedStr,
-                ELBus.not(ELBus.and("a", "b", "c")).toEL());
+                ELBus.not(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.not(ELBus.and("a", "b", "c")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.not(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c"))).toEL()));
         expectedStr = "NOT(OR(node(\"a\"),node(\"b\"),node(\"c\")));";
         Assertions.assertEquals(expectedStr,
-                ELBus.not(ELBus.or("a", "b", "c")).toEL());
+                ELBus.not(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.not(ELBus.or("a", "b", "c")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.not(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c"))).toEL()));
         expectedStr = "NOT(NOT(node(\"a\")));";
         Assertions.assertEquals(expectedStr,
                 ELBus.not(ELBus.not(ELBus.node("a"))).toEL());
@@ -174,14 +174,14 @@ public class LogicELBuilderTest extends BaseTest {
         Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.not(ELBus.node("a")).toEL(true)));
         expectedStr = "NOT(\n\tAND(\n\t\tnode(\"a\"),\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.not(ELBus.and("a", "b", "c")).toEL(true));
+                ELBus.not(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.not(ELBus.and("a", "b", "c")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.not(ELBus.and(ELBus.node("a"), ELBus.node("b"), ELBus.node("c"))).toEL(true)));
         expectedStr = "NOT(\n\tOR(\n\t\tnode(\"a\"),\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.not(ELBus.or("a", "b", "c")).toEL(true));
+                ELBus.not(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.not(ELBus.or("a", "b", "c")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.not(ELBus.or(ELBus.node("a"), ELBus.node("b"), ELBus.node("c"))).toEL(true)));
         expectedStr = "NOT(\n\tNOT(\n\t\tnode(\"a\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
                 ELBus.not(ELBus.not(ELBus.node("a"))).toEL(true));
@@ -191,11 +191,11 @@ public class LogicELBuilderTest extends BaseTest {
 
     @Test
     public void testLogic(){
-        AndELWrapper andEl = ELBus.and("a", "b").id("this is a id").tag("this is a tag");
+        AndELWrapper andEl = ELBus.and(ELBus.node("a"), ELBus.node("b")).id("this is a id").tag("this is a tag");
         Assertions.assertTrue(LiteFlowChainELBuilder.validate(andEl.toEL()));
-        OrELWrapper orEl = ELBus.or("a", "b");
+        OrELWrapper orEl = ELBus.or(ELBus.node("a"), ELBus.node("b"));
         Assertions.assertTrue(LiteFlowChainELBuilder.validate(orEl.toEL()));
-        NotELWrapper notEl = ELBus.not("a");
+        NotELWrapper notEl = ELBus.not(ELBus.node("a"));
         Assertions.assertTrue(LiteFlowChainELBuilder.validate(notEl.toEL()));
     }
 }

+ 74 - 74
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/LoopELBuilderTest.java

@@ -25,187 +25,187 @@ public class LoopELBuilderTest extends BaseTest {
     public void testLoop1(){
         String expectedStr = "FOR(3).DO(THEN(node(\"a\"),node(\"b\"),node(\"c\"))).BREAK(node(\"d\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.forOpt(3).doOpt(ELBus.then("a", "b", "c")).breakOpt("d").toEL());
+                ELBus.forOpt(3).doOpt(ELBus.then(ELBus.node("a"), ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("d")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(3).doOpt(ELBus.then("a", "b", "c")).breakOpt("d").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(3).doOpt(ELBus.then(ELBus.node("a"), ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("d")).toEL()));
     }
     // 格式化输出
     @Test
     public void testLoop2(){
         String expectedStr = "FOR(3).DO(\n\tTHEN(\n\t\tnode(\"a\"),\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t)\n).BREAK(\n\tnode(\"d\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.forOpt(3).doOpt(ELBus.then("a", "b", "c")).breakOpt("d").toEL(true));
+                ELBus.forOpt(3).doOpt(ELBus.then(ELBus.node("a"), ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("d")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(3).doOpt(ELBus.then("a", "b", "c")).breakOpt("d").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(3).doOpt(ELBus.then(ELBus.node("a"), ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("d")).toEL(true)));
     }
     // for 单节点循环测试
     @Test
     public void testLoop3(){
         String expectedStr = "FOR(node(\"a\")).DO(WHEN(node(\"b\"),node(\"c\"),node(\"d\"))).BREAK(AND(node(\"e\"),node(\"f\")));";
         Assertions.assertEquals(expectedStr,
-                ELBus.forOpt("a").doOpt(ELBus.when("b", "c", "d")).breakOpt(ELBus.and("e", "f")).toEL());
+                ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"), ELBus.node("d"))).breakOpt(ELBus.and(ELBus.node("e"), ELBus.node("f"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt("a").doOpt(ELBus.when("b", "c", "d")).breakOpt(ELBus.and("e", "f")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"), ELBus.node("d"))).breakOpt(ELBus.and(ELBus.node("e"), ELBus.node("f"))).toEL()));
     }
     @Test
     public void testLoop4(){
         String expectedStr = "FOR(\n\tnode(\"a\")\n).DO(\n\tWHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\"),\n\t\tnode(\"d\")\n\t)\n).BREAK(\n\tAND(\n\t\tnode(\"e\"),\n\t\tnode(\"f\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when("b", "c", "d")).breakOpt(ELBus.and("e", "f")).toEL(true));
+                ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"), ELBus.node("d"))).breakOpt(ELBus.and(ELBus.node("e"), ELBus.node("f"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when("b", "c", "d")).breakOpt(ELBus.and("e", "f")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"), ELBus.node("d"))).breakOpt(ELBus.and(ELBus.node("e"), ELBus.node("f"))).toEL(true)));
     }
     // parallel语句测试
     @Test
     public void testLoop5(){
         String expectedStr = "FOR(node(\"a\")).parallel(true).DO(WHEN(node(\"b\"),node(\"c\"),node(\"d\"))).BREAK(node(\"e\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.forOpt("a").doOpt(ELBus.when("b", "c", "d")).breakOpt("e").parallel(true).toEL());
+                ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"), ELBus.node("d"))).breakOpt(ELBus.node("e")).parallel(true).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt("a").doOpt(ELBus.when("b", "c", "d")).breakOpt("e").parallel(true).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"), ELBus.node("d"))).breakOpt(ELBus.node("e")).parallel(true).toEL()));
     }
     @Test
     public void testLoop6(){
         String expectedStr = "FOR(\n\tnode(\"a\")\n).parallel(true).DO(\n\tWHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\"),\n\t\tnode(\"d\")\n\t)\n).BREAK(\n\tnode(\"e\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.forOpt("a").doOpt(ELBus.when("b", "c", "d")).breakOpt("e").parallel(true).toEL(true));
+                ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"), ELBus.node("d"))).breakOpt(ELBus.node("e")).parallel(true).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt("a").doOpt(ELBus.when("b", "c", "d")).breakOpt("e").parallel(true).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"), ELBus.node("d"))).breakOpt(ELBus.node("e")).parallel(true).toEL(true)));
     }
     // 属性测试
     @Test
     public void testLoop7(){
         String expectedStr = "forData = '{\"name\":\"zhangsan\",\"age\":18}';\nFOR(node(\"a\")).DO(WHEN(node(\"b\"),node(\"c\"),node(\"d\"))).BREAK(node(\"e\").data(forData)).id(\"this is a id\").tag(\"this is a tag\").maxWaitSeconds(3);";
         Assertions.assertEquals(expectedStr,
-                ELBus.forOpt("a").doOpt(ELBus.when("b", "c", "d")).breakOpt(ELBus.node("e").data("forData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL());
+                ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"), ELBus.node("d"))).breakOpt(ELBus.node("e").data("forData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt("a").doOpt(ELBus.when("b", "c", "d")).breakOpt(ELBus.node("e").data("forData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"), ELBus.node("d"))).breakOpt(ELBus.node("e").data("forData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL()));
     }
     @Test
     public void testLoop8(){
         String expectedStr = "forData = '{\"name\":\"zhangsan\",\"age\":18}';\nFOR(\n\tnode(\"a\")\n).DO(\n\tWHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\"),\n\t\tnode(\"d\")\n\t)\n).BREAK(\n\tnode(\"e\").data(forData)\n).id(\"this is a id\").tag(\"this is a tag\").maxWaitSeconds(3);";
         Assertions.assertEquals(expectedStr,
-                ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when("b", "c", "d")).breakOpt(ELBus.node("e").data("forData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL(true));
+                ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"), ELBus.node("d"))).breakOpt(ELBus.node("e").data("forData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when("b", "c", "d")).breakOpt(ELBus.node("e").data("forData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"), ELBus.node("d"))).breakOpt(ELBus.node("e").data("forData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id").tag("this is a tag").maxWaitSeconds(3).toEL(true)));
     }
     // while调用测试
     @Test
     public void testLoop9(){
         String expectedStr = "WHILE(node(\"a\")).DO(THEN(node(\"b\"),node(\"c\"))).BREAK(node(\"f\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt("a").doOpt(ELBus.then("b", "c")).breakOpt("f").toEL());
+                ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("f")).toEL());
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then("b", "c")).breakOpt("f").toEL());
+                ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("f")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt("a").doOpt(ELBus.then("b", "c")).breakOpt("f").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("f")).toEL()));
 
         expectedStr = "WHILE(AND(node(\"a\"),node(\"b\"))).DO(node(\"c\")).BREAK(node(\"d\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt(ELBus.and("a", "b")).doOpt("c").breakOpt("d").toEL());
+                ELBus.whileOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"))).doOpt(ELBus.node("c")).breakOpt(ELBus.node("d")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.and("a", "b")).doOpt("c").breakOpt("d").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"))).doOpt(ELBus.node("c")).breakOpt(ELBus.node("d")).toEL()));
 
         expectedStr = "WHILE(OR(node(\"a\"),node(\"b\"))).DO(node(\"c\")).BREAK(node(\"d\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt(ELBus.or("a", "b")).doOpt("c").breakOpt("d").toEL());
+                ELBus.whileOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"))).doOpt(ELBus.node("c")).breakOpt(ELBus.node("d")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.or("a", "b")).doOpt("c").breakOpt("d").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"))).doOpt(ELBus.node("c")).breakOpt(ELBus.node("d")).toEL()));
 
         expectedStr = "WHILE(NOT(node(\"a\"))).DO(node(\"c\")).BREAK(node(\"d\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt(ELBus.not("a")).doOpt("c").breakOpt("d").toEL());
+                ELBus.whileOpt(ELBus.not(ELBus.node("a"))).doOpt(ELBus.node("c")).breakOpt(ELBus.node("d")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.not("a")).doOpt("c").breakOpt("d").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.not(ELBus.node("a"))).doOpt(ELBus.node("c")).breakOpt(ELBus.node("d")).toEL()));
     }
     @Test
     public void testLoop10(){
         String expectedStr = "WHILE(\n\tnode(\"a\")\n).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t)\n).BREAK(\n\tnode(\"f\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt("a").doOpt(ELBus.then("b", "c")).breakOpt("f").toEL(true));
+                ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("f")).toEL(true));
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then("b", "c")).breakOpt("f").toEL(true));
+                ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("f")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt("a").doOpt(ELBus.then("b", "c")).breakOpt("f").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("f")).toEL(true)));
 
         expectedStr = "WHILE(\n\tAND(\n\t\tnode(\"a\"),\n\t\tnode(\"b\")\n\t)\n).DO(\n\tnode(\"c\")\n).BREAK(\n\tnode(\"d\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt(ELBus.and("a", "b")).doOpt("c").breakOpt("d").toEL(true));
+                ELBus.whileOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"))).doOpt(ELBus.node("c")).breakOpt(ELBus.node("d")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.and("a", "b")).doOpt("c").breakOpt("d").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.and(ELBus.node("a"), ELBus.node("b"))).doOpt(ELBus.node("c")).breakOpt(ELBus.node("d")).toEL(true)));
 
         expectedStr = "WHILE(\n\tOR(\n\t\tnode(\"a\"),\n\t\tnode(\"b\")\n\t)\n).DO(\n\tnode(\"c\")\n).BREAK(\n\tnode(\"d\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt(ELBus.or("a", "b")).doOpt("c").breakOpt("d").toEL(true));
+                ELBus.whileOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"))).doOpt(ELBus.node("c")).breakOpt(ELBus.node("d")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.or("a", "b")).doOpt("c").breakOpt("d").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.or(ELBus.node("a"), ELBus.node("b"))).doOpt(ELBus.node("c")).breakOpt(ELBus.node("d")).toEL(true)));
 
         expectedStr = "WHILE(\n\tNOT(\n\t\tnode(\"a\")\n\t)\n).DO(\n\tnode(\"c\")\n).BREAK(\n\tnode(\"d\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt(ELBus.not("a")).doOpt("c").breakOpt("d").toEL(true));
+                ELBus.whileOpt(ELBus.not(ELBus.node("a"))).doOpt(ELBus.node("c")).breakOpt(ELBus.node("d")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.not("a")).doOpt("c").breakOpt("d").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.not(ELBus.node("a"))).doOpt(ELBus.node("c")).breakOpt(ELBus.node("d")).toEL(true)));
     }
     // while属性调用测试
     @Test
     public void testLoop11(){
         String expectedStr = "whileData = '{\"name\":\"zhangsan\",\"age\":18}';\nWHILE(node(\"a\")).parallel(true).DO(THEN(node(\"b\"),node(\"c\"))).BREAK(node(\"d\").data(whileData)).id(\"this is a ig\").tag(\"this is a tag\").maxWaitSeconds(3);";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt("a").doOpt(ELBus.then("b", "c")).breakOpt(ELBus.node("d").data("whileData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL());
+                ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("d").data("whileData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt("a").doOpt(ELBus.then("b", "c")).breakOpt(ELBus.node("d").data("whileData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("d").data("whileData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL()));
     }
     @Test
     public void testLoop12(){
         String expectedStr = "whileData = '{\"name\":\"zhangsan\",\"age\":18}';\nWHILE(\n\tnode(\"a\")\n).parallel(true).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t)\n).BREAK(\n\tnode(\"d\").data(whileData)\n).id(\"this is a ig\").tag(\"this is a tag\").maxWaitSeconds(3);";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt("a").doOpt(ELBus.then("b", "c")).breakOpt(ELBus.node("d").data("whileData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL(true));
+                ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("d").data("whileData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt("a").doOpt(ELBus.then("b", "c")).breakOpt(ELBus.node("d").data("whileData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c"))).breakOpt(ELBus.node("d").data("whileData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL(true)));
     }
     // Iterator 调用测试
     @Test
     public void testLoop13(){
         String expectedStr = "ITERATOR(node(\"a\")).DO(WHEN(node(\"b\"),node(\"c\")));";
         Assertions.assertEquals(expectedStr,
-                ELBus.iteratorOpt("a").doOpt(ELBus.when("b", "c")).toEL());
+                ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt("a").doOpt(ELBus.when("b", "c")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"))).toEL()));
         expectedStr = "ITERATOR(node(\"a\")).DO(WHEN(node(\"b\"),node(\"c\")));";
         Assertions.assertEquals(expectedStr,
-                ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.when("b", "c")).toEL());
+                ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.when("b", "c")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"))).toEL()));
     }
     @Test
     public void testLoop14(){
         String expectedStr = "ITERATOR(\n\tnode(\"a\")\n).DO(\n\tWHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.iteratorOpt("a").doOpt(ELBus.when("b", "c")).toEL(true));
+                ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt("a").doOpt(ELBus.when("b", "c")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"))).toEL(true)));
         expectedStr = "ITERATOR(\n\tnode(\"a\")\n).DO(\n\tWHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.when("b", "c")).toEL(true));
+                ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.when("b", "c")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.when(ELBus.node("b"), ELBus.node("c"))).toEL(true)));
     }
     // iterator 属性测试
     @Test
     public void testLoop15(){
         String expectedStr = "iteratorData = '{\"name\":\"zhangsan\",\"age\":18}';\nITERATOR(node(\"a\")).parallel(true).DO(THEN(node(\"b\"),node(\"c\").data(iteratorData))).id(\"this is a ig\").tag(\"this is a tag\").maxWaitSeconds(3);";
         Assertions.assertEquals(expectedStr,
-                ELBus.iteratorOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("iteratorData", "{\"name\":\"zhangsan\",\"age\":18}"))).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL());
+                ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("iteratorData", "{\"name\":\"zhangsan\",\"age\":18}"))).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("iteratorData", "{\"name\":\"zhangsan\",\"age\":18}"))).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("iteratorData", "{\"name\":\"zhangsan\",\"age\":18}"))).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL()));
     }
     @Test
     public void testLoop16(){
         String expectedStr = "iteratorData = '{\"name\":\"zhangsan\",\"age\":18}';\nITERATOR(\n\tnode(\"a\")\n).parallel(true).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(iteratorData)\n\t)\n).id(\"this is a ig\").tag(\"this is a tag\").maxWaitSeconds(3);";
         Assertions.assertEquals(expectedStr,
-                ELBus.iteratorOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("iteratorData", "{\"name\":\"zhangsan\",\"age\":18}"))).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL(true));
+                ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("iteratorData", "{\"name\":\"zhangsan\",\"age\":18}"))).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("iteratorData", "{\"name\":\"zhangsan\",\"age\":18}"))).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("iteratorData", "{\"name\":\"zhangsan\",\"age\":18}"))).id("this is a ig").tag("this is a tag").maxWaitSeconds(3).parallel(true).toEL(true)));
     }
     // data Map 参数 测试
     @Test
@@ -216,21 +216,21 @@ public class LoopELBuilderTest extends BaseTest {
         String expectedStr = "forData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "FOR(node(\"a\")).DO(THEN(node(\"b\"),node(\"c\").data(forData)));";
         Assertions.assertEquals(expectedStr,
-                ELBus.forOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("forData", name2Value))).toEL());
+                ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("forData", name2Value))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("forData", name2Value))).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("forData", name2Value))).toEL()));
         expectedStr = "whileData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "WHILE(node(\"a\")).DO(THEN(node(\"b\"),node(\"c\").data(whileData)));";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("whileData", name2Value))).toEL());
+                ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("whileData", name2Value))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("whileData", name2Value))).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("whileData", name2Value))).toEL()));
         expectedStr = "iteratorData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "ITERATOR(node(\"a\")).DO(THEN(node(\"b\"),node(\"c\").data(iteratorData)));";
         Assertions.assertEquals(expectedStr,
-                ELBus.iteratorOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("iteratorData", name2Value))).toEL());
+                ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("iteratorData", name2Value))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("iteratorData", name2Value))).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("iteratorData", name2Value))).toEL()));
     }
 
     @Test
@@ -241,21 +241,21 @@ public class LoopELBuilderTest extends BaseTest {
         String expectedStr = "forData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "FOR(\n\tnode(\"a\")\n).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(forData)\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.forOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("forData", name2Value))).toEL(true));
+                ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("forData", name2Value))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("forData", name2Value))).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("forData", name2Value))).toEL(true)));
         expectedStr = "whileData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "WHILE(\n\tnode(\"a\")\n).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(whileData)\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("whileData", name2Value))).toEL(true));
+                ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("whileData", name2Value))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("whileData", name2Value))).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("whileData", name2Value))).toEL(true)));
         expectedStr = "iteratorData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "ITERATOR(\n\tnode(\"a\")\n).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(iteratorData)\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.iteratorOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("iteratorData", name2Value))).toEL(true));
+                ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("iteratorData", name2Value))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("iteratorData", name2Value))).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("iteratorData", name2Value))).toEL(true)));
     }
     private static class ParamClass{
         private String name;
@@ -276,21 +276,21 @@ public class LoopELBuilderTest extends BaseTest {
         String expectedStr = "forData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "FOR(node(\"a\")).DO(THEN(node(\"b\"),node(\"c\").data(forData)));";
         Assertions.assertEquals(expectedStr,
-                ELBus.forOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("forData", name2Value))).toEL());
+                ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("forData", name2Value))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("forData", name2Value))).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("forData", name2Value))).toEL()));
         expectedStr = "whileData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "WHILE(node(\"a\")).DO(THEN(node(\"b\"),node(\"c\").data(whileData)));";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("whileData", name2Value))).toEL());
+                ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("whileData", name2Value))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("whileData", name2Value))).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("whileData", name2Value))).toEL()));
         expectedStr = "iteratorData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "ITERATOR(node(\"a\")).DO(THEN(node(\"b\"),node(\"c\").data(iteratorData)));";
         Assertions.assertEquals(expectedStr,
-                ELBus.iteratorOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("iteratorData", name2Value))).toEL());
+                ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("iteratorData", name2Value))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("iteratorData", name2Value))).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("iteratorData", name2Value))).toEL()));
     }
 
     @Test
@@ -301,21 +301,21 @@ public class LoopELBuilderTest extends BaseTest {
         String expectedStr = "forData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "FOR(\n\tnode(\"a\")\n).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(forData)\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.forOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("forData", name2Value))).toEL(true));
+                ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("forData", name2Value))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("forData", name2Value))).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.forOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("forData", name2Value))).toEL(true)));
         expectedStr = "whileData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "WHILE(\n\tnode(\"a\")\n).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(whileData)\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.whileOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("whileData", name2Value))).toEL(true));
+                ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("whileData", name2Value))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("whileData", name2Value))).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.whileOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("whileData", name2Value))).toEL(true)));
         expectedStr = "iteratorData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "ITERATOR(\n\tnode(\"a\")\n).DO(\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(iteratorData)\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.iteratorOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("iteratorData", name2Value))).toEL(true));
+                ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("iteratorData", name2Value))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt("a").doOpt(ELBus.then("b", ELBus.node("c").data("iteratorData", name2Value))).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.iteratorOpt(ELBus.node("a")).doOpt(ELBus.then(ELBus.node("b"), ELBus.node("c").data("iteratorData", name2Value))).toEL(true)));
     }
 
 }

+ 2 - 14
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/MaxWaitSecondBuilderTest.java

@@ -2,9 +2,7 @@ package com.yomahub.liteflow.test.builder;
 
 import com.yomahub.liteflow.builder.el.*;
 import com.yomahub.liteflow.test.BaseTest;
-import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.test.context.SpringBootTest;
@@ -13,17 +11,11 @@ import org.springframework.boot.test.context.SpringBootTest;
 @EnableAutoConfiguration
 public class MaxWaitSecondBuilderTest extends BaseTest {
 
-    @BeforeAll
-    public static void init(){
-        ELBus.setNodeWrapper(false);
-    }
-
-
     // node层面
     @Test
     public void testMaxWaitSecond1(){
-        NodeELWrapper nodeA = ELBus.node("a").maxWaitSeconds(4);
-        NodeELWrapper nodeB = ELBus.node("b").maxWaitSeconds(4);
+        CommonNodeELWrapper nodeA = ELBus.commonNode("a").maxWaitSeconds(4);
+        CommonNodeELWrapper nodeB = ELBus.commonNode("b").maxWaitSeconds(4);
         WhenELWrapper whenELWrapper = ELBus.when(nodeA, nodeB);
         Assertions.assertEquals("WHEN(a.maxWaitSeconds(4),b.maxWaitSeconds(4));", whenELWrapper.toEL());
     }
@@ -71,8 +63,4 @@ public class MaxWaitSecondBuilderTest extends BaseTest {
         Assertions.assertEquals("ITERATOR(i).DO(a).maxWaitSeconds(5);", iteratorELWrapper.toEL());
     }
 
-    @AfterAll
-    public static void after(){
-        ELBus.setNodeWrapper(true);
-    }
 }

+ 7 - 8
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/NodeELBuilderTest.java

@@ -2,9 +2,9 @@ package com.yomahub.liteflow.test.builder;
 
 import cn.hutool.core.date.DateUtil;
 import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
+import com.yomahub.liteflow.builder.el.CommonNodeELWrapper;
 import com.yomahub.liteflow.builder.el.ELBus;
 import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
-import com.yomahub.liteflow.builder.el.NodeELWrapper;
 import com.yomahub.liteflow.builder.el.ThenELWrapper;
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.enums.NodeTypeEnum;
@@ -14,7 +14,6 @@ import com.yomahub.liteflow.test.BaseTest;
 import com.yomahub.liteflow.test.builder.cmp.ACmp;
 import com.yomahub.liteflow.test.builder.cmp.BCmp;
 import com.yomahub.liteflow.test.builder.vo.User;
-import com.yomahub.liteflow.util.JsonUtil;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -41,7 +40,7 @@ public class NodeELBuilderTest extends BaseTest {
         String jsonStr = "{\"name\":\"zhangsan\",\"age\":18}";
         String expectedStr = "nodeData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "node(\"a\").tag(\"node a tag\").data(nodeData).maxWaitSeconds(4);";
-        NodeELWrapper node = ELBus.node("a").maxWaitSeconds(4).tag("node a tag").data("nodeData", jsonStr);
+        CommonNodeELWrapper node = ELBus.node("a").maxWaitSeconds(4).tag("node a tag").data("nodeData", jsonStr);
         Assertions.assertEquals(expectedStr,
                 node.toEL());
         System.out.println(expectedStr);
@@ -52,7 +51,7 @@ public class NodeELBuilderTest extends BaseTest {
         String jsonStr = "{\"name\":\"zhangsan\",\"age\":18}";
         String expectedStr = "nodeData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "node(\"a\").tag(\"node a tag\").data(nodeData).maxWaitSeconds(4);";
-        NodeELWrapper node = ELBus.node("a").maxWaitSeconds(4).tag("node a tag").data("nodeData", jsonStr);
+        CommonNodeELWrapper node = ELBus.node("a").maxWaitSeconds(4).tag("node a tag").data("nodeData", jsonStr);
         Assertions.assertEquals(expectedStr,
                 node.toEL(true));
         System.out.println(expectedStr);
@@ -65,7 +64,7 @@ public class NodeELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         String expectedStr = "nodeData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "node(\"a\").tag(\"node a tag\").data(nodeData).maxWaitSeconds(4);";
-        NodeELWrapper node = ELBus.node("a").maxWaitSeconds(4).tag("node a tag").data("nodeData", name2Value);
+        CommonNodeELWrapper node = ELBus.node("a").maxWaitSeconds(4).tag("node a tag").data("nodeData", name2Value);
         Assertions.assertEquals(expectedStr,
                 node.toEL());
         System.out.println(expectedStr);
@@ -78,7 +77,7 @@ public class NodeELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         String expectedStr = "nodeData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "node(\"a\").tag(\"node a tag\").data(nodeData).maxWaitSeconds(4);";
-        NodeELWrapper node = ELBus.node("a").maxWaitSeconds(4).tag("node a tag").data("nodeData", name2Value);
+        CommonNodeELWrapper node = ELBus.node("a").maxWaitSeconds(4).tag("node a tag").data("nodeData", name2Value);
         Assertions.assertEquals(expectedStr,
                 node.toEL(true));
         System.out.println(expectedStr);
@@ -101,7 +100,7 @@ public class NodeELBuilderTest extends BaseTest {
         name2Value.name = "zhangsan";
         String expectedStr = "nodeData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "node(\"a\").tag(\"node a tag\").data(nodeData).maxWaitSeconds(4);";
-        NodeELWrapper node = ELBus.node("a").maxWaitSeconds(4).tag("node a tag").data("nodeData", name2Value);
+        CommonNodeELWrapper node = ELBus.node("a").maxWaitSeconds(4).tag("node a tag").data("nodeData", name2Value);
         Assertions.assertEquals(expectedStr,
                 node.toEL());
         System.out.println(expectedStr);
@@ -114,7 +113,7 @@ public class NodeELBuilderTest extends BaseTest {
         name2Value.name = "zhangsan";
         String expectedStr = "nodeData = '{\"name\":\"zhangsan\",\"age\":18}';\n" +
                 "node(\"a\").tag(\"node a tag\").data(nodeData).maxWaitSeconds(4);";
-        NodeELWrapper node = ELBus.node("a").maxWaitSeconds(4).tag("node a tag").data("nodeData", name2Value);
+        CommonNodeELWrapper node = ELBus.node("a").maxWaitSeconds(4).tag("node a tag").data("nodeData", name2Value);
         Assertions.assertEquals(expectedStr,
                 node.toEL(true));
         System.out.println(expectedStr);

+ 37 - 38
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/ParELBuilderTest.java

@@ -3,7 +3,6 @@ package com.yomahub.liteflow.test.builder;
 import com.yomahub.liteflow.builder.el.ELBus;
 import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
 import com.yomahub.liteflow.builder.el.ParELWrapper;
-import com.yomahub.liteflow.builder.el.WhenELWrapper;
 import com.yomahub.liteflow.test.BaseTest;
 import com.yomahub.liteflow.util.JsonUtil;
 import org.junit.jupiter.api.Assertions;
@@ -28,105 +27,105 @@ public class ParELBuilderTest extends BaseTest {
     public void testPar1(){
         String expectedStr = "PAR(node(\"a\"),node(\"b\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", "b").toEL());
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", "b").toEL()));
+                ELBus.par(ELBus.node("a"), ELBus.node("b")).toEL());
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.node("b")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testPar2(){
         String expectedStr = "PAR(\n\tnode(\"a\"),\n\tnode(\"b\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", "b").toEL(true));
+                ELBus.par(ELBus.node("a"), ELBus.node("b")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", "b").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.node("b")).toEL(true)));
     }
     // then组件then方法调用测试
     @Test
     public void testPar3(){
         String expectedStr = "PAR(node(\"a\"),node(\"b\"),node(\"c\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", "b").par("c").toEL());
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", "b").par("c").toEL()));
+                ELBus.par(ELBus.node("a"), ELBus.node("b")).par(ELBus.node("c")).toEL());
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.node("b")).par(ELBus.node("c")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testPar4(){
         String expectedStr = "PAR(\n\tnode(\"a\"),\n\tnode(\"b\"),\n\tnode(\"c\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", "b").par("c").toEL(true));
+                ELBus.par(ELBus.node("a"), ELBus.node("b")).par(ELBus.node("c")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", "b").par("c").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.node("b")).par(ELBus.node("c")).toEL(true)));
     }
     // then组件嵌套调用测试
     @Test
     public void testPar5(){
         String expectedStr = "PAR(node(\"a\"),PAR(node(\"b\"),node(\"c\")),node(\"d\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", ELBus.par("b").par("c")).par("d").toEL());
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", ELBus.par("b").par("c")).par("d").toEL()));
+                ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c"))).par(ELBus.node("d")).toEL());
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c"))).par(ELBus.node("d")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testPar6(){
         String expectedStr = "PAR(\n\tnode(\"a\"),\n\tPAR(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", ELBus.par("b").par("c")).par("d").toEL(true));
+                ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c"))).par(ELBus.node("d")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", ELBus.par("b").par("c")).par("d").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c"))).par(ELBus.node("d")).toEL(true)));
     }
     // PAR特有属性测试 any ignoreError customThreadExecutor must
     @Test
     public void testPar7(){
         String expectedStr = "PAR(node(\"a\"),node(\"b\"),PAR(node(\"c\"),node(\"d\")).any(true).threadPool(\"com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1\").id(\"node1\")).ignoreError(true).must(\"a\", \"task1\", \"node1\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", "b", ELBus.par("c").par("d").id("node1").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").any(true)).ignoreError(true).must("a", "task1", "node1").toEL());
+                ELBus.par(ELBus.node("a"), ELBus.node("b"), ELBus.par(ELBus.node("c")).par(ELBus.node("d")).id("node1").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").any(true)).ignoreError(true).must("a","task1","node1").toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", "b", ELBus.par("c").par("d").id("node1").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").any(true)).ignoreError(true).must("a", "task1", "node1").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.node("b"), ELBus.par(ELBus.node("c")).par(ELBus.node("d")).id("node1").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").any(true)).ignoreError(true).must("a","task1","node1").toEL()));
     }
     // 格式化输出测试
     @Test
     public void testPar8(){
         String expectedStr = "PAR(\n\tnode(\"a\"),\n\tnode(\"b\"),\n\tPAR(\n\t\tnode(\"c\"),\n\t\tnode(\"d\")\n\t).any(true).threadPool(\"com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1\").id(\"node1\")\n).ignoreError(true).must(\"a\", \"task1\", \"node1\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", "b", ELBus.par("c").par("d").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").id("node1").any(true)).ignoreError(true).must("a", "task1", "node1").toEL(true));
+                ELBus.par(ELBus.node("a"), ELBus.node("b"), ELBus.par(ELBus.node("c")).par(ELBus.node("d")).customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").id("node1").any(true)).ignoreError(true).must("a","task1","node1").toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", "b", ELBus.par("c").par("d").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").id("node1").any(true)).ignoreError(true).must("a", "task1", "node1").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.node("b"), ELBus.par(ELBus.node("c")).par(ELBus.node("d")).customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").id("node1").any(true)).ignoreError(true).must("a","task1","node1").toEL(true)));
     }
     // maxWaitSeconds 属性测试
     @Test
     public void testPar9(){
         String expectedStr = "PAR(node(\"a\"),node(\"b\")).maxWaitSeconds(5);";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", "b").maxWaitSeconds(5).toEL());
+                ELBus.par(ELBus.node("a"), ELBus.node("b")).maxWaitSeconds(5).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", "b").maxWaitSeconds(5).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.node("b")).maxWaitSeconds(5).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testPar10(){
         String expectedStr = "PAR(\n\tnode(\"a\"),\n\tnode(\"b\")\n).maxWaitSeconds(5);";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", "b").maxWaitSeconds(5).toEL(true));
+                ELBus.par(ELBus.node("a"), ELBus.node("b")).maxWaitSeconds(5).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", "b").maxWaitSeconds(5).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.node("b")).maxWaitSeconds(5).toEL(true)));
     }
     // 属性设置测试
     @Test
     public void testPar11(){
         String expectedStr = "PAR(node(\"a\"),PAR(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\")).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", ELBus.par("b").par("c").id("this is a id")).par("d").tag("this is a tag").toEL());
+                ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c")).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", ELBus.par("b").par("c").id("this is a id")).par("d").tag("this is a tag").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c")).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL()));
     }
     // 格式化输出测试
     @Test
     public void testPar12(){
         String expectedStr = "PAR(\n\tnode(\"a\"),\n\tPAR(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\")\n).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", ELBus.par("b").par("c").id("this is a id")).par("d").tag("this is a tag").toEL(true));
+                ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c")).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", ELBus.par("b").par("c").id("this is a id")).par("d").tag("this is a tag").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c")).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL(true)));
     }
     // data属性测试
     @Test
@@ -137,9 +136,9 @@ public class ParELBuilderTest extends BaseTest {
         System.out.println(JsonUtil.toJsonString(name2Value));
         String expectedStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nPAR(node(\"a\"),PAR(node(\"b\"),node(\"c\").data(whenData)).id(\"this is a id\"),node(\"d\")).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", ELBus.par("b").par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par("d").tag("this is a tag").toEL(false));
+                ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL(false));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", ELBus.par("b").par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par("d").tag("this is a tag").toEL(false)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL(false)));
     }
     // 格式化输出测试
     @Test
@@ -149,27 +148,27 @@ public class ParELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         String expectedStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nPAR(\n\tnode(\"a\"),\n\tPAR(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(whenData)\n\t).id(\"this is a id\"),\n\tnode(\"d\")\n).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", ELBus.par("b").par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par("d").tag("this is a tag").toEL(true));
+                ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", ELBus.par("b").par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par("d").tag("this is a tag").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL(true)));
     }
     // data属性测试 Json字符串赋值data
     @Test
     public void testPar15(){
         String expectedStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nPAR(node(\"a\"),PAR(node(\"b\"),node(\"c\").data(whenData)).id(\"this is a id\"),node(\"d\")).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", ELBus.par("b").par(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).par("d").tag("this is a tag").toEL());
+                ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", ELBus.par("b").par(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).par("d").tag("this is a tag").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL()));
     }
     // 格式化输出测试 Json字符串赋值data
     @Test
     public void testPar16(){
         String expectedStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nPAR(\n\tnode(\"a\"),\n\tPAR(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(whenData)\n\t).id(\"this is a id\"),\n\tnode(\"d\")\n).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", ELBus.par("b").par(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).par("d").tag("this is a tag").toEL(true));
+                ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", ELBus.par("b").par(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).par("d").tag("this is a tag").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL(true)));
     }
     private static class ParamClass{
         private String name;
@@ -189,9 +188,9 @@ public class ParELBuilderTest extends BaseTest {
         name2Value.age = 18;
         String expectedStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nPAR(node(\"a\"),PAR(node(\"b\"),node(\"c\").data(whenData)).id(\"this is a id\"),node(\"d\")).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", ELBus.par("b").par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par("d").tag("this is a tag").toEL());
+                ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", ELBus.par("b").par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par("d").tag("this is a tag").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL()));
     }
     // 格式化输出测试
     @Test
@@ -201,14 +200,14 @@ public class ParELBuilderTest extends BaseTest {
         name2Value.age = 18;
         String expectedStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nPAR(\n\tnode(\"a\"),\n\tPAR(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(whenData)\n\t).id(\"this is a id\"),\n\tnode(\"d\")\n).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.par("a", ELBus.par("b").par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par("d").tag("this is a tag").toEL(true));
+                ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par("a", ELBus.par("b").par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par("d").tag("this is a tag").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.par(ELBus.node("a"), ELBus.par(ELBus.node("b")).par(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).par(ELBus.node("d")).tag("this is a tag").toEL(true)));
     }
 
     @Test
     public void testPAR(){
-        ParELWrapper el = ELBus.par("a", "b", "c").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1");
+        ParELWrapper el = ELBus.par(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")).customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1");
         Assertions.assertTrue(LiteFlowChainELBuilder.validate(el.toEL()));
     }
 }

+ 7 - 16
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/RetryBuilderTest.java

@@ -1,10 +1,10 @@
 package com.yomahub.liteflow.test.builder;
 
-import com.yomahub.liteflow.builder.el.*;
+import com.yomahub.liteflow.builder.el.CommonNodeELWrapper;
+import com.yomahub.liteflow.builder.el.ELBus;
+import com.yomahub.liteflow.builder.el.WhenELWrapper;
 import com.yomahub.liteflow.test.BaseTest;
-import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.test.context.SpringBootTest;
@@ -13,16 +13,11 @@ import org.springframework.boot.test.context.SpringBootTest;
 @EnableAutoConfiguration
 public class RetryBuilderTest extends BaseTest {
 
-    @BeforeAll
-    public static void init(){
-        ELBus.setNodeWrapper(false);
-    }
-
     // node上进行retry
     @Test
     public void testRetry1(){
-        NodeELWrapper nodeA = ELBus.node("a").retry(2);
-        NodeELWrapper nodeB = ELBus.node("b").retry(3);
+        CommonNodeELWrapper nodeA = ELBus.commonNode("a").retry(2);
+        CommonNodeELWrapper nodeB = ELBus.commonNode("b").retry(3);
         WhenELWrapper whenELWrapper = ELBus.when(nodeA, nodeB);
         Assertions.assertEquals("WHEN(a.retry(2),b.retry(3));", whenELWrapper.toEL());
     }
@@ -30,8 +25,8 @@ public class RetryBuilderTest extends BaseTest {
     // node上进行retry,带exception
     @Test
     public void testRetry2(){
-        NodeELWrapper nodeA = ELBus.node("a").retry(2, "java.lang.NullPointerException");
-        NodeELWrapper nodeB = ELBus.node("b").retry(3, "java.lang.NullPointerException", "java.lang.ArrayIndexOutOfBoundsException");
+        CommonNodeELWrapper nodeA = ELBus.commonNode("a").retry(2, "java.lang.NullPointerException");
+        CommonNodeELWrapper nodeB = ELBus.commonNode("b").retry(3, "java.lang.NullPointerException", "java.lang.ArrayIndexOutOfBoundsException");
         WhenELWrapper whenELWrapper = ELBus.when(nodeA, nodeB);
         Assertions.assertEquals("WHEN(a.retry(2,\"java.lang.NullPointerException\"),b.retry(3,\"java.lang.NullPointerException\",\"java.lang.ArrayIndexOutOfBoundsException\"));",
                 whenELWrapper.toEL());
@@ -52,8 +47,4 @@ public class RetryBuilderTest extends BaseTest {
                 whenELWrapper.toEL());
     }
 
-    @AfterAll
-    public static void after(){
-        ELBus.setNodeWrapper(true);
-    }
 }

+ 41 - 40
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/SerELBuilderTest.java

@@ -16,6 +16,7 @@ import java.util.Map;
  * 串行组件测试
  *
  * @author gezuao
+ * @author luo yi
  * @since 2.11.1
  */
 @SpringBootTest(classes = SerELBuilderTest.class)
@@ -26,98 +27,98 @@ public class SerELBuilderTest extends BaseTest {
     @Test
     public void testSer1(){
         Assertions.assertEquals("SER(node(\"a\"),node(\"b\"));",
-                ELBus.ser("a", "b").toEL());
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", "b").toEL()));
+                ELBus.ser(ELBus.node("a"), ELBus.node("b")).toEL());
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.node("b")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testSer2(){
         Assertions.assertEquals("SER(\n\tnode(\"a\")," +
                         "\n\tnode(\"b\")\n);",
-                ELBus.ser("a", "b").toEL(true));
+                ELBus.ser(ELBus.node("a"), ELBus.node("b")).toEL(true));
         System.out.println("SER(\n\tnode(\"a\")," +
                 "\n\tnode(\"b\")\n);");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", "b").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.node("b")).toEL(true)));
     }
     // then组件then方法调用测试
     @Test
     public void testSer3(){
         Assertions.assertEquals("SER(node(\"a\"),node(\"b\"),node(\"c\"));",
-                ELBus.ser("a", "b").ser("c").toEL());
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", "b").ser("c").toEL()));
+                ELBus.ser(ELBus.node("a"), ELBus.node("b")).ser(ELBus.node("c")).toEL());
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.node("b")).ser(ELBus.node("c")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testSer4(){
         Assertions.assertEquals("SER(\n\tnode(\"a\"),\n\tnode(\"b\")," +
                         "\n\tnode(\"c\")\n);",
-                ELBus.ser("a", "b").ser("c").toEL(true));
+                ELBus.ser(ELBus.node("a"), ELBus.node("b")).ser(ELBus.node("c")).toEL(true));
         System.out.println("SER(\n\tnode(\"a\"),\n\tnode(\"b\")," +
                 "\n\tnode(\"c\")\n);");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", "b").ser("c").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.node("b")).ser(ELBus.node("c")).toEL(true)));
     }
     // then组件嵌套调用测试
     @Test
     public void testSer5(){
         Assertions.assertEquals("SER(node(\"a\"),SER(node(\"b\"),node(\"c\")),node(\"d\"));",
-                ELBus.ser("a", ELBus.ser("b").ser("c")).ser("d").toEL());
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c")).ser("d").toEL()));
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c"))).ser(ELBus.node("d")).toEL());
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c"))).ser(ELBus.node("d")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testSer6(){
         Assertions.assertEquals("SER(\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n);",
-                ELBus.ser("a", ELBus.ser("b").ser("c")).ser("d").toEL(true));
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c"))).ser(ELBus.node("d")).toEL(true));
         System.out.println("SER(\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n);");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c")).ser("d").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c"))).ser(ELBus.node("d")).toEL(true)));
     }
     // pre组件测试
     @Test
     public void testSer7(){
         Assertions.assertEquals("SER(PRE(node(\"p\")),PRE(node(\"pp\")),node(\"a\"),SER(node(\"b\"),node(\"c\")),node(\"d\"));",
-                ELBus.ser("a", ELBus.ser("b").ser("c")).ser("d").pre("p").pre("pp").toEL());
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c"))).ser(ELBus.node("d")).pre(ELBus.node("p")).pre(ELBus.node("pp")).toEL());
         System.out.println("SER(PRE(node(\"p\")),PRE(node(\"pp\")),node(\"a\"),SER(node(\"b\"),node(\"c\")),node(\"d\"));");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c")).ser("d").pre("p").pre("pp").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c"))).ser(ELBus.node("d")).pre(ELBus.node("p")).pre(ELBus.node("pp")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testSer8(){
         Assertions.assertEquals("SER(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tPRE(\n\t\tnode(\"pp\")\n\t),\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n);",
-                ELBus.ser("a", ELBus.ser("b").ser("c")).ser("d").pre("p").pre("pp").toEL(true));
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c"))).ser(ELBus.node("d")).pre(ELBus.node("p")).pre(ELBus.node("pp")).toEL(true));
         System.out.println("SER(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tPRE(\n\t\tnode(\"pp\")\n\t),\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n);");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c")).ser("d").pre("p").pre("pp").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c"))).ser(ELBus.node("d")).pre(ELBus.node("p")).pre(ELBus.node("pp")).toEL(true)));
     }
     // pre finally 格式测试
     @Test
     public void testSer9(){
         Assertions.assertEquals("SER(PRE(node(\"p\")),node(\"a\"),SER(node(\"b\"),node(\"c\")),node(\"d\"),FINALLY(node(\"f\")));",
-                ELBus.ser("a", ELBus.ser("b").ser("c")).ser("d").pre("p").finallyOpt("f").toEL());
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c"))).ser(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL());
         System.out.println("SER(PRE(node(\"p\")),node(\"a\"),SER(node(\"b\"),node(\"c\")),node(\"d\"),FINALLY(node(\"f\")));");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c")).ser("d").pre("p").finallyOpt("f").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c"))).ser(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testSer10(){
         Assertions.assertEquals("SER(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\"),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n);",
-                ELBus.ser("a", ELBus.ser("b").ser("c")).ser("d").pre("p").finallyOpt("f").toEL(true));
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c"))).ser(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true));
         System.out.println("SER(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\"),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n);");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c")).ser("d").pre("p").finallyOpt("f").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c"))).ser(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true)));
     }
     // 属性设置测试
     @Test
     public void testSer11(){
         Assertions.assertEquals("SER(PRE(node(\"p\")),node(\"a\"),SER(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\"),FINALLY(node(\"f\"))).tag(\"this is a tag\");",
-                ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser("d").pre("p").finallyOpt("f").toEL());
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL());
         System.out.println("SER(PRE(node(\"p\")),node(\"a\"),SER(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\"),FINALLY(node(\"f\"))).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser("d").pre("p").finallyOpt("f").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testSer12(){
         Assertions.assertEquals("SER(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\"),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");",
-                ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser("d").pre("p").finallyOpt("f").toEL(true));
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true));
         System.out.println("SER(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\"),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser("d").pre("p").finallyOpt("f").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true)));
     }
     // data属性测试
     @Test
@@ -127,9 +128,9 @@ public class SerELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         System.out.println(JsonUtil.toJsonString(name2Value));
         Assertions.assertEquals("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nSER(PRE(node(\"p\")),node(\"a\"),SER(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\").data(thenData),FINALLY(node(\"f\"))).tag(\"this is a tag\");",
-                ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL());
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL());
         System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nSER(PRE(node(\"p\")),node(\"a\"),SER(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\").data(thenData),FINALLY(node(\"f\"))).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL()));
     }
     // 格式化输出测试
     @Test
@@ -138,25 +139,25 @@ public class SerELBuilderTest extends BaseTest {
         name2Value.put("name", "zhangsan");
         name2Value.put("age", 18);
         Assertions.assertEquals("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nSER(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\").data(thenData),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");",
-                ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL(true));
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true));
         System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nSER(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\").data(thenData),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true)));
     }
     // data属性测试 Json字符串赋值data
     @Test
     public void testSer15(){
         Assertions.assertEquals("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nSER(PRE(node(\"p\")),node(\"a\"),SER(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\").data(thenData),FINALLY(node(\"f\"))).tag(\"this is a tag\");",
-                ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre("p").finallyOpt("f").toEL());
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL());
 //        System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nSER(PRE(node(\"p\")),node(\"a\"),SER(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\").data(thenData),FINALLY(node(\"f\"))).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre("p").finallyOpt("f").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL()));
     }
     // 格式化输出测试 Json字符串赋值data
     @Test
     public void testSer16(){
         Assertions.assertEquals("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nSER(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\").data(thenData),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");",
-                ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre("p").finallyOpt("f").toEL(true));
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true));
 //        System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nSER(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\").data(thenData),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre("p").finallyOpt("f").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true)));
     }
     private static class ParamClass{
         private String name;
@@ -175,9 +176,9 @@ public class SerELBuilderTest extends BaseTest {
         name2Value.name = "zhangsan";
         name2Value.age = 18;
         Assertions.assertEquals("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nSER(PRE(node(\"p\")),node(\"a\"),SER(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\").data(thenData),FINALLY(node(\"f\"))).tag(\"this is a tag\");",
-                ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL());
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL());
         System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nSER(PRE(node(\"p\")),node(\"a\"),SER(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\").data(thenData),FINALLY(node(\"f\"))).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL()));
     }
     // 格式化输出测试
     @Test
@@ -186,26 +187,26 @@ public class SerELBuilderTest extends BaseTest {
         name2Value.name = "zhangsan";
         name2Value.age = 18;
         Assertions.assertEquals("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nSER(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\").data(thenData),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");",
-                ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL(true));
+                ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true));
         System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nSER(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tSER(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\").data(thenData),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a", ELBus.ser("b").ser("c").id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a"), ELBus.ser(ELBus.node("b")).ser(ELBus.node("c")).id("this is a id")).tag("this is a tag").ser(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true)));
     }
     // maxWaitSecond测试
     @Test
     public void testSer19(){
         String expectedStr = "SER(node(\"a\"),node(\"b\")).maxWaitSeconds(5);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ser("a").ser("b").maxWaitSeconds(5).toEL());
+                ELBus.ser(ELBus.node("a")).ser(ELBus.node("b")).maxWaitSeconds(5).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a").ser("b").maxWaitSeconds(5).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a")).ser(ELBus.node("b")).maxWaitSeconds(5).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testSer20(){
         String expectedStr = "SER(\n\tnode(\"a\"),\n\tnode(\"b\")\n).maxWaitSeconds(5);";
         Assertions.assertEquals(expectedStr,
-                ELBus.ser("a").ser("b").maxWaitSeconds(5).toEL(true));
+                ELBus.ser(ELBus.node("a")).ser(ELBus.node("b")).maxWaitSeconds(5).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser("a").ser("b").maxWaitSeconds(5).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.ser(ELBus.node("a")).ser(ELBus.node("b")).maxWaitSeconds(5).toEL(true)));
     }
 }

+ 24 - 24
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/SwitchELBuilderTest.java

@@ -26,9 +26,9 @@ public class SwitchELBuilderTest extends BaseTest {
     public void testSwitch1(){
         String expectedStr = "SWITCH(node(\"a\")).TO(node(\"b\"),node(\"c\"),node(\"d\")).DEFAULT(node(\"f\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.switchOpt("a").to("b", "c", "d").defaultOpt("f").toEL());
+                ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d")).defaultOpt(ELBus.node("f")).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt("a").to("b", "c", "d").defaultOpt("f").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d")).defaultOpt(ELBus.node("f")).toEL()));
     }
 
     // 格式化输出测试
@@ -36,9 +36,9 @@ public class SwitchELBuilderTest extends BaseTest {
     public void testSwitch2(){
         String expectedStr = "SWITCH(node(\"a\")).TO(\n\tnode(\"b\"),\n\tnode(\"c\"),\n\tnode(\"d\")\n).DEFAULT(\n\tnode(\"f\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.switchOpt("a").to("b", "c", "d").defaultOpt("f").toEL(true));
+                ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d")).defaultOpt(ELBus.node("f")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt("a").to("b", "c", "d").defaultOpt("f").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d")).defaultOpt(ELBus.node("f")).toEL(true)));
     }
 
     // switch和THEN when嵌套调用测试
@@ -46,9 +46,9 @@ public class SwitchELBuilderTest extends BaseTest {
     public void testSwitch3(){
         String expectedStr = "SWITCH(node(\"a\")).TO(node(\"b\"),THEN(node(\"c\"),node(\"d\")),WHEN(node(\"e\"),node(\"f\"))).DEFAULT(THEN(node(\"g\"),node(\"h\")));";
         Assertions.assertEquals(expectedStr,
-                ELBus.switchOpt("a").to("b", ELBus.then("c", "d"), ELBus.when("e", "f")).defaultOpt(ELBus.then("g", "h")).toEL());
+                ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.then(ELBus.node("c"), ELBus.node("d")), ELBus.when(ELBus.node("e"), ELBus.node("f"))).defaultOpt(ELBus.then(ELBus.node("g"), ELBus.node("h"))).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt("a").to("b", ELBus.then("c", "d"), ELBus.when("e", "f")).defaultOpt(ELBus.then("g", "h")).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.then(ELBus.node("c"), ELBus.node("d")), ELBus.when(ELBus.node("e"), ELBus.node("f"))).defaultOpt(ELBus.then(ELBus.node("g"), ELBus.node("h"))).toEL()));
     }
 
     // 格式化输出测试
@@ -56,9 +56,9 @@ public class SwitchELBuilderTest extends BaseTest {
     public void testSwitch4(){
         String expectedStr = "SWITCH(node(\"a\")).TO(\n\tnode(\"b\"),\n\tTHEN(\n\t\tnode(\"c\"),\n\t\tnode(\"d\")\n\t),\n\tWHEN(\n\t\tnode(\"e\"),\n\t\tnode(\"f\")\n\t)\n).DEFAULT(\n\tTHEN(\n\t\tnode(\"g\"),\n\t\tnode(\"h\")\n\t)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.switchOpt("a").to("b", ELBus.then("c", "d"), ELBus.when("e", "f")).defaultOpt(ELBus.then("g", "h")).toEL(true));
+                ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.then(ELBus.node("c"), ELBus.node("d")), ELBus.when(ELBus.node("e"), ELBus.node("f"))).defaultOpt(ELBus.then(ELBus.node("g"), ELBus.node("h"))).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt("a").to("b", ELBus.then("c", "d"), ELBus.when("e", "f")).defaultOpt(ELBus.then("g", "h")).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.then(ELBus.node("c"), ELBus.node("d")), ELBus.when(ELBus.node("e"), ELBus.node("f"))).defaultOpt(ELBus.then(ELBus.node("g"), ELBus.node("h"))).toEL(true)));
     }
 
     // 属性设置测试
@@ -66,9 +66,9 @@ public class SwitchELBuilderTest extends BaseTest {
     public void testSwitch5(){
         String expectedStr = "SWITCH(node(\"a\")).TO(node(\"b\"),node(\"c\"),node(\"d\")).id(\"this is a id\").tag(\"this is a tag\").maxWaitSeconds(5);";
         Assertions.assertEquals(expectedStr,
-                ELBus.switchOpt("a").to("b", "c", "d").id("this is a id").tag("this is a tag").maxWaitSeconds(5).toEL());
+                ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d")).id("this is a id").tag("this is a tag").maxWaitSeconds(5).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt("a").to("b", "c", "d").id("this is a id").tag("this is a tag").maxWaitSeconds(5).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d")).id("this is a id").tag("this is a tag").maxWaitSeconds(5).toEL()));
     }
 
     // 格式化输出测试
@@ -76,9 +76,9 @@ public class SwitchELBuilderTest extends BaseTest {
     public void testSwitch6(){
         String expectedStr = "SWITCH(node(\"a\")).TO(\n\tnode(\"b\"),\n\tnode(\"c\"),\n\tnode(\"d\")\n).id(\"this is a id\").tag(\"this is a tag\").maxWaitSeconds(5);";
         Assertions.assertEquals(expectedStr,
-                ELBus.switchOpt("a").to("b", "c", "d").id("this is a id").tag("this is a tag").maxWaitSeconds(5).toEL(true));
+                ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d")).id("this is a id").tag("this is a tag").maxWaitSeconds(5).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt("a").to("b", "c", "d").id("this is a id").tag("this is a tag").maxWaitSeconds(5).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d")).id("this is a id").tag("this is a tag").maxWaitSeconds(5).toEL(true)));
     }
 
     // data属性测试
@@ -89,9 +89,9 @@ public class SwitchELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         String expectedStr = "switchData = '{\"name\":\"zhangsan\",\"age\":18}';\nSWITCH(node(\"a\")).TO(node(\"b\"),node(\"c\"),node(\"d\").data(switchData));";
         Assertions.assertEquals(expectedStr,
-                ELBus.switchOpt("a").to("b", "c", ELBus.node("d").data("switchData", name2Value)).toEL());
+                ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d").data("switchData", name2Value)).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt("a").to("b", "c",ELBus.node("d").data("switchData", name2Value)).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"),ELBus.node("d").data("switchData", name2Value)).toEL()));
     }
 
     @Test
@@ -101,9 +101,9 @@ public class SwitchELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         String expectedStr = "switchData = '{\"name\":\"zhangsan\",\"age\":18}';\nSWITCH(node(\"a\")).TO(\n\tnode(\"b\"),\n\tnode(\"c\"),\n\tnode(\"d\").data(switchData)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.switchOpt("a").to("b", "c", ELBus.node("d").data("switchData", name2Value)).toEL(true));
+                ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d").data("switchData", name2Value)).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt("a").to("b", "c", ELBus.node("d").data("switchData", name2Value)).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d").data("switchData", name2Value)).toEL(true)));
     }
 
     @Test
@@ -111,9 +111,9 @@ public class SwitchELBuilderTest extends BaseTest {
         String jsonStr = "{\"name\":\"zhangsan\",\"age\":18}";
         String expectedStr = "switchData = '{\"name\":\"zhangsan\",\"age\":18}';\nSWITCH(node(\"a\")).TO(node(\"b\"),node(\"c\"),node(\"d\").data(switchData));";
         Assertions.assertEquals(expectedStr,
-                ELBus.switchOpt("a").to("b", "c", ELBus.node("d").data("switchData", jsonStr)).toEL());
+                ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d").data("switchData", jsonStr)).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt("a").to("b", "c", ELBus.node("d").data("switchData", jsonStr)).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d").data("switchData", jsonStr)).toEL()));
     }
 
     @Test
@@ -121,9 +121,9 @@ public class SwitchELBuilderTest extends BaseTest {
         String jsonStr = "{\"name\":\"zhangsan\",\"age\":18}";
         String expectedStr = "switchData = '{\"name\":\"zhangsan\",\"age\":18}';\nSWITCH(node(\"a\")).TO(\n\tnode(\"b\"),\n\tnode(\"c\"),\n\tnode(\"d\").data(switchData)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.switchOpt("a").to("b", "c", ELBus.node("d").data("switchData", jsonStr)).toEL(true));
+                ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d").data("switchData", jsonStr)).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt("a").to("b", "c", ELBus.node("d").data("switchData", jsonStr)).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d").data("switchData", jsonStr)).toEL(true)));
     }
 
     private static class ParamClass{
@@ -144,9 +144,9 @@ public class SwitchELBuilderTest extends BaseTest {
         name2Value.age = 18;
         String expectedStr = "switchData = '{\"name\":\"zhangsan\",\"age\":18}';\nSWITCH(node(\"a\")).TO(node(\"b\"),node(\"c\"),node(\"d\").data(switchData));";
         Assertions.assertEquals(expectedStr,
-                ELBus.switchOpt("a").to("b", "c", ELBus.node("d").data("switchData", name2Value)).toEL());
+                ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d").data("switchData", name2Value)).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt("a").to("b", "c", ELBus.node("d").data("switchData", name2Value)).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d").data("switchData", name2Value)).toEL()));
     }
 
     @Test
@@ -156,9 +156,9 @@ public class SwitchELBuilderTest extends BaseTest {
         name2Value.age = 18;
         String expectedStr = "switchData = '{\"name\":\"zhangsan\",\"age\":18}';\nSWITCH(node(\"a\")).TO(\n\tnode(\"b\"),\n\tnode(\"c\"),\n\tnode(\"d\").data(switchData)\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.switchOpt("a").to("b", "c", ELBus.node("d").data("switchData", name2Value)).toEL(true));
+                ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d").data("switchData", name2Value)).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt("a").to("b", "c", ELBus.node("d").data("switchData", name2Value)).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.switchOpt(ELBus.node("a")).to(ELBus.node("b"), ELBus.node("c"), ELBus.node("d").data("switchData", name2Value)).toEL(true)));
     }
 
 }

+ 43 - 43
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/ThenELBuilderTest.java

@@ -27,108 +27,108 @@ public class ThenELBuilderTest extends BaseTest {
         Map<String, Object> name2Value = new HashMap<String, Object>();
         name2Value.put("name", "zhangsan");
         name2Value.put("age", 18);
-        System.out.println(ELBus.then(ELBus.commonNode("a").data("nodeData", name2Value).tag("tagA").maxWaitSeconds(10).retry(2), ELBus.node("b")).toEL(true));
         String expected = "nodeData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(\n\ta.tag(\"tagA\").data(nodeData).maxWaitSeconds(10).retry(2),\n\tnode(\"b\")\n);";
-        Assertions.assertEquals(expected,
-                ELBus.then(ELBus.commonNode("a").data("nodeData", name2Value).tag("tagA").maxWaitSeconds(10).retry(2), ELBus.node("b")).toEL(true));
+        String actualEl = ELBus.then(ELBus.commonNode("a").data("nodeData", name2Value).tag("tagA").maxWaitSeconds(10).retry(2), ELBus.node("b")).toEL(true);
+        System.out.println(actualEl);
+        Assertions.assertEquals(expected, actualEl);
     }
 
     // then组件测试
     @Test
     public void testThen1(){
         Assertions.assertEquals("THEN(node(\"a\"),node(\"b\"));",
-                ELBus.then("a", "b").toEL());
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", "b").toEL()));
+                ELBus.then(ELBus.node("a"), ELBus.node("b")).toEL());
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.node("b")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testThen2(){
         Assertions.assertEquals("THEN(\n\tnode(\"a\")," +
                         "\n\tnode(\"b\")\n);",
-                ELBus.then("a", "b").toEL(true));
+                ELBus.then(ELBus.node("a"), ELBus.node("b")).toEL(true));
         System.out.println("THEN(\n\tnode(\"a\")," +
                 "\n\tnode(\"b\")\n);");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", "b").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.node("b")).toEL(true)));
     }
     // then组件then方法调用测试
     @Test
     public void testThen3(){
         Assertions.assertEquals("THEN(node(\"a\"),node(\"b\"),node(\"c\"));",
-                ELBus.then("a", "b").then("c").toEL());
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", "b").then("c").toEL()));
+                ELBus.then(ELBus.node("a"), ELBus.node("b")).then(ELBus.node("c")).toEL());
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.node("b")).then(ELBus.node("c")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testThen4(){
         Assertions.assertEquals("THEN(\n\tnode(\"a\"),\n\tnode(\"b\")," +
                         "\n\tnode(\"c\")\n);",
-                ELBus.then("a", "b").then("c").toEL(true));
+                ELBus.then(ELBus.node("a"), ELBus.node("b")).then(ELBus.node("c")).toEL(true));
         System.out.println("THEN(\n\tnode(\"a\"),\n\tnode(\"b\")," +
                 "\n\tnode(\"c\")\n);");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", "b").then("c").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.node("b")).then(ELBus.node("c")).toEL(true)));
     }
     // then组件嵌套调用测试
     @Test
     public void testThen5(){
         Assertions.assertEquals("THEN(node(\"a\"),THEN(node(\"b\"),node(\"c\")),node(\"d\"));",
-                ELBus.then("a", ELBus.then("b").then("c")).then("d").toEL());
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c")).then("d").toEL()));
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c"))).then(ELBus.node("d")).toEL());
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c"))).then(ELBus.node("d")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testThen6(){
         Assertions.assertEquals("THEN(\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n);",
-                ELBus.then("a", ELBus.then("b").then("c")).then("d").toEL(true));
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c"))).then(ELBus.node("d")).toEL(true));
         System.out.println("THEN(\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n);");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c")).then("d").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c"))).then(ELBus.node("d")).toEL(true)));
     }
     // pre组件测试
     @Test
     public void testThen7(){
         Assertions.assertEquals("THEN(PRE(node(\"p\")),PRE(node(\"pp\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")),node(\"d\"));",
-                ELBus.then("a", ELBus.then("b").then("c")).then("d").pre("p").pre("pp").toEL());
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c"))).then(ELBus.node("d")).pre(ELBus.node("p")).pre(ELBus.node("pp")).toEL());
         System.out.println("THEN(PRE(node(\"p\")),PRE(node(\"pp\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")),node(\"d\"));");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c")).then("d").pre("p").pre("pp").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c"))).then(ELBus.node("d")).pre(ELBus.node("p")).pre(ELBus.node("pp")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testThen8(){
         Assertions.assertEquals("THEN(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tPRE(\n\t\tnode(\"pp\")\n\t),\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n);",
-                ELBus.then("a", ELBus.then("b").then("c")).then("d").pre("p").pre("pp").toEL(true));
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c"))).then(ELBus.node("d")).pre(ELBus.node("p")).pre(ELBus.node("pp")).toEL(true));
         System.out.println("THEN(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tPRE(\n\t\tnode(\"pp\")\n\t),\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n);");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c")).then("d").pre("p").pre("pp").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c"))).then(ELBus.node("d")).pre(ELBus.node("p")).pre(ELBus.node("pp")).toEL(true)));
     }
     // pre finally 格式测试
     @Test
     public void testThen9(){
         Assertions.assertEquals("THEN(PRE(node(\"p\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")),node(\"d\"),FINALLY(node(\"f\")));",
-                ELBus.then("a", ELBus.then("b").then("c")).then("d").pre("p").finallyOpt("f").toEL());
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c"))).then(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL());
         System.out.println("THEN(PRE(node(\"p\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")),node(\"d\"),FINALLY(node(\"f\")));");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c")).then("d").pre("p").finallyOpt("f").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c"))).then(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testThen10(){
         Assertions.assertEquals("THEN(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\"),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n);",
-                ELBus.then("a", ELBus.then("b").then("c")).then("d").pre("p").finallyOpt("f").toEL(true));
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c"))).then(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true));
         System.out.println("THEN(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\"),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n);");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c")).then("d").pre("p").finallyOpt("f").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c"))).then(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true)));
     }
     // 属性设置测试
     @Test
     public void testThen11(){
         Assertions.assertEquals("THEN(PRE(node(\"p\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\"),FINALLY(node(\"f\"))).tag(\"this is a tag\");",
-                ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then("d").pre("p").finallyOpt("f").toEL());
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL());
         System.out.println("THEN(PRE(node(\"p\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\"),FINALLY(node(\"f\"))).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then("d").pre("p").finallyOpt("f").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testThen12(){
         Assertions.assertEquals("THEN(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\"),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");",
-                ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then("d").pre("p").finallyOpt("f").toEL(true));
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true));
         System.out.println("THEN(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\"),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then("d").pre("p").finallyOpt("f").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true)));
     }
     // data属性测试
     @Test
@@ -138,9 +138,9 @@ public class ThenELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         System.out.println(JsonUtil.toJsonString(name2Value));
         Assertions.assertEquals("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(PRE(node(\"p\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\").data(thenData),FINALLY(node(\"f\"))).tag(\"this is a tag\");",
-                ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL());
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL());
         System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(PRE(node(\"p\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\").data(thenData),FINALLY(node(\"f\"))).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL()));
     }
     // 格式化输出测试
     @Test
@@ -149,25 +149,25 @@ public class ThenELBuilderTest extends BaseTest {
         name2Value.put("name", "zhangsan");
         name2Value.put("age", 18);
         Assertions.assertEquals("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\").data(thenData),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");",
-                ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL(true));
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true));
         System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\").data(thenData),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true)));
     }
     // data属性测试 Json字符串赋值data
     @Test
     public void testThen15(){
         Assertions.assertEquals("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(PRE(node(\"p\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\").data(thenData),FINALLY(node(\"f\"))).tag(\"this is a tag\");",
-                ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre("p").finallyOpt("f").toEL());
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL());
 //        System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(PRE(node(\"p\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\").data(thenData),FINALLY(node(\"f\"))).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre("p").finallyOpt("f").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL()));
     }
     // 格式化输出测试 Json字符串赋值data
     @Test
     public void testThen16(){
         Assertions.assertEquals("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\").data(thenData),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");",
-                ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre("p").finallyOpt("f").toEL(true));
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true));
 //        System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\").data(thenData),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre("p").finallyOpt("f").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", "{\"name\":\"zhangsan\",\"age\":18}")).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true)));
     }
     private static class ParamClass{
         private String name;
@@ -186,9 +186,9 @@ public class ThenELBuilderTest extends BaseTest {
         name2Value.name = "zhangsan";
         name2Value.age = 18;
         Assertions.assertEquals("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(PRE(node(\"p\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\").data(thenData),FINALLY(node(\"f\"))).tag(\"this is a tag\");",
-                ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL());
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL());
         System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(PRE(node(\"p\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\").data(thenData),FINALLY(node(\"f\"))).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL()));
     }
     // 格式化输出测试
     @Test
@@ -197,26 +197,26 @@ public class ThenELBuilderTest extends BaseTest {
         name2Value.name = "zhangsan";
         name2Value.age = 18;
         Assertions.assertEquals("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\").data(thenData),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");",
-                ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL(true));
+                ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true));
         System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(\n\tPRE(\n\t\tnode(\"p\")\n\t),\n\tnode(\"a\"),\n\tTHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\").data(thenData),\n\tFINALLY(\n\t\tnode(\"f\")\n\t)\n).tag(\"this is a tag\");");
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre("p").finallyOpt("f").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a"), ELBus.then(ELBus.node("b")).then(ELBus.node("c")).id("this is a id")).tag("this is a tag").then(ELBus.node("d").data("thenData", name2Value)).pre(ELBus.node("p")).finallyOpt(ELBus.node("f")).toEL(true)));
     }
     // maxWaitSecond测试
     @Test
     public void testThen19(){
         String expectedStr = "THEN(node(\"a\"),node(\"b\")).maxWaitSeconds(5);";
         Assertions.assertEquals(expectedStr,
-                ELBus.then("a").then("b").maxWaitSeconds(5).toEL());
+                ELBus.then(ELBus.node("a")).then(ELBus.node("b")).maxWaitSeconds(5).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a").then("b").maxWaitSeconds(5).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a")).then(ELBus.node("b")).maxWaitSeconds(5).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testThen20(){
         String expectedStr = "THEN(\n\tnode(\"a\"),\n\tnode(\"b\")\n).maxWaitSeconds(5);";
         Assertions.assertEquals(expectedStr,
-                ELBus.then("a").then("b").maxWaitSeconds(5).toEL(true));
+                ELBus.then(ELBus.node("a")).then(ELBus.node("b")).maxWaitSeconds(5).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then("a").then("b").maxWaitSeconds(5).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.then(ELBus.node("a")).then(ELBus.node("b")).maxWaitSeconds(5).toEL(true)));
     }
 }

+ 37 - 38
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/WhenELBuilderTest.java

@@ -10,7 +10,6 @@ import org.junit.jupiter.api.Test;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.test.context.SpringBootTest;
 
-import javax.annotation.meta.When;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -28,105 +27,105 @@ public class WhenELBuilderTest extends BaseTest {
     public void testWhen1(){
         String expectedStr = "WHEN(node(\"a\"),node(\"b\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", "b").toEL());
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", "b").toEL()));
+                ELBus.when(ELBus.node("a"), ELBus.node("b")).toEL());
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.node("b")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testWhen2(){
         String expectedStr = "WHEN(\n\tnode(\"a\"),\n\tnode(\"b\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", "b").toEL(true));
+                ELBus.when(ELBus.node("a"), ELBus.node("b")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", "b").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.node("b")).toEL(true)));
     }
     // then组件then方法调用测试
     @Test
     public void testWhen3(){
         String expectedStr = "WHEN(node(\"a\"),node(\"b\"),node(\"c\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", "b").when("c").toEL());
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", "b").when("c").toEL()));
+                ELBus.when(ELBus.node("a"), ELBus.node("b")).when(ELBus.node("c")).toEL());
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.node("b")).when(ELBus.node("c")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testWhen4(){
         String expectedStr = "WHEN(\n\tnode(\"a\"),\n\tnode(\"b\"),\n\tnode(\"c\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", "b").when("c").toEL(true));
+                ELBus.when(ELBus.node("a"), ELBus.node("b")).when(ELBus.node("c")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", "b").when("c").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.node("b")).when(ELBus.node("c")).toEL(true)));
     }
     // then组件嵌套调用测试
     @Test
     public void testWhen5(){
         String expectedStr = "WHEN(node(\"a\"),WHEN(node(\"b\"),node(\"c\")),node(\"d\"));";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", ELBus.when("b").when("c")).when("d").toEL());
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", ELBus.when("b").when("c")).when("d").toEL()));
+                ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c"))).when(ELBus.node("d")).toEL());
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c"))).when(ELBus.node("d")).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testWhen6(){
         String expectedStr = "WHEN(\n\tnode(\"a\"),\n\tWHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t),\n\tnode(\"d\")\n);";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", ELBus.when("b").when("c")).when("d").toEL(true));
+                ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c"))).when(ELBus.node("d")).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", ELBus.when("b").when("c")).when("d").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c"))).when(ELBus.node("d")).toEL(true)));
     }
     // WHEN特有属性测试 any ignoreError customThreadExecutor must
     @Test
     public void testWhen7(){
         String expectedStr = "WHEN(node(\"a\"),node(\"b\"),WHEN(node(\"c\"),node(\"d\")).any(true).threadPool(\"com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1\").id(\"node1\")).ignoreError(true).must(\"a\", \"task1\", \"node1\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", "b", ELBus.when("c").when("d").id("node1").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").any(true)).ignoreError(true).must("a", "task1", "node1").toEL());
+                ELBus.when(ELBus.node("a"), ELBus.node("b"), ELBus.when(ELBus.node("c")).when(ELBus.node("d")).id("node1").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").any(true)).ignoreError(true).must("a", "task1", "node1").toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", "b", ELBus.when("c").when("d").id("node1").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").any(true)).ignoreError(true).must("a", "task1", "node1").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.node("b"), ELBus.when(ELBus.node("c")).when(ELBus.node("d")).id("node1").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").any(true)).ignoreError(true).must("a", "task1", "node1").toEL()));
     }
     // 格式化输出测试
     @Test
     public void testWhen8(){
         String expectedStr = "WHEN(\n\tnode(\"a\"),\n\tnode(\"b\"),\n\tWHEN(\n\t\tnode(\"c\"),\n\t\tnode(\"d\")\n\t).any(true).threadPool(\"com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1\").id(\"node1\")\n).ignoreError(true).must(\"a\", \"task1\", \"node1\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", "b", ELBus.when("c").when("d").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").id("node1").any(true)).ignoreError(true).must("a", "task1", "node1").toEL(true));
+                ELBus.when(ELBus.node("a"), ELBus.node("b"), ELBus.when(ELBus.node("c")).when(ELBus.node("d")).customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").id("node1").any(true)).ignoreError(true).must("a", "task1", "node1").toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", "b", ELBus.when("c").when("d").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").id("node1").any(true)).ignoreError(true).must("a", "task1", "node1").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.node("b"), ELBus.when(ELBus.node("c")).when(ELBus.node("d")).customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1").id("node1").any(true)).ignoreError(true).must("a", "task1", "node1").toEL(true)));
     }
     // maxWaitSeconds 属性测试
     @Test
     public void testWhen9(){
         String expectedStr = "WHEN(node(\"a\"),node(\"b\")).maxWaitSeconds(5);";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", "b").maxWaitSeconds(5).toEL());
+                ELBus.when(ELBus.node("a"), ELBus.node("b")).maxWaitSeconds(5).toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", "b").maxWaitSeconds(5).toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.node("b")).maxWaitSeconds(5).toEL()));
     }
     // 格式化输出测试
     @Test
     public void testWhen10(){
         String expectedStr = "WHEN(\n\tnode(\"a\"),\n\tnode(\"b\")\n).maxWaitSeconds(5);";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", "b").maxWaitSeconds(5).toEL(true));
+                ELBus.when(ELBus.node("a"), ELBus.node("b")).maxWaitSeconds(5).toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", "b").maxWaitSeconds(5).toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.node("b")).maxWaitSeconds(5).toEL(true)));
     }
     // 属性设置测试
     @Test
     public void testWhen11(){
         String expectedStr = "WHEN(node(\"a\"),WHEN(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\")).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", ELBus.when("b").when("c").id("this is a id")).when("d").tag("this is a tag").toEL());
+                ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c")).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", ELBus.when("b").when("c").id("this is a id")).when("d").tag("this is a tag").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c")).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL()));
     }
     // 格式化输出测试
     @Test
     public void testWhen12(){
         String expectedStr = "WHEN(\n\tnode(\"a\"),\n\tWHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\")\n\t).id(\"this is a id\"),\n\tnode(\"d\")\n).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", ELBus.when("b").when("c").id("this is a id")).when("d").tag("this is a tag").toEL(true));
+                ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c")).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", ELBus.when("b").when("c").id("this is a id")).when("d").tag("this is a tag").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c")).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL(true)));
     }
     // data属性测试
     @Test
@@ -137,9 +136,9 @@ public class WhenELBuilderTest extends BaseTest {
         System.out.println(JsonUtil.toJsonString(name2Value));
         String expectedStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nWHEN(node(\"a\"),WHEN(node(\"b\"),node(\"c\").data(whenData)).id(\"this is a id\"),node(\"d\")).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", ELBus.when("b").when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when("d").tag("this is a tag").toEL(false));
+                ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL(false));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", ELBus.when("b").when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when("d").tag("this is a tag").toEL(false)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL(false)));
     }
     // 格式化输出测试
     @Test
@@ -149,27 +148,27 @@ public class WhenELBuilderTest extends BaseTest {
         name2Value.put("age", 18);
         String expectedStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nWHEN(\n\tnode(\"a\"),\n\tWHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(whenData)\n\t).id(\"this is a id\"),\n\tnode(\"d\")\n).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", ELBus.when("b").when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when("d").tag("this is a tag").toEL(true));
+                ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", ELBus.when("b").when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when("d").tag("this is a tag").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL(true)));
     }
     // data属性测试 Json字符串赋值data
     @Test
     public void testWhen15(){
         String expectedStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nWHEN(node(\"a\"),WHEN(node(\"b\"),node(\"c\").data(whenData)).id(\"this is a id\"),node(\"d\")).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", ELBus.when("b").when(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).when("d").tag("this is a tag").toEL());
+                ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", ELBus.when("b").when(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).when("d").tag("this is a tag").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL()));
     }
     // 格式化输出测试 Json字符串赋值data
     @Test
     public void testWhen16(){
         String expectedStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nWHEN(\n\tnode(\"a\"),\n\tWHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(whenData)\n\t).id(\"this is a id\"),\n\tnode(\"d\")\n).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", ELBus.when("b").when(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).when("d").tag("this is a tag").toEL(true));
+                ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", ELBus.when("b").when(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).when("d").tag("this is a tag").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c").data("whenData", "{\"name\":\"zhangsan\",\"age\":18}")).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL(true)));
     }
     private static class ParamClass{
         private String name;
@@ -189,9 +188,9 @@ public class WhenELBuilderTest extends BaseTest {
         name2Value.age = 18;
         String expectedStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nWHEN(node(\"a\"),WHEN(node(\"b\"),node(\"c\").data(whenData)).id(\"this is a id\"),node(\"d\")).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", ELBus.when("b").when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when("d").tag("this is a tag").toEL());
+                ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL());
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", ELBus.when("b").when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when("d").tag("this is a tag").toEL()));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL()));
     }
     // 格式化输出测试
     @Test
@@ -201,14 +200,14 @@ public class WhenELBuilderTest extends BaseTest {
         name2Value.age = 18;
         String expectedStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nWHEN(\n\tnode(\"a\"),\n\tWHEN(\n\t\tnode(\"b\"),\n\t\tnode(\"c\").data(whenData)\n\t).id(\"this is a id\"),\n\tnode(\"d\")\n).tag(\"this is a tag\");";
         Assertions.assertEquals(expectedStr,
-                ELBus.when("a", ELBus.when("b").when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when("d").tag("this is a tag").toEL(true));
+                ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL(true));
         System.out.println(expectedStr);
-        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when("a", ELBus.when("b").when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when("d").tag("this is a tag").toEL(true)));
+        Assertions.assertTrue(LiteFlowChainELBuilder.validate(ELBus.when(ELBus.node("a"), ELBus.when(ELBus.node("b")).when(ELBus.node("c").data("whenData", name2Value)).id("this is a id")).when(ELBus.node("d")).tag("this is a tag").toEL(true)));
     }
 
     @Test
     public void testWHEN(){
-        WhenELWrapper el = ELBus.when("a", "b", "c").customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1");
+        WhenELWrapper el = ELBus.when(ELBus.node("a"), ELBus.node("b"), ELBus.node("c")).customThreadExecutor("com.yomahub.liteflow.test.builder.customTreadExecutor.CustomThreadExecutor1");
         Assertions.assertTrue(LiteFlowChainELBuilder.validate(el.toEL()));
     }
 }

+ 3 - 2
liteflow-testcase-el/liteflow-testcase-el-builder/src/test/java/com/yomahub/liteflow/test/builder/customTreadExecutor/CustomThreadExecutor1.java

@@ -11,6 +11,7 @@ import java.util.concurrent.ExecutorService;
  * EL表达式装配并执行测试
  *
  * @author gezuao
+ * @author jason
  * @since 2.11.1
  */
 public class CustomThreadExecutor1 implements ExecutorBuilder {
@@ -22,8 +23,8 @@ public class CustomThreadExecutor1 implements ExecutorBuilder {
 		if (ObjectUtil.isNull(liteflowConfig)) {
 			liteflowConfig = new LiteflowConfig();
 		}
-		return buildDefaultExecutor(liteflowConfig.getWhenMaxWorkers(), liteflowConfig.getWhenMaxWorkers(),
-				liteflowConfig.getWhenQueueLimit(), "customer-when-1-thead-");
+		return buildDefaultExecutor(liteflowConfig.getGlobalThreadPoolSize(), liteflowConfig.getGlobalThreadPoolSize(),
+									liteflowConfig.getGlobalThreadPoolQueueSize(), "customer-when-1-thead-");
 	}
 
 }

+ 72 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/ChainThreadPoolELSpringbootTest.java

@@ -0,0 +1,72 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.collection.ListUtil;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.slot.DefaultContext;
+import com.yomahub.liteflow.test.BaseTest;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.noear.solon.annotation.Import;
+import org.noear.solon.annotation.Inject;
+import org.noear.solon.test.SolonTest;
+
+import java.util.List;
+
+/**
+ * springboot环境下chain线程池隔离测试
+ */
+@SolonTest
+@Import(profiles = "classpath:/chainThreadPool/application.properties")
+public class ChainThreadPoolELSpringbootTest extends BaseTest {
+
+
+    @Inject
+    private FlowExecutor flowExecutor;
+
+    /**
+     * 测试WHEN上全局线程池和chain线程池隔离-优先以chain上为准
+     */
+    @Test
+    public void testChainThreadPool() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-chain-thead"));
+    }
+
+    /**
+     * 测试FOR上全局线程池和chain线程池隔离-优先以chain上为准
+     */
+    @Test
+    public void testChainThreadPool2() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain2", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-chain-thead"));
+    }
+
+    /**
+     * 测试WHILE上全局线程池和chain线程池隔离-优先以chain上为准
+     */
+    @Test
+    public void testChainThreadPool3() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain3", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-chain-thead"));
+    }
+
+    /**
+     * 测试ITERATOR上全局线程池和chain线程池隔离-优先以chain上为准
+     */
+    @Test
+    public void testChainThreadPool4() {
+        List<String> list = ListUtil.toList("1", "2", "3", "4", "5");
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain4", list);
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-chain-thead"));
+    }
+
+}

+ 73 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/ConditionThreadPoolELSpringbootTest.java

@@ -0,0 +1,73 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.collection.ListUtil;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.slot.DefaultContext;
+import com.yomahub.liteflow.test.BaseTest;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.noear.solon.annotation.Import;
+import org.noear.solon.annotation.Inject;
+import org.noear.solon.test.SolonTest;
+
+import java.util.List;
+
+/**
+ * springboot环境下chain线程池隔离测试
+ */
+
+@SolonTest
+@Import(profiles = "classpath:/chainThreadPool/application2.properties")
+public class ConditionThreadPoolELSpringbootTest extends BaseTest {
+
+
+    @Inject
+    private FlowExecutor flowExecutor;
+
+    /**
+     * 测试WEHN上condition线程池和chain线程池隔离-优先以WHEN上为准
+     */
+    @Test
+    public void testConditionThreadPool() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-when-thead"));
+    }
+
+    /**
+     * 测试FOR上condition线程池和chain线程池隔离-优先以FOR上为准
+     */
+    @Test
+    public void testConditionThreadPool2() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain2", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-loop-thead"));
+    }
+
+    /**
+     * 测试WHILE上condition线程池和chain线程池隔离-优先以WHILE上为准
+     */
+    @Test
+    public void testConditionThreadPool3() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain3", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-loop-thead"));
+    }
+
+    /**
+     * 测试ITERATOR上condition线程池和chain线程池隔离-优先以ITERATOR上为准
+     */
+    @Test
+    public void testConditionThreadPool4() {
+        List<String> list = ListUtil.toList("1", "2", "3", "4", "5");
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain4", list);
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-loop-thead"));
+    }
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomChainThreadExecutor.java

@@ -0,0 +1,23 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.thread.ExecutorBuilder;
+
+import java.util.concurrent.ExecutorService;
+
+public class CustomChainThreadExecutor implements ExecutorBuilder {
+
+    @Override
+    public ExecutorService buildExecutor() {
+        LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
+        // 只有在非spring的场景下liteflowConfig才会为null
+        if (ObjectUtil.isNull(liteflowConfig)) {
+            liteflowConfig = new LiteflowConfig();
+        }
+        return buildDefaultExecutor(16, 16,
+                                    512, "customer-chain-thead");
+    }
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomGlobalThreadExecutor.java

@@ -0,0 +1,23 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.thread.ExecutorBuilder;
+
+import java.util.concurrent.ExecutorService;
+
+public class CustomGlobalThreadExecutor implements ExecutorBuilder {
+
+    @Override
+    public ExecutorService buildExecutor() {
+        LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
+        // 只有在非spring的场景下liteflowConfig才会为null
+        if (ObjectUtil.isNull(liteflowConfig)) {
+            liteflowConfig = new LiteflowConfig();
+        }
+        return buildDefaultExecutor(16, 16,
+                                    512, "customer-global-thead");
+    }
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomLoopThreadExecutor.java

@@ -0,0 +1,23 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.thread.ExecutorBuilder;
+
+import java.util.concurrent.ExecutorService;
+
+public class CustomLoopThreadExecutor implements ExecutorBuilder {
+
+    @Override
+    public ExecutorService buildExecutor() {
+        LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
+        // 只有在非spring的场景下liteflowConfig才会为null
+        if (ObjectUtil.isNull(liteflowConfig)) {
+            liteflowConfig = new LiteflowConfig();
+        }
+        return buildDefaultExecutor(16, 16,
+                                    512, "customer-loop-thead");
+    }
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomWhenThreadExecutor.java

@@ -0,0 +1,23 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.thread.ExecutorBuilder;
+
+import java.util.concurrent.ExecutorService;
+
+public class CustomWhenThreadExecutor implements ExecutorBuilder {
+
+    @Override
+    public ExecutorService buildExecutor() {
+        LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
+        // 只有在非spring的场景下liteflowConfig才会为null
+        if (ObjectUtil.isNull(liteflowConfig)) {
+            liteflowConfig = new LiteflowConfig();
+        }
+        return buildDefaultExecutor(16, 16,
+                                    512, "customer-when-thead");
+    }
+
+}

+ 71 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/GlobalThreadPoolELSpringbootTest.java

@@ -0,0 +1,71 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.collection.ListUtil;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.slot.DefaultContext;
+import com.yomahub.liteflow.test.BaseTest;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.noear.solon.annotation.Import;
+import org.noear.solon.annotation.Inject;
+import org.noear.solon.test.SolonTest;
+
+import java.util.List;
+
+/**
+ * springboot环境下Global线程池隔离测试
+ */
+@SolonTest
+@Import(profiles = "classpath:/chainThreadPool/application3.properties")
+public class GlobalThreadPoolELSpringbootTest extends BaseTest {
+
+    @Inject
+    private FlowExecutor flowExecutor;
+
+    /**
+     * 测试WHEN上全局线程池
+     */
+    @Test
+    public void testGlobalThreadPool() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-global-thead"));
+    }
+
+    /**
+     * 测试FOR上全局线程池
+     */
+    @Test
+    public void testGlobalThreadPool2() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain2", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-global-thead"));
+    }
+
+    /**
+     * 测试WHILE上全局线程池
+     */
+    @Test
+    public void testGlobalThreadPool3() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain3", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-global-thead"));
+    }
+
+    /**
+     * 测试ITERATOR上全局线程池
+     */
+    @Test
+    public void testGlobalThreadPool4() {
+        List<String> list = ListUtil.toList("1", "2", "3", "4", "5");
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain4", list);
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-global-thead"));
+    }
+
+}

+ 81 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/chainThreadPool/cmp/CmpConfig.java

@@ -0,0 +1,81 @@
+package com.yomahub.liteflow.test.chainThreadPool.cmp;
+
+import com.yomahub.liteflow.annotation.LiteflowComponent;
+import com.yomahub.liteflow.annotation.LiteflowMethod;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
+import com.yomahub.liteflow.enums.NodeTypeEnum;
+import com.yomahub.liteflow.slot.DefaultContext;
+
+import java.util.Iterator;
+import java.util.List;
+
+@LiteflowComponent
+public class CmpConfig {
+
+	@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "a")
+	public void processA(NodeComponent bindCmp) {
+
+		System.out.println("ACmp executed!");
+	}
+
+	@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "b")
+	public void processB(NodeComponent bindCmp) {
+		DefaultContext context = bindCmp.getFirstContextBean();
+		context.setData("threadName", Thread.currentThread().getName());
+		System.out.println("BCmp executed!");
+	}
+
+
+	@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "d")
+	public void processD(NodeComponent bindCmp) {
+		DefaultContext context = bindCmp.getFirstContextBean();
+		String key = "test";
+		if (context.hasData(key)) {
+			int count = context.getData(key);
+			context.setData(key, ++count);
+		} else {
+			context.setData(key, 1);
+		}
+	}
+
+	@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "f")
+	public void processE(NodeComponent bindCmp) {
+		DefaultContext context = bindCmp.getFirstContextBean();
+		context.setData("threadName", Thread.currentThread().getName());
+		System.out.println("FCmp executed!");
+	}
+
+	@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "i")
+	public void processI(NodeComponent bindCmp) {
+		DefaultContext context = bindCmp.getFirstContextBean();
+		context.setData("threadName", Thread.currentThread().getName());
+		System.out.println("ICmp executed!");
+	}
+
+	@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_ITERATOR, nodeId = "it", nodeType = NodeTypeEnum.ITERATOR)
+	public Iterator<String> processIT(NodeComponent bindCmp) {
+		List<String> list = bindCmp.getRequestData();
+		return list.iterator();
+	}
+
+	@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "w")
+	public void processW(NodeComponent bindCmp) {
+		DefaultContext context = bindCmp.getFirstContextBean();
+		context.setData("threadName", Thread.currentThread().getName());
+		System.out.println("WCmp executed!");
+	}
+
+	@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_BOOLEAN, nodeId = "z", nodeType = NodeTypeEnum.BOOLEAN)
+	public boolean processZ(NodeComponent bindCmp) {
+		DefaultContext context = bindCmp.getFirstContextBean();
+		String key = "test";
+		if (context.hasData(key)) {
+			int count = context.getData("test");
+			return count < 5;
+		} else {
+			return true;
+		}
+	}
+
+}

+ 2 - 2
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java

@@ -16,8 +16,8 @@ public class CustomThreadExecutor1 implements ExecutorBuilder {
 		if (ObjectUtil.isNull(liteflowConfig)) {
 			liteflowConfig = new LiteflowConfig();
 		}
-		return buildDefaultExecutor(liteflowConfig.getWhenMaxWorkers(), liteflowConfig.getWhenMaxWorkers(),
-				liteflowConfig.getWhenQueueLimit(), "customer-when-1-thead-");
+		return buildDefaultExecutor(liteflowConfig.getGlobalThreadPoolSize(), liteflowConfig.getGlobalThreadPoolSize(),
+									liteflowConfig.getGlobalThreadPoolQueueSize(), "customer-when-1-thead-");
 	}
 
 }

+ 2 - 2
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java

@@ -16,8 +16,8 @@ public class CustomThreadExecutor2 implements ExecutorBuilder {
 		if (ObjectUtil.isNull(liteflowConfig)) {
 			liteflowConfig = new LiteflowConfig();
 		}
-		return buildDefaultExecutor(liteflowConfig.getWhenMaxWorkers(), liteflowConfig.getWhenMaxWorkers(),
-				liteflowConfig.getWhenQueueLimit(), "customer-when-2-thead-");
+		return buildDefaultExecutor(liteflowConfig.getGlobalThreadPoolSize(), liteflowConfig.getGlobalThreadPoolSize(),
+									liteflowConfig.getGlobalThreadPoolQueueSize(), "customer-when-2-thead-");
 	}
 
 }

+ 2 - 2
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java

@@ -16,8 +16,8 @@ public class CustomThreadExecutor3 implements ExecutorBuilder {
 		if (ObjectUtil.isNull(liteflowConfig)) {
 			liteflowConfig = new LiteflowConfig();
 		}
-		return buildDefaultExecutor(liteflowConfig.getWhenMaxWorkers(), liteflowConfig.getWhenMaxWorkers(),
-				liteflowConfig.getWhenQueueLimit(), "customer-when-3-thead-");
+		return buildDefaultExecutor(liteflowConfig.getGlobalThreadPoolSize(), liteflowConfig.getGlobalThreadPoolSize(),
+									liteflowConfig.getGlobalThreadPoolQueueSize(), "customer-when-3-thead-");
 	}
 
 }

+ 1 - 1
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolELDeclMultiSpringbootTest.java

@@ -35,7 +35,7 @@ public class CustomWhenThreadPoolELDeclMultiSpringbootTest extends BaseTest {
 		LiteflowResponse response = flowExecutor.execute2Resp("chain", "arg");
 		DefaultContext context = response.getFirstContextBean();
 		Assertions.assertTrue(response.isSuccess());
-		Assertions.assertTrue(context.getData("threadName").toString().startsWith("when-thread-1"));
+		Assertions.assertTrue(context.getData("threadName").toString().startsWith("global-thread-1"));
 	}
 
 	/**

+ 2 - 2
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/java/com/yomahub/liteflow/test/parallelLoop/CustomThreadExecutor.java

@@ -16,8 +16,8 @@ public class CustomThreadExecutor implements ExecutorBuilder {
 		if (ObjectUtil.isNull(liteflowConfig)) {
 			liteflowConfig = new LiteflowConfig();
 		}
-		return buildDefaultExecutor(liteflowConfig.getParallelMaxWorkers(), liteflowConfig.getParallelMaxWorkers(),
-				liteflowConfig.getParallelQueueLimit(), "customer-loop-thead-");
+		return buildDefaultExecutor(liteflowConfig.getGlobalThreadPoolSize(), liteflowConfig.getGlobalThreadPoolSize(),
+									liteflowConfig.getGlobalThreadPoolQueueSize(), "customer-loop-thead-");
 	}
 
 }

+ 1 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/chainThreadPool/application.properties

@@ -0,0 +1 @@
+liteflow.rule-source=chainThreadPool/flow.el.xml

+ 2 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/chainThreadPool/application2.properties

@@ -0,0 +1,2 @@
+liteflow.rule-source=chainThreadPool/flow2.el.xml
+liteflow.when-thread-pool-isolate=true

+ 4 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/chainThreadPool/application3.properties

@@ -0,0 +1,4 @@
+liteflow.rule-source=chainThreadPool/flow3.el.xml
+liteflow.global-thread-pool-size=16
+liteflow.global-thread-pool-queue-size=512
+liteflow.global-thread-pool-executor-class=com.yomahub.liteflow.test.chainThreadPool.CustomGlobalThreadExecutor

+ 22 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/chainThreadPool/flow.el.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<flow>
+    <chain name="chain1"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        WHEN(a,b);
+    </chain>
+
+    <chain name="chain2"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        FOR(5).parallel(true).DO(THEN(a,f));
+    </chain>
+
+    <chain name="chain3"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        WHILE(z).parallel(true).DO(THEN(w,d));
+    </chain>
+
+    <chain name="chain4"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        ITERATOR(it).parallel(true).DO(THEN(a,i));
+    </chain>
+</flow>

+ 22 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/chainThreadPool/flow2.el.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<flow>
+    <chain name="chain1"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        WHEN(a,b).threadPool("com.yomahub.liteflow.test.chainThreadPool.CustomWhenThreadExecutor");
+    </chain>
+
+    <chain name="chain2"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        FOR(5).parallel(true).DO(THEN(a,f)).threadPool("com.yomahub.liteflow.test.chainThreadPool.CustomLoopThreadExecutor");
+    </chain>
+
+    <chain name="chain3"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        WHILE(z).parallel(true).DO(THEN(w,d)).threadPool("com.yomahub.liteflow.test.chainThreadPool.CustomLoopThreadExecutor");
+    </chain>
+
+    <chain name="chain4"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        ITERATOR(it).parallel(true).DO(THEN(a,i)).threadPool("com.yomahub.liteflow.test.chainThreadPool.CustomLoopThreadExecutor");
+    </chain>
+</flow>

+ 19 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/chainThreadPool/flow3.el.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<flow>
+    <chain name="chain1">
+        WHEN(a,b);
+    </chain>
+
+    <chain name="chain2">
+        FOR(5).parallel(true).DO(THEN(a,f)
+        );
+    </chain>
+
+    <chain name="chain3">
+        WHILE(z).parallel(true).DO(THEN(w,d));
+    </chain>
+
+    <chain name="chain4">
+        ITERATOR(it).parallel(true).DO(THEN(a,i));
+    </chain>
+</flow>

+ 3 - 5
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/comments/flow.el.xml

@@ -1,15 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <flow>
     <chain name="chain1">
-        // 单行注释
+        /**
+        * 多行注释
+        **/
         THEN(
-            // 单行注释
             a,
             b,
             WHEN(
-                /**
-                * 多行注释
-                */
                 c,
                 b
             )

+ 3 - 3
liteflow-testcase-el/liteflow-testcase-el-declare-multi-solon/src/test/resources/parallelLoop/application.properties

@@ -1,4 +1,4 @@
 liteflow.rule-source=parallelLoop/flow.xml
-liteflow.parallel-max-workers = 10
-liteflow.parallel-queue-limit = 1024
-liteflow.parallel-loop-executor-class =com.yomahub.liteflow.test.parallelLoop.CustomThreadExecutor
+liteflow.global-thread-pool-size=16
+liteflow.global-thread-pool-queue-size=512
+liteflow.global-thread-pool-executor-class=com.yomahub.liteflow.test.parallelLoop.CustomThreadExecutor

+ 79 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/ChainThreadPoolELSpringbootTest.java

@@ -0,0 +1,79 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.collection.ListUtil;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.slot.DefaultContext;
+import com.yomahub.liteflow.test.BaseTest;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.test.context.TestPropertySource;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * springboot环境下chain线程池隔离测试
+ */
+@TestPropertySource(value = "classpath:/chainThreadPool/application.properties")
+@SpringBootTest(classes = ChainThreadPoolELSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.chainThreadPool.cmp"})
+public class ChainThreadPoolELSpringbootTest extends BaseTest {
+
+    private final Logger log = LoggerFactory.getLogger(this.getClass());
+
+    @Resource
+    private FlowExecutor flowExecutor;
+
+    /**
+     * 测试WHEN上全局线程池和chain线程池隔离-优先以chain上为准
+     */
+    @Test
+    public void testChainThreadPool() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-chain-thead"));
+    }
+
+    /**
+     * 测试FOR上全局线程池和chain线程池隔离-优先以chain上为准
+     */
+    @Test
+    public void testChainThreadPool2() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain2", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-chain-thead"));
+    }
+
+    /**
+     * 测试WHILE上全局线程池和chain线程池隔离-优先以chain上为准
+     */
+    @Test
+    public void testChainThreadPool3() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain3", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-chain-thead"));
+    }
+
+    /**
+     * 测试ITERATOR上全局线程池和chain线程池隔离-优先以chain上为准
+     */
+    @Test
+    public void testChainThreadPool4() {
+        List<String> list = ListUtil.toList("1", "2", "3", "4", "5");
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain4", list);
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-chain-thead"));
+    }
+
+}

+ 79 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/ConditionThreadPoolELSpringbootTest.java

@@ -0,0 +1,79 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.collection.ListUtil;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.slot.DefaultContext;
+import com.yomahub.liteflow.test.BaseTest;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.test.context.TestPropertySource;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * springboot环境下chain线程池隔离测试
+ */
+@TestPropertySource(value = "classpath:/chainThreadPool/application2.properties")
+@SpringBootTest(classes = ConditionThreadPoolELSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.chainThreadPool.cmp"})
+public class ConditionThreadPoolELSpringbootTest extends BaseTest {
+
+    private final Logger log = LoggerFactory.getLogger(this.getClass());
+
+    @Resource
+    private FlowExecutor flowExecutor;
+
+    /**
+     * 测试WEHN上condition线程池和chain线程池隔离-优先以WHEN上为准
+     */
+    @Test
+    public void testConditionThreadPool() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-when-thead"));
+    }
+
+    /**
+     * 测试FOR上condition线程池和chain线程池隔离-优先以FOR上为准
+     */
+    @Test
+    public void testConditionThreadPool2() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain2", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-loop-thead"));
+    }
+
+    /**
+     * 测试WHILE上condition线程池和chain线程池隔离-优先以WHILE上为准
+     */
+    @Test
+    public void testConditionThreadPool3() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain3", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-loop-thead"));
+    }
+
+    /**
+     * 测试ITERATOR上condition线程池和chain线程池隔离-优先以ITERATOR上为准
+     */
+    @Test
+    public void testConditionThreadPool4() {
+        List<String> list = ListUtil.toList("1", "2", "3", "4", "5");
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain4", list);
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-loop-thead"));
+    }
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomChainThreadExecutor.java

@@ -0,0 +1,23 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.thread.ExecutorBuilder;
+
+import java.util.concurrent.ExecutorService;
+
+public class CustomChainThreadExecutor implements ExecutorBuilder {
+
+    @Override
+    public ExecutorService buildExecutor() {
+        LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
+        // 只有在非spring的场景下liteflowConfig才会为null
+        if (ObjectUtil.isNull(liteflowConfig)) {
+            liteflowConfig = new LiteflowConfig();
+        }
+        return buildDefaultExecutor(16, 16,
+                                    512, "customer-chain-thead");
+    }
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomGlobalThreadExecutor.java

@@ -0,0 +1,23 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.thread.ExecutorBuilder;
+
+import java.util.concurrent.ExecutorService;
+
+public class CustomGlobalThreadExecutor implements ExecutorBuilder {
+
+    @Override
+    public ExecutorService buildExecutor() {
+        LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
+        // 只有在非spring的场景下liteflowConfig才会为null
+        if (ObjectUtil.isNull(liteflowConfig)) {
+            liteflowConfig = new LiteflowConfig();
+        }
+        return buildDefaultExecutor(16, 16,
+                                    512, "customer-global-thead");
+    }
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomLoopThreadExecutor.java

@@ -0,0 +1,23 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.thread.ExecutorBuilder;
+
+import java.util.concurrent.ExecutorService;
+
+public class CustomLoopThreadExecutor implements ExecutorBuilder {
+
+    @Override
+    public ExecutorService buildExecutor() {
+        LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
+        // 只有在非spring的场景下liteflowConfig才会为null
+        if (ObjectUtil.isNull(liteflowConfig)) {
+            liteflowConfig = new LiteflowConfig();
+        }
+        return buildDefaultExecutor(16, 16,
+                                    512, "customer-loop-thead");
+    }
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomWhenThreadExecutor.java

@@ -0,0 +1,23 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.thread.ExecutorBuilder;
+
+import java.util.concurrent.ExecutorService;
+
+public class CustomWhenThreadExecutor implements ExecutorBuilder {
+
+    @Override
+    public ExecutorService buildExecutor() {
+        LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
+        // 只有在非spring的场景下liteflowConfig才会为null
+        if (ObjectUtil.isNull(liteflowConfig)) {
+            liteflowConfig = new LiteflowConfig();
+        }
+        return buildDefaultExecutor(16, 16,
+                                    512, "customer-when-thead");
+    }
+
+}

+ 79 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/GlobalThreadPoolELSpringbootTest.java

@@ -0,0 +1,79 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.collection.ListUtil;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.slot.DefaultContext;
+import com.yomahub.liteflow.test.BaseTest;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.test.context.TestPropertySource;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * springboot环境下Global线程池隔离测试
+ */
+@TestPropertySource(value = "classpath:/chainThreadPool/application3.properties")
+@SpringBootTest(classes = GlobalThreadPoolELSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.chainThreadPool.cmp"})
+public class GlobalThreadPoolELSpringbootTest extends BaseTest {
+
+    private final Logger log = LoggerFactory.getLogger(this.getClass());
+
+    @Resource
+    private FlowExecutor flowExecutor;
+
+    /**
+     * 测试WHEN上全局线程池
+     */
+    @Test
+    public void testGlobalThreadPool() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-global-thead"));
+    }
+
+    /**
+     * 测试FOR上全局线程池
+     */
+    @Test
+    public void testGlobalThreadPool2() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain2", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-global-thead"));
+    }
+
+    /**
+     * 测试WHILE上全局线程池
+     */
+    @Test
+    public void testGlobalThreadPool3() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain3", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-global-thead"));
+    }
+
+    /**
+     * 测试ITERATOR上全局线程池
+     */
+    @Test
+    public void testGlobalThreadPool4() {
+        List<String> list = ListUtil.toList("1", "2", "3", "4", "5");
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain4", list);
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-global-thead"));
+    }
+
+}

+ 81 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/cmp/CmpConfig.java

@@ -0,0 +1,81 @@
+package com.yomahub.liteflow.test.chainThreadPool.cmp;
+
+import com.yomahub.liteflow.annotation.LiteflowComponent;
+import com.yomahub.liteflow.annotation.LiteflowMethod;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
+import com.yomahub.liteflow.enums.NodeTypeEnum;
+import com.yomahub.liteflow.slot.DefaultContext;
+
+import java.util.Iterator;
+import java.util.List;
+
+@LiteflowComponent
+public class CmpConfig {
+
+    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "a")
+    public void processA(NodeComponent bindCmp) {
+
+        System.out.println("ACmp executed!");
+    }
+
+    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "b")
+    public void processB(NodeComponent bindCmp) {
+        DefaultContext context = bindCmp.getFirstContextBean();
+        context.setData("threadName", Thread.currentThread().getName());
+        System.out.println("BCmp executed!");
+    }
+
+
+    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "d")
+    public void processD(NodeComponent bindCmp) {
+        DefaultContext context = bindCmp.getFirstContextBean();
+        String key = "test";
+        if (context.hasData(key)) {
+            int count = context.getData(key);
+            context.setData(key, ++count);
+        } else {
+            context.setData(key, 1);
+        }
+    }
+
+    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "f")
+    public void processE(NodeComponent bindCmp) {
+        DefaultContext context = bindCmp.getFirstContextBean();
+        context.setData("threadName", Thread.currentThread().getName());
+        System.out.println("FCmp executed!");
+    }
+
+    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "i")
+    public void processI(NodeComponent bindCmp) {
+        DefaultContext context = bindCmp.getFirstContextBean();
+        context.setData("threadName", Thread.currentThread().getName());
+        System.out.println("ICmp executed!");
+    }
+
+    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_ITERATOR, nodeId = "it", nodeType = NodeTypeEnum.ITERATOR)
+    public Iterator<String> processIT(NodeComponent bindCmp) {
+        List<String> list = bindCmp.getRequestData();
+        return list.iterator();
+    }
+
+    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "w")
+    public void processW(NodeComponent bindCmp) {
+        DefaultContext context = bindCmp.getFirstContextBean();
+        context.setData("threadName", Thread.currentThread().getName());
+        System.out.println("WCmp executed!");
+    }
+
+    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_BOOLEAN, nodeId = "z", nodeType = NodeTypeEnum.BOOLEAN)
+    public boolean processZ(NodeComponent bindCmp) {
+        DefaultContext context = bindCmp.getFirstContextBean();
+        String key = "test";
+        if (context.hasData(key)) {
+            int count = context.getData("test");
+            return count < 5;
+        } else {
+            return true;
+        }
+    }
+
+}

+ 2 - 2
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java

@@ -16,8 +16,8 @@ public class CustomThreadExecutor1 implements ExecutorBuilder {
 		if (ObjectUtil.isNull(liteflowConfig)) {
 			liteflowConfig = new LiteflowConfig();
 		}
-		return buildDefaultExecutor(liteflowConfig.getWhenMaxWorkers(), liteflowConfig.getWhenMaxWorkers(),
-				liteflowConfig.getWhenQueueLimit(), "customer-when-1-thead-");
+        return buildDefaultExecutor(liteflowConfig.getGlobalThreadPoolSize(), liteflowConfig.getGlobalThreadPoolSize(),
+                                    liteflowConfig.getGlobalThreadPoolQueueSize(), "customer-when-1-thead-");
 	}
 
 }

+ 2 - 2
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java

@@ -16,8 +16,8 @@ public class CustomThreadExecutor2 implements ExecutorBuilder {
 		if (ObjectUtil.isNull(liteflowConfig)) {
 			liteflowConfig = new LiteflowConfig();
 		}
-		return buildDefaultExecutor(liteflowConfig.getWhenMaxWorkers(), liteflowConfig.getWhenMaxWorkers(),
-				liteflowConfig.getWhenQueueLimit(), "customer-when-2-thead-");
+        return buildDefaultExecutor(liteflowConfig.getGlobalThreadPoolSize(), liteflowConfig.getGlobalThreadPoolSize(),
+                                    liteflowConfig.getGlobalThreadPoolQueueSize(), "customer-when-2-thead-");
 	}
 
 }

+ 2 - 2
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java

@@ -16,8 +16,8 @@ public class CustomThreadExecutor3 implements ExecutorBuilder {
 		if (ObjectUtil.isNull(liteflowConfig)) {
 			liteflowConfig = new LiteflowConfig();
 		}
-		return buildDefaultExecutor(liteflowConfig.getWhenMaxWorkers(), liteflowConfig.getWhenMaxWorkers(),
-				liteflowConfig.getWhenQueueLimit(), "customer-when-3-thead-");
+        return buildDefaultExecutor(liteflowConfig.getGlobalThreadPoolSize(), liteflowConfig.getGlobalThreadPoolSize(),
+                                    liteflowConfig.getGlobalThreadPoolQueueSize(), "customer-when-3-thead-");
 	}
 
 }

+ 2 - 3
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolELDeclMultiSpringbootTest.java

@@ -7,14 +7,13 @@ import com.yomahub.liteflow.test.BaseTest;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
-import org.springframework.test.context.junit.jupiter.SpringExtension;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
 
 import javax.annotation.Resource;
 
@@ -44,7 +43,7 @@ public class CustomWhenThreadPoolELDeclMultiSpringbootTest extends BaseTest {
 		LiteflowResponse response = flowExecutor.execute2Resp("chain", "arg");
 		DefaultContext context = response.getFirstContextBean();
 		Assertions.assertTrue(response.isSuccess());
-		Assertions.assertTrue(context.getData("threadName").toString().startsWith("when-thread-1"));
+		Assertions.assertTrue(context.getData("threadName").toString().startsWith("global-thread-1"));
 	}
 
 	/**

+ 2 - 2
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/parallelLoop/CustomThreadExecutor.java

@@ -16,8 +16,8 @@ public class CustomThreadExecutor implements ExecutorBuilder {
 		if (ObjectUtil.isNull(liteflowConfig)) {
 			liteflowConfig = new LiteflowConfig();
 		}
-		return buildDefaultExecutor(liteflowConfig.getParallelMaxWorkers(), liteflowConfig.getParallelMaxWorkers(),
-				liteflowConfig.getParallelQueueLimit(), "customer-loop-thead-");
+        return buildDefaultExecutor(liteflowConfig.getGlobalThreadPoolSize(), liteflowConfig.getGlobalThreadPoolSize(),
+                                    liteflowConfig.getGlobalThreadPoolQueueSize(), "customer-loop-thead-");
 	}
 
 }

+ 1 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/chainThreadPool/application.properties

@@ -0,0 +1 @@
+liteflow.rule-source=chainThreadPool/flow.el.xml

+ 2 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/chainThreadPool/application2.properties

@@ -0,0 +1,2 @@
+liteflow.rule-source=chainThreadPool/flow2.el.xml
+liteflow.when-thread-pool-isolate=true

+ 4 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/chainThreadPool/application3.properties

@@ -0,0 +1,4 @@
+liteflow.rule-source=chainThreadPool/flow3.el.xml
+liteflow.global-thread-pool-size=16
+liteflow.global-thread-pool-queue-size=512
+liteflow.global-thread-pool-executor-class=com.yomahub.liteflow.test.chainThreadPool.CustomGlobalThreadExecutor

+ 22 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/chainThreadPool/flow.el.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<flow>
+    <chain name="chain1"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        WHEN(a,b);
+    </chain>
+
+    <chain name="chain2"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        FOR(5).parallel(true).DO(THEN(a,f));
+    </chain>
+
+    <chain name="chain3"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        WHILE(z).parallel(true).DO(THEN(w,d));
+    </chain>
+
+    <chain name="chain4"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        ITERATOR(it).parallel(true).DO(THEN(a,i));
+    </chain>
+</flow>

+ 22 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/chainThreadPool/flow2.el.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<flow>
+    <chain name="chain1"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        WHEN(a,b).threadPool("com.yomahub.liteflow.test.chainThreadPool.CustomWhenThreadExecutor");
+    </chain>
+
+    <chain name="chain2"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        FOR(5).parallel(true).DO(THEN(a,f)).threadPool("com.yomahub.liteflow.test.chainThreadPool.CustomLoopThreadExecutor");
+    </chain>
+
+    <chain name="chain3"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        WHILE(z).parallel(true).DO(THEN(w,d)).threadPool("com.yomahub.liteflow.test.chainThreadPool.CustomLoopThreadExecutor");
+    </chain>
+
+    <chain name="chain4"
+           thread-pool-executor-class="com.yomahub.liteflow.test.chainThreadPool.CustomChainThreadExecutor">
+        ITERATOR(it).parallel(true).DO(THEN(a,i)).threadPool("com.yomahub.liteflow.test.chainThreadPool.CustomLoopThreadExecutor");
+    </chain>
+</flow>

+ 19 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/chainThreadPool/flow3.el.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<flow>
+    <chain name="chain1">
+        WHEN(a,b);
+    </chain>
+
+    <chain name="chain2">
+        FOR(5).parallel(true).DO(THEN(a,f)
+        );
+    </chain>
+
+    <chain name="chain3">
+        WHILE(z).parallel(true).DO(THEN(w,d));
+    </chain>
+
+    <chain name="chain4">
+        ITERATOR(it).parallel(true).DO(THEN(a,i));
+    </chain>
+</flow>

+ 3 - 5
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/comments/flow.el.xml

@@ -1,15 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <flow>
     <chain name="chain1">
-        // 单行注释
+        /**
+        *多行注释
+        **/
         THEN(
-            // 单行注释
             a,
             b,
             WHEN(
-                /**
-                * 多行注释
-                */
                 c,
                 b
             )

+ 3 - 3
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/parallelLoop/application.properties

@@ -1,4 +1,4 @@
 liteflow.rule-source=parallelLoop/flow.xml
-liteflow.parallel-max-workers = 10
-liteflow.parallel-queue-limit = 1024
-liteflow.parallel-loop-executor-class =com.yomahub.liteflow.test.parallelLoop.CustomThreadExecutor
+liteflow.global-thread-pool-size=16
+liteflow.global-thread-pool-queue-size=512
+liteflow.global-thread-pool-executor-class=com.yomahub.liteflow.test.parallelLoop.CustomThreadExecutor

+ 79 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/ChainThreadPoolELSpringbootTest.java

@@ -0,0 +1,79 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.collection.ListUtil;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.slot.DefaultContext;
+import com.yomahub.liteflow.test.BaseTest;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.test.context.TestPropertySource;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * springboot环境下chain线程池隔离测试
+ */
+@TestPropertySource(value = "classpath:/chainThreadPool/application.properties")
+@SpringBootTest(classes = ChainThreadPoolELSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.chainThreadPool.cmp"})
+public class ChainThreadPoolELSpringbootTest extends BaseTest {
+
+    private final Logger log = LoggerFactory.getLogger(this.getClass());
+
+    @Resource
+    private FlowExecutor flowExecutor;
+
+    /**
+     * 测试WHEN上全局线程池和chain线程池隔离-优先以chain上为准
+     */
+    @Test
+    public void testChainThreadPool() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-chain-thead"));
+    }
+
+    /**
+     * 测试FOR上全局线程池和chain线程池隔离-优先以chain上为准
+     */
+    @Test
+    public void testChainThreadPool2() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain2", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-chain-thead"));
+    }
+
+    /**
+     * 测试WHILE上全局线程池和chain线程池隔离-优先以chain上为准
+     */
+    @Test
+    public void testChainThreadPool3() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain3", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-chain-thead"));
+    }
+
+    /**
+     * 测试ITERATOR上全局线程池和chain线程池隔离-优先以chain上为准
+     */
+    @Test
+    public void testChainThreadPool4() {
+        List<String> list = ListUtil.toList("1", "2", "3", "4", "5");
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain4", list);
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-chain-thead"));
+    }
+
+}

+ 79 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/ConditionThreadPoolELSpringbootTest.java

@@ -0,0 +1,79 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.collection.ListUtil;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.slot.DefaultContext;
+import com.yomahub.liteflow.test.BaseTest;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.test.context.TestPropertySource;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * springboot环境下chain线程池隔离测试
+ */
+@TestPropertySource(value = "classpath:/chainThreadPool/application2.properties")
+@SpringBootTest(classes = ConditionThreadPoolELSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.chainThreadPool.cmp"})
+public class ConditionThreadPoolELSpringbootTest extends BaseTest {
+
+    private final Logger log = LoggerFactory.getLogger(this.getClass());
+
+    @Resource
+    private FlowExecutor flowExecutor;
+
+    /**
+     * 测试WEHN上condition线程池和chain线程池隔离-优先以WHEN上为准
+     */
+    @Test
+    public void testConditionThreadPool() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-when-thead"));
+    }
+
+    /**
+     * 测试FOR上condition线程池和chain线程池隔离-优先以FOR上为准
+     */
+    @Test
+    public void testConditionThreadPool2() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain2", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-loop-thead"));
+    }
+
+    /**
+     * 测试WHILE上condition线程池和chain线程池隔离-优先以WHILE上为准
+     */
+    @Test
+    public void testConditionThreadPool3() {
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain3", "arg");
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-loop-thead"));
+    }
+
+    /**
+     * 测试ITERATOR上condition线程池和chain线程池隔离-优先以ITERATOR上为准
+     */
+    @Test
+    public void testConditionThreadPool4() {
+        List<String> list = ListUtil.toList("1", "2", "3", "4", "5");
+        LiteflowResponse response1 = flowExecutor.execute2Resp("chain4", list);
+        DefaultContext context = response1.getFirstContextBean();
+        Assertions.assertTrue(response1.isSuccess());
+        Assertions.assertTrue(context.getData("threadName").toString().startsWith("customer-loop-thead"));
+    }
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomChainThreadExecutor.java

@@ -0,0 +1,23 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.thread.ExecutorBuilder;
+
+import java.util.concurrent.ExecutorService;
+
+public class CustomChainThreadExecutor implements ExecutorBuilder {
+
+    @Override
+    public ExecutorService buildExecutor() {
+        LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
+        // 只有在非spring的场景下liteflowConfig才会为null
+        if (ObjectUtil.isNull(liteflowConfig)) {
+            liteflowConfig = new LiteflowConfig();
+        }
+        return buildDefaultExecutor(16, 16,
+                                    512, "customer-chain-thead");
+    }
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/chainThreadPool/CustomGlobalThreadExecutor.java

@@ -0,0 +1,23 @@
+package com.yomahub.liteflow.test.chainThreadPool;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.thread.ExecutorBuilder;
+
+import java.util.concurrent.ExecutorService;
+
+public class CustomGlobalThreadExecutor implements ExecutorBuilder {
+
+    @Override
+    public ExecutorService buildExecutor() {
+        LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
+        // 只有在非spring的场景下liteflowConfig才会为null
+        if (ObjectUtil.isNull(liteflowConfig)) {
+            liteflowConfig = new LiteflowConfig();
+        }
+        return buildDefaultExecutor(16, 16,
+                                    512, "customer-global-thead");
+    }
+
+}

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor