浏览代码

enhancement #I5U1FH 去除老的表达式的支持,精简代码

everywhere.z 2 年之前
父节点
当前提交
8d8f0e286e
共有 100 个文件被更改,包括 52 次插入3268 次删除
  1. 0 158
      liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowConditionBuilder.java
  2. 0 65
      liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowWhenConditionBuilder.java
  3. 1 11
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java
  4. 0 20
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassJsonFlowParser.java
  5. 0 19
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassXmlFlowParser.java
  6. 0 20
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassYmlFlowParser.java
  7. 0 23
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/JsonFlowParser.java
  8. 0 18
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalJsonFlowParser.java
  9. 0 25
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalXmlFlowParser.java
  10. 0 21
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalYmlFlowParser.java
  11. 0 65
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/RegexEntity.java
  12. 0 51
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/RegexNodeEntity.java
  13. 0 24
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/XmlFlowParser.java
  14. 0 22
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/YmlFlowParser.java
  15. 0 2
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ClassJsonFlowELParser.java
  16. 0 21
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/ClassParserFactory.java
  17. 0 6
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserFactory.java
  18. 3 9
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserProvider.java
  19. 0 15
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/LocalParserFactory.java
  20. 0 126
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/helper/ParserHelper.java
  21. 18 60
      liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclMultiSpringbootTest1.java
  22. 0 2
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclSpringbootTest2.java
  23. 23 68
      liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/builder/BuilderTest.java
  24. 4 3
      liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java
  25. 3 3
      liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java
  26. 0 2
      liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteFlowXmlScriptBuilderGroovyELTest.java
  27. 0 2
      liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteFlowXmlScriptBuilderQLExpressELTest.java
  28. 0 3
      liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELSpringbootTest1.java
  29. 0 2
      liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELSpringbootTest2.java
  30. 0 1
      liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java
  31. 0 1
      liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java
  32. 0 83
      liteflow-testcase-old/.gitignore
  33. 0 52
      liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml
  34. 0 21
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java
  35. 0 42
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringbootTest.java
  36. 0 24
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java
  37. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java
  38. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java
  39. 0 41
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java
  40. 0 79
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java
  41. 0 20
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java
  42. 0 28
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java
  43. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java
  44. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java
  45. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java
  46. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java
  47. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java
  48. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java
  49. 0 139
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringbootTest.java
  50. 0 29
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java
  51. 0 29
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java
  52. 0 29
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java
  53. 0 30
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java
  54. 0 19
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java
  55. 0 18
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java
  56. 0 31
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java
  57. 0 31
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java
  58. 0 31
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java
  59. 0 19
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java
  60. 0 4
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java
  61. 0 39
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseSpringbootTest.java
  62. 0 24
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java
  63. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java
  64. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java
  65. 0 31
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java
  66. 0 10
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/TestDomain.java
  67. 0 217
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest1.java
  68. 0 41
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest2.java
  69. 0 22
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java
  70. 0 23
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java
  71. 0 23
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java
  72. 0 23
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java
  73. 0 24
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ECmp.java
  74. 0 23
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java
  75. 0 23
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/GCmp.java
  76. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/HCmp.java
  77. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/ICmp.java
  78. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/JCmp.java
  79. 0 64
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringbootTest.java
  80. 0 24
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java
  81. 0 31
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/BCmp.java
  82. 0 28
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java
  83. 0 28
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java
  84. 0 28
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java
  85. 0 52
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepSpringbootTest.java
  86. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java
  87. 0 25
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java
  88. 0 27
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java
  89. 0 26
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java
  90. 0 29
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java
  91. 0 94
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorSpringbootTest.java
  92. 0 30
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java
  93. 0 33
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java
  94. 0 33
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java
  95. 0 30
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java
  96. 0 28
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java
  97. 0 30
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java
  98. 0 24
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java
  99. 0 26
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp2/FCondCmp.java
  100. 0 38
      liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/CustomMethodNameSpringbootTest.java

+ 0 - 158
liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowConditionBuilder.java

@@ -1,158 +0,0 @@
-package com.yomahub.liteflow.builder;
-
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.flow.element.Chain;
-import com.yomahub.liteflow.flow.element.condition.*;
-import com.yomahub.liteflow.builder.entity.ExecutableEntity;
-import com.yomahub.liteflow.flow.element.Node;
-import com.yomahub.liteflow.enums.ConditionTypeEnum;
-import com.yomahub.liteflow.exception.ExecutableItemNotFoundException;
-import com.yomahub.liteflow.flow.FlowBus;
-import com.yomahub.liteflow.parser.RegexEntity;
-import com.yomahub.liteflow.parser.RegexNodeEntity;
-import com.yomahub.liteflow.spi.holder.ContextAwareHolder;
-
-import java.util.List;
-
-/**
- * Condition基于代码形式的组装器
- * @author Bryan.Zhang
- * @since 2.6.8
- */
-public class LiteFlowConditionBuilder {
-
-    protected Condition condition;
-
-    public static LiteFlowConditionBuilder createCondition(ConditionTypeEnum conditionType){
-        switch (conditionType){
-            case TYPE_THEN:
-                return createThenCondition();
-            case TYPE_WHEN:
-                return createWhenCondition();
-            case TYPE_PRE:
-                return createPreCondition();
-            case TYPE_FINALLY:
-                return createFinallyCondition();
-            default:
-                return null;
-        }
-    }
-
-    public static LiteFlowConditionBuilder createThenCondition(){
-        return new LiteFlowConditionBuilder(new ThenCondition());
-    }
-
-    public static LiteFlowWhenConditionBuilder createWhenCondition(){
-        return new LiteFlowWhenConditionBuilder(new WhenCondition());
-    }
-
-    public static LiteFlowConditionBuilder createPreCondition(){
-        return new LiteFlowConditionBuilder(new PreCondition());
-    }
-
-    public static LiteFlowConditionBuilder createFinallyCondition(){
-        return new LiteFlowConditionBuilder(new FinallyCondition());
-    }
-
-    public LiteFlowConditionBuilder(Condition condition){
-        this.condition = condition;
-    }
-
-    public LiteFlowConditionBuilder setValue(String value){
-        if (StrUtil.isBlank(value)){
-            return this;
-        }
-        String[] condArray = value.split(",");
-
-        RegexEntity regexEntity;
-        String itemExpression;
-        for (String s : condArray) {
-            itemExpression = s.trim();
-            regexEntity = RegexEntity.parse(itemExpression);
-            // 先转化为执行实体对象
-            ExecutableEntity executableEntity = convertExecutableEntity(regexEntity);
-            // 构建节点或流程
-            setExecutable(executableEntity);
-        }
-        return this;
-    }
-
-    // 将正则表达式实体转化为执行实体
-    private ExecutableEntity convertExecutableEntity(RegexEntity regexEntity) {
-        RegexNodeEntity item = regexEntity.getItem();
-        ExecutableEntity executableEntity = new ExecutableEntity(item.getId(), item.getTag());
-        if (ObjectUtil.isNotNull(regexEntity.getRealItemArray())) {
-            for (RegexNodeEntity realItem : regexEntity.getRealItemArray()) {
-                executableEntity.addNodeCondComponent(new ExecutableEntity(realItem.getId(), realItem.getTag()));
-            }
-        }
-        return executableEntity;
-    }
-
-    // 设置执行节点或者流程
-    public LiteFlowConditionBuilder setExecutable(ExecutableEntity executableEntity) {
-        if (FlowBus.containNode(executableEntity.getId())) {
-            Node node = FlowBus.copyNode(executableEntity.getId());
-            node.setTag(executableEntity.getTag());
-
-            //如果没有条件节点,说明是普通组件,如果有条件节点,就去构建SwitchCondition
-            if (CollUtil.isEmpty(executableEntity.getNodeCondComponents())) {
-                this.condition.getExecutableList().add(node);
-            }else{
-                buildSwitchNode(node, executableEntity.getNodeCondComponents());
-            }
-        } else if (hasChain(executableEntity.getId())) {
-            Chain chain = FlowBus.getChain(executableEntity.getId());
-            this.condition.getExecutableList().add(chain);
-        } else {
-            //元数据没有的话,从spring上下文再取一遍
-            //这部分有2个目的
-            //一是为了防止标有@Lazy懒加载的组件,二是spring负责扫描,而用动态代码的形式加载组件这种情况。
-            NodeComponent nodeComponent =  ContextAwareHolder.loadContextAware().getBean(executableEntity.getId());
-            if (ObjectUtil.isNotNull(nodeComponent)){
-                FlowBus.addSpringScanNode(executableEntity.getId(), nodeComponent);
-                setExecutable(executableEntity);
-            } else{
-                String errorMsg = StrUtil.format("executable node[{}] is not found!", executableEntity.getId());
-                throw new ExecutableItemNotFoundException(errorMsg);
-            }
-        }
-        return this;
-    }
-
-    // 构建条件节点
-    private void buildSwitchNode(Node node, List<ExecutableEntity> executableEntities) {
-        if (CollUtil.isEmpty(executableEntities)) {
-            return;
-        }
-
-        SwitchCondition switchCondition = new SwitchCondition();
-        switchCondition.setSwitchNode(node);
-
-        for (ExecutableEntity realItem : executableEntities) {
-            if (FlowBus.containNode(realItem.getId())) {
-                Node targetNode = FlowBus.copyNode(realItem.getId());
-                targetNode.setTag(realItem.getTag());
-                switchCondition.addTargetItem(targetNode);
-            } else if (hasChain(realItem.getId())) {
-                Chain chain = FlowBus.getChain(realItem.getId());
-                switchCondition.addTargetItem(chain);
-            } else{
-                String errorMsg = StrUtil.format("executable node[{}] is not found!", realItem.getId());
-                throw new ExecutableItemNotFoundException(errorMsg);
-            }
-        }
-        this.condition.getExecutableList().add(switchCondition);
-    }
-
-    public Condition build(){
-        return this.condition;
-    }
-
-    private boolean hasChain(String chainId){
-        return FlowBus.containChain(chainId);
-    }
-}

+ 0 - 65
liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowWhenConditionBuilder.java

@@ -1,65 +0,0 @@
-package com.yomahub.liteflow.builder;
-
-import cn.hutool.core.util.StrUtil;
-import com.yomahub.liteflow.common.LocalDefaultFlowConstant;
-import com.yomahub.liteflow.flow.element.condition.Condition;
-import com.yomahub.liteflow.flow.element.condition.WhenCondition;
-
-/**
- * WhenCondition基于代码形式的组装器
- * 这个为LiteFlowConditionBuilder的子类,因为when有单独的设置项,所以区分开
- * @author Bryan.Zhang
- * @since 2.6.8
- */
-public class LiteFlowWhenConditionBuilder extends LiteFlowConditionBuilder{
-
-    public LiteFlowWhenConditionBuilder(Condition condition) {
-        super(condition);
-    }
-
-    public LiteFlowWhenConditionBuilder setErrorResume(boolean errorResume){
-        WhenCondition whenCondition = (WhenCondition) this.condition;
-        whenCondition.setErrorResume(errorResume);
-        return this;
-    }
-
-    public LiteFlowWhenConditionBuilder setErrorResume(String errorResume){
-        if (StrUtil.isBlank(errorResume)){
-            return this;
-        }
-        return setErrorResume(Boolean.parseBoolean(errorResume));
-    }
-
-    public LiteFlowWhenConditionBuilder setGroup(String group){
-        WhenCondition whenCondition = (WhenCondition) this.condition;
-        if (StrUtil.isBlank(group)){
-            whenCondition.setGroup(LocalDefaultFlowConstant.DEFAULT);
-        }else{
-            whenCondition.setGroup(group);
-        }
-        return this;
-    }
-
-    public LiteFlowWhenConditionBuilder setAny(boolean any){
-        WhenCondition whenCondition = (WhenCondition) this.condition;
-        whenCondition.setAny(any);
-        return this;
-    }
-
-    public LiteFlowWhenConditionBuilder setAny(String any){
-        if (StrUtil.isBlank(any)){
-            return this;
-        }
-        return setAny(Boolean.parseBoolean(any));
-    }
-
-
-    public LiteFlowWhenConditionBuilder setThreadExecutorClass(String executorServiceName){
-        WhenCondition whenCondition = (WhenCondition) this.condition;
-        if (StrUtil.isBlank(executorServiceName)) {
-            return this;
-        }
-        whenCondition.setThreadExecutorClass(executorServiceName);
-        return this;
-    }
-}

+ 1 - 11
liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java

@@ -8,7 +8,6 @@
  */
 package com.yomahub.liteflow.flow;
 
-import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.util.ObjectUtil;
@@ -20,9 +19,6 @@ import com.yomahub.liteflow.exception.ComponentCannotRegisterException;
 import com.yomahub.liteflow.exception.NullNodeTypeException;
 import com.yomahub.liteflow.flow.element.Chain;
 import com.yomahub.liteflow.flow.element.Node;
-import com.yomahub.liteflow.parser.LocalJsonFlowParser;
-import com.yomahub.liteflow.parser.LocalXmlFlowParser;
-import com.yomahub.liteflow.parser.LocalYmlFlowParser;
 import com.yomahub.liteflow.parser.el.LocalJsonFlowELParser;
 import com.yomahub.liteflow.parser.el.LocalXmlFlowELParser;
 import com.yomahub.liteflow.parser.el.LocalYmlFlowELParser;
@@ -315,13 +311,7 @@ public class FlowBus {
     }
 
     public static void refreshFlowMetaData(FlowParserTypeEnum type, String content) throws Exception {
-        if (type.equals(FlowParserTypeEnum.TYPE_XML)) {
-            new LocalXmlFlowParser().parse(content);
-        } else if (type.equals(FlowParserTypeEnum.TYPE_JSON)) {
-            new LocalJsonFlowParser().parse(content);
-        } else if (type.equals(FlowParserTypeEnum.TYPE_YML)) {
-            new LocalYmlFlowParser().parse(content);
-        } else if (type.equals(FlowParserTypeEnum.TYPE_EL_XML)) {
+        if (type.equals(FlowParserTypeEnum.TYPE_EL_XML)) {
             new LocalXmlFlowELParser().parse(content);
         } else if (type.equals(FlowParserTypeEnum.TYPE_EL_JSON)) {
             new LocalJsonFlowELParser().parse(content);

+ 0 - 20
liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassJsonFlowParser.java

@@ -1,20 +0,0 @@
-package com.yomahub.liteflow.parser;
-
-import cn.hutool.core.collection.ListUtil;
-
-import java.util.List;
-
-/**
- * 基于自定义的Json方式解析器
- * @author guodongqing
- * @since 1.2.5
- */
-public abstract class ClassJsonFlowParser extends JsonFlowParser {
-	@Override
-	public void parseMain(List<String> pathList) throws Exception {
-		String content = parseCustom();
-		parse(content);
-	}
-
-	public abstract String parseCustom();
-}

+ 0 - 19
liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassXmlFlowParser.java

@@ -1,19 +0,0 @@
-package com.yomahub.liteflow.parser;
-
-import cn.hutool.core.collection.ListUtil;
-
-import java.util.List;
-
-/**
- * 基于自定义的xml方式解析器
- * @author Bryan.Zhang
- */
-public abstract class ClassXmlFlowParser extends XmlFlowParser {
-	@Override
-	public void parseMain(List<String> pathList) throws Exception {
-		String content = parseCustom();
-		parse(content);
-	}
-
-	public abstract String parseCustom();
-}

+ 0 - 20
liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassYmlFlowParser.java

@@ -1,20 +0,0 @@
-package com.yomahub.liteflow.parser;
-
-import cn.hutool.core.collection.ListUtil;
-
-import java.util.List;
-
-/**
- * 基于自定义的Yml方式解析器
- * @author guodongqing
- * @since 2.5.0
- */
-public abstract class ClassYmlFlowParser extends YmlFlowParser{
-    @Override
-    public void parseMain(List<String> pathList) throws Exception {
-        String content = parseCustom();
-        parse(content);
-    }
-
-    public abstract String parseCustom();
-}

+ 0 - 23
liteflow-core/src/main/java/com/yomahub/liteflow/parser/JsonFlowParser.java

@@ -1,23 +0,0 @@
-package com.yomahub.liteflow.parser;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.yomahub.liteflow.parser.base.BaseJsonFlowParser;
-import com.yomahub.liteflow.parser.helper.ParserHelper;
-
-/**
- * Json格式解析器
- *
- * @author guodongqing
- * @since 2.5.0
- */
-public abstract class JsonFlowParser extends BaseJsonFlowParser {
-
-	/**
-	 * 解析一个chain的过程
-	 */
-	@Override
-	public void parseOneChain(JsonNode chainObject) {
-		ParserHelper.parseOneChain(chainObject);
-	}
-
-}

+ 0 - 18
liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalJsonFlowParser.java

@@ -1,18 +0,0 @@
-package com.yomahub.liteflow.parser;
-
-import com.yomahub.liteflow.spi.holder.PathContentParserHolder;
-
-import java.util.List;
-
-/**
- * @author guodongqing
- * @since 2.5.0
- */
-public class LocalJsonFlowParser extends JsonFlowParser{
-
-    @Override
-    public void parseMain(List<String> pathList) throws Exception {
-        List<String> contentList = PathContentParserHolder.loadContextAware().parseContent(pathList);
-        parse(contentList);
-    }
-}

+ 0 - 25
liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalXmlFlowParser.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.parser;
-
-import com.yomahub.liteflow.spi.holder.PathContentParserHolder;
-
-import java.util.List;
-
-/**
- * 基于本地的xml方式解析器
- * @author Bryan.Zhang
- */
-public class LocalXmlFlowParser extends XmlFlowParser{
-
-	@Override
-	public void parseMain(List<String> pathList) throws Exception {
-		List<String> contentList = PathContentParserHolder.loadContextAware().parseContent(pathList);
-		parse(contentList);
-	}
-}

+ 0 - 21
liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalYmlFlowParser.java

@@ -1,21 +0,0 @@
-package com.yomahub.liteflow.parser;
-
-import com.yomahub.liteflow.spi.holder.PathContentParserHolder;
-
-import java.util.List;
-
-/**
- * Yaml格式转换
- *
- * @author guodongqing
- * @since 2.5.0
- */
-public class LocalYmlFlowParser extends YmlFlowParser {
-
-    @Override
-    public void parseMain(List<String> pathList) throws Exception {
-        List<String> contentList = PathContentParserHolder.loadContextAware().parseContent(pathList);
-        parse(contentList);
-    }
-
-}

+ 0 - 65
liteflow-core/src/main/java/com/yomahub/liteflow/parser/RegexEntity.java

@@ -1,65 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.parser;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.function.Function;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-
-/**
- * 正则实体,主要用于条件节点
- * @author Bryan.Zhang
- */
-public class RegexEntity {
-
-	private static final Pattern p = Pattern.compile("[^\\)\\(]+");
-
-	private RegexNodeEntity item;
-
-	private RegexNodeEntity[] realItemArray;
-
-	public static RegexEntity parse(String nodeStr){
-		List<String> list = new ArrayList<String>();
-		Matcher m = p.matcher(nodeStr);
-		while(m.find()){
-			list.add(m.group());
-		}
-
-		RegexEntity regexEntity = new RegexEntity();
-		regexEntity.setItem(RegexNodeEntity.parse(list.get(0)));
-		try{
-			String[] array = list.get(1).split("\\|");
-
-			List<RegexNodeEntity> regexNodeEntityList
-					= Arrays.stream(array).map(s -> RegexNodeEntity.parse(s.trim())).collect(Collectors.toList());
-
-			regexEntity.setRealItemArray(regexNodeEntityList.toArray(new RegexNodeEntity[]{}));
-		}catch (Exception ignored){}
-		return regexEntity;
-	}
-
-	public RegexNodeEntity getItem() {
-		return item;
-	}
-
-	public void setItem(RegexNodeEntity item) {
-		this.item = item;
-	}
-
-	public RegexNodeEntity[] getRealItemArray() {
-		return realItemArray;
-	}
-
-	public void setRealItemArray(RegexNodeEntity[] realItemArray) {
-		this.realItemArray = realItemArray;
-	}
-}

+ 0 - 51
liteflow-core/src/main/java/com/yomahub/liteflow/parser/RegexNodeEntity.java

@@ -1,51 +0,0 @@
-package com.yomahub.liteflow.parser;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * 节点解析,主要用于解析节点name的重命名
- * @author Bryan.Zhang
- * @since 2.6.2
- */
-public class RegexNodeEntity {
-
-    private static final Pattern p = Pattern.compile("[^\\[\\]]+");
-
-    private String id;
-
-    private String tag;
-
-    public static RegexNodeEntity parse(String itemStr){
-        List<String> list = new ArrayList<String>();
-        Matcher m = p.matcher(itemStr);
-        while(m.find()){
-            list.add(m.group());
-        }
-
-        RegexNodeEntity regexNodeEntity = new RegexNodeEntity();
-        regexNodeEntity.setId(list.get(0));
-        try{
-            regexNodeEntity.setTag(list.get(1));
-        }catch (Exception ignored){}
-        return regexNodeEntity;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getTag() {
-        return tag;
-    }
-
-    public void setTag(String tag) {
-        this.tag = tag;
-    }
-}

+ 0 - 24
liteflow-core/src/main/java/com/yomahub/liteflow/parser/XmlFlowParser.java

@@ -1,24 +0,0 @@
-package com.yomahub.liteflow.parser;
-
-import com.yomahub.liteflow.parser.base.BaseXmlFlowParser;
-import com.yomahub.liteflow.parser.helper.ParserHelper;
-import org.dom4j.Element;
-
-;
-
-/**
- * xml形式的解析器
- *
- * @author Bryan.Zhang
- */
-public abstract class XmlFlowParser extends BaseXmlFlowParser {
-
-	/**
-	 * 解析一个chain的过程
-	 */
-	@Override
-	public void parseOneChain(Element e) {
-		ParserHelper.parseOneChain(e);
-	}
-
-}

+ 0 - 22
liteflow-core/src/main/java/com/yomahub/liteflow/parser/YmlFlowParser.java

@@ -1,22 +0,0 @@
-package com.yomahub.liteflow.parser;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.yomahub.liteflow.parser.base.BaseYmlFlowParser;
-import com.yomahub.liteflow.parser.helper.ParserHelper;
-
-/**
- * Yml格式解析器,转换为json格式进行解析
- * @author guodongqing
- * @since 2.5.0
- */
-public abstract class YmlFlowParser extends BaseYmlFlowParser {
-
-    /**
-     * 解析一个chain的过程
-     */
-    @Override
-    public void parseOneChain(JsonNode chainObject) {
-        ParserHelper.parseOneChain(chainObject);
-    }
-
-}

+ 0 - 2
liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ClassJsonFlowELParser.java

@@ -1,7 +1,5 @@
 package com.yomahub.liteflow.parser.el;
 
-import com.yomahub.liteflow.parser.JsonFlowParser;
-
 import java.util.List;
 
 /**

+ 0 - 21
liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/ClassParserFactory.java

@@ -1,8 +1,5 @@
 package com.yomahub.liteflow.parser.factory;
 
-import com.yomahub.liteflow.parser.JsonFlowParser;
-import com.yomahub.liteflow.parser.XmlFlowParser;
-import com.yomahub.liteflow.parser.YmlFlowParser;
 import com.yomahub.liteflow.parser.base.BaseJsonFlowParser;
 import com.yomahub.liteflow.parser.base.BaseXmlFlowParser;
 import com.yomahub.liteflow.parser.base.BaseYmlFlowParser;
@@ -19,24 +16,6 @@ import com.yomahub.liteflow.spi.holder.ContextAwareHolder;
  */
 public class ClassParserFactory implements FlowParserFactory {
 
-    @Override
-    public JsonFlowParser createJsonParser(String path) {
-        Class<?> c = forName(path);
-        return (JsonFlowParser) ContextAwareHolder.loadContextAware().registerBean(c);
-    }
-
-    @Override
-    public XmlFlowParser createXmlParser(String path) {
-        Class<?> c = forName(path);
-        return (XmlFlowParser) ContextAwareHolder.loadContextAware().registerBean(c);
-    }
-
-    @Override
-    public YmlFlowParser createYmlParser(String path) {
-        Class<?> c = forName(path);
-        return (YmlFlowParser) ContextAwareHolder.loadContextAware().registerBean(c);
-    }
-
     @Override
     public BaseJsonFlowParser createJsonELParser(String path) {
         Class<?> c = forName(path);

+ 0 - 6
liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserFactory.java

@@ -12,12 +12,6 @@ import com.yomahub.liteflow.parser.base.BaseYmlFlowParser;
  */
 public interface FlowParserFactory {
 
-    BaseJsonFlowParser createJsonParser(String path);
-
-    BaseXmlFlowParser createXmlParser(String path);
-
-    BaseYmlFlowParser createYmlParser(String path);
-
     BaseJsonFlowParser createJsonELParser(String path);
 
     BaseXmlFlowParser createXmlELParser(String path);

+ 3 - 9
liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserProvider.java

@@ -4,9 +4,6 @@ import cn.hutool.core.util.ReUtil;
 import cn.hutool.core.util.StrUtil;
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.exception.ErrorSupportPathException;
-import com.yomahub.liteflow.parser.ClassJsonFlowParser;
-import com.yomahub.liteflow.parser.ClassXmlFlowParser;
-import com.yomahub.liteflow.parser.ClassYmlFlowParser;
 import com.yomahub.liteflow.parser.base.FlowParser;
 import com.yomahub.liteflow.parser.el.ClassJsonFlowELParser;
 import com.yomahub.liteflow.parser.el.ClassXmlFlowELParser;
@@ -49,9 +46,9 @@ public class FlowParserProvider {
 	 */
 	private static final Map<Predicate<String>, Function<String, FlowParser>> LOCAL_PARSER_DICT =
 			new HashMap<Predicate<String>, Function<String, FlowParser>>() {{
-				put(path -> ReUtil.isMatch(LOCAL_XML_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createXmlParser);
-				put(path -> ReUtil.isMatch(LOCAL_JSON_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createJsonParser);
-				put(path -> ReUtil.isMatch(LOCAL_YML_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createYmlParser);
+				put(path -> ReUtil.isMatch(LOCAL_XML_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createXmlELParser);
+				put(path -> ReUtil.isMatch(LOCAL_JSON_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createJsonELParser);
+				put(path -> ReUtil.isMatch(LOCAL_YML_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createYmlELParser);
 				put(path -> ReUtil.isMatch(LOCAL_EL_XML_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createXmlELParser);
 				put(path -> ReUtil.isMatch(LOCAL_EL_JSON_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createJsonELParser);
 				put(path -> ReUtil.isMatch(LOCAL_EL_YML_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createYmlELParser);
@@ -68,9 +65,6 @@ public class FlowParserProvider {
 	 */
 	private static final Map<Predicate<Class<?>>, Function<String, FlowParser>> CLASS_PARSER_DICT =
 			new HashMap<Predicate<Class<?>>, Function<String, FlowParser>>() {{
-				put(ClassXmlFlowParser.class::isAssignableFrom, CLASS_PARSER_FACTORY::createXmlParser);
-				put(ClassJsonFlowParser.class::isAssignableFrom, CLASS_PARSER_FACTORY::createJsonParser);
-				put(ClassYmlFlowParser.class::isAssignableFrom, CLASS_PARSER_FACTORY::createYmlParser);
 				put(ClassXmlFlowELParser.class::isAssignableFrom, CLASS_PARSER_FACTORY::createXmlELParser);
 				put(ClassJsonFlowELParser.class::isAssignableFrom, CLASS_PARSER_FACTORY::createJsonELParser);
 				put(ClassYmlFlowELParser.class::isAssignableFrom, CLASS_PARSER_FACTORY::createYmlELParser);

+ 0 - 15
liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/LocalParserFactory.java

@@ -11,21 +11,6 @@ import com.yomahub.liteflow.parser.el.*;
  */
 public class LocalParserFactory implements FlowParserFactory {
 
-    @Override
-    public JsonFlowParser createJsonParser(String path) {
-        return new LocalJsonFlowParser();
-    }
-
-    @Override
-    public XmlFlowParser createXmlParser(String path) {
-        return new LocalXmlFlowParser();
-    }
-
-    @Override
-    public YmlFlowParser createYmlParser(String path) {
-        return new LocalYmlFlowParser();
-    }
-
     @Override
     public JsonFlowELParser createJsonELParser(String path) {
         return new LocalJsonFlowELParser();

+ 0 - 126
liteflow-core/src/main/java/com/yomahub/liteflow/parser/helper/ParserHelper.java

@@ -3,30 +3,23 @@ package com.yomahub.liteflow.parser.helper;
 import cn.hutool.core.annotation.AnnotationUtil;
 import cn.hutool.core.text.CharSequenceUtil;
 import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.ReflectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.yomahub.liteflow.annotation.*;
 import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
-import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
 import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
 import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
 import com.yomahub.liteflow.builder.prop.ChainPropBean;
 import com.yomahub.liteflow.builder.prop.NodePropBean;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.core.NodeIfComponent;
-import com.yomahub.liteflow.core.NodeSwitchComponent;
 import com.yomahub.liteflow.enums.ConditionTypeEnum;
 import com.yomahub.liteflow.enums.NodeTypeEnum;
 import com.yomahub.liteflow.exception.*;
 import com.yomahub.liteflow.flow.FlowBus;
-import com.yomahub.liteflow.util.JsonUtil;
 import org.dom4j.Document;
 import org.dom4j.Element;
 
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import java.util.function.Consumer;
 import java.util.regex.Pattern;
@@ -140,48 +133,6 @@ public class ParserHelper {
 				.build();
 	}
 
-	/**
-	 * 构建 chain
-	 *
-	 * @param chainPropBean 构建 chain 的中间属性
-	 * @param chainBuilder  chainBuilder
-	 */
-	public static void buildChain(ChainPropBean chainPropBean, LiteFlowChainBuilder chainBuilder) {
-		String condValueStr = chainPropBean.getCondValueStr();
-		String group = chainPropBean.getGroup();
-		String errorResume = chainPropBean.getErrorResume();
-		String any = chainPropBean.getAny();
-		String threadExecutorClass = chainPropBean.getThreadExecutorClass();
-		ConditionTypeEnum conditionType = chainPropBean.getConditionType();
-
-		if (ObjectUtil.isNull(conditionType)) {
-			throw new NotSupportConditionException("ConditionType is not supported");
-		}
-
-		if (StrUtil.isBlank(condValueStr)) {
-			throw new EmptyConditionValueException("Condition value cannot be empty");
-		}
-
-		//如果是when类型的话,有特殊化参数要设置,只针对于when的
-		if (conditionType.equals(ConditionTypeEnum.TYPE_WHEN)) {
-			chainBuilder.setCondition(
-					LiteFlowConditionBuilder.createWhenCondition()
-							.setErrorResume(errorResume)
-							.setGroup(group)
-							.setAny(any)
-							.setThreadExecutorClass(threadExecutorClass)
-							.setValue(condValueStr)
-							.build()
-			).build();
-		} else {
-			chainBuilder.setCondition(
-					LiteFlowConditionBuilder.createCondition(conditionType)
-							.setValue(condValueStr)
-							.build()
-			).build();
-		}
-	}
-
 	/**
 	 * xml 形式的主要解析过程
 	 *
@@ -307,83 +258,6 @@ public class ParserHelper {
 		}
 	}
 
-
-	/**
-	 * 解析一个chain的过程
-	 *
-	 * @param chainNode chain 节点
-	 */
-	public static void parseOneChain(JsonNode chainNode) {
-		String condValueStr;
-		ConditionTypeEnum conditionType;
-		String group;
-		String errorResume;
-		String any;
-		String threadExecutorClass;
-
-		//构建chainBuilder
-		String chainName = chainNode.get(NAME).textValue();
-		LiteFlowChainBuilder chainBuilder = LiteFlowChainBuilder.createChain().setChainName(chainName);
-		Iterator<JsonNode> iterator =  chainNode.get(CONDITION).iterator();
-		while (iterator.hasNext()) {
-			JsonNode condNode = iterator.next();
-			conditionType = ConditionTypeEnum.getEnumByCode(condNode.get(TYPE).textValue());
-			condValueStr = condNode.get(VALUE).textValue();
-			errorResume = condNode.hasNonNull(ERROR_RESUME) ? condNode.get(ERROR_RESUME).textValue() : "";
-			group = condNode.hasNonNull(GROUP) ? condNode.get(GROUP).textValue() : "";
-			any = condNode.hasNonNull(ANY) ? condNode.get(ANY).textValue() : "";
-			threadExecutorClass =  condNode.hasNonNull(THREAD_EXECUTOR_CLASS) ? condNode.get(THREAD_EXECUTOR_CLASS).textValue() : "";
-
-			ChainPropBean chainPropBean = new ChainPropBean()
-					.setCondValueStr(condValueStr)
-					.setGroup(group)
-					.setErrorResume(errorResume)
-					.setAny(any)
-					.setThreadExecutorClass(threadExecutorClass)
-					.setConditionType(conditionType);
-
-			// 构建 chain
-			ParserHelper.buildChain(chainPropBean, chainBuilder);
-		}
-	}
-	/**
-	 * 解析一个chain的过程
-	 * @param e chain 节点
-	 */
-	public static void parseOneChain(Element e) {
-		String condValueStr;
-		String group;
-		String errorResume;
-		String any;
-		String threadExecutorClass;
-		ConditionTypeEnum conditionType;
-
-		//构建chainBuilder
-		String chainName = e.attributeValue(NAME);
-		LiteFlowChainBuilder chainBuilder = LiteFlowChainBuilder.createChain().setChainName(chainName);
-
-		for (Iterator<Element> it = e.elementIterator(); it.hasNext(); ) {
-			Element condE = it.next();
-			conditionType = ConditionTypeEnum.getEnumByCode(condE.getName());
-			condValueStr = condE.attributeValue(VALUE);
-			errorResume = condE.attributeValue(ERROR_RESUME);
-			group = condE.attributeValue(GROUP);
-			any = condE.attributeValue(ANY);
-			threadExecutorClass = condE.attributeValue(THREAD_EXECUTOR_CLASS);
-
-			ChainPropBean chainPropBean = new ChainPropBean()
-					.setCondValueStr(condValueStr)
-					.setGroup(group)
-					.setErrorResume(errorResume)
-					.setAny(any)
-					.setThreadExecutorClass(threadExecutorClass)
-					.setConditionType(conditionType);
-
-			// 构建 chain
-			ParserHelper.buildChain(chainPropBean, chainBuilder);
-		}
-	}
-
 	/**
 	 * 解析一个chain的过程
 	 *

+ 18 - 60
liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclMultiSpringbootTest1.java

@@ -1,7 +1,6 @@
 package com.yomahub.liteflow.test.builder;
 
 import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
-import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
 import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
 import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
 import com.yomahub.liteflow.builder.entity.ExecutableEntity;
@@ -123,17 +122,12 @@ public class BuilderELDeclMultiSpringbootTest1 extends BaseTest {
                 .build();
 
 
-        LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition(
-                LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build()
+        LiteFlowChainELBuilder.createChain().setChainName("chain2").setEL(
+                "THEN(c, d)"
         ).build();
 
-        LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition(
-                LiteFlowConditionBuilder
-                        .createThenCondition()
-                        .setValue("a,b").build()
-        ).setCondition(
-                LiteFlowConditionBuilder.createWhenCondition()
-                        .setValue("e(f|g|chain2)").build()
+        LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL(
+                "THEN(a, b, WHEN(SWITCH(e).to(f, g, chain2)))"
         ).build();
 
         LiteflowResponse response = flowExecutor.execute2Resp("chain1");
@@ -142,71 +136,35 @@ public class BuilderELDeclMultiSpringbootTest1 extends BaseTest {
     }
 
 
-    //基于普通组件的builder模式测试
     @Test
-    public void testBuilderForConditionNode() throws Exception {
-        LiteFlowNodeBuilder.createNode().setId("a")
-                .setName("组件A")
+    public void testBuilderForSameNodeMultiTimes() throws Exception {
+        LiteFlowNodeBuilder.createNode().setId("a1")
+                .setName("组件A1")
                 .setType(NodeTypeEnum.COMMON)
                 .setClazz(ACmp.class)
                 .build();
-        LiteFlowNodeBuilder.createNode().setId("b")
-                .setName("组件B")
+        LiteFlowNodeBuilder.createNode().setId("a2")
+                .setName("组件A2")
                 .setType(NodeTypeEnum.COMMON)
-                .setClazz(BCmp.class)
+                .setClazz(ACmp.class)
                 .build();
-        LiteFlowNodeBuilder.createNode().setId("c")
-                .setName("组件C")
+        LiteFlowNodeBuilder.createNode().setId("c1")
+                .setName("组件C1")
                 .setType(NodeTypeEnum.COMMON)
                 .setClazz(CCmp.class)
                 .build();
-        LiteFlowNodeBuilder.createNode().setId("d")
-                .setName("组件D")
+        LiteFlowNodeBuilder.createNode().setId("c2")
+                .setName("组件C2")
                 .setType(NodeTypeEnum.COMMON)
-                .setClazz(DCmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("e")
-                .setName("组件E")
-                .setType(NodeTypeEnum.SWITCH)
-                .setClazz(ECmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("f")
-                .setName("组件F")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(FCmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("g")
-                .setName("组件G")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(GCmp.class)
+                .setClazz(CCmp.class)
                 .build();
 
-
-        LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition(
-                LiteFlowConditionBuilder.createThenCondition()
-                        .setExecutable(new ExecutableEntity().setId("c"))
-                        .setExecutable(new ExecutableEntity().setId("d"))
-                        .build()
-        ).build();
-
-        LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition(
-                LiteFlowConditionBuilder
-                        .createThenCondition()
-                        .setExecutable(new ExecutableEntity().setId("a").setTag("hello"))
-                        .setExecutable(new ExecutableEntity().setId("b"))
-                        .build()
-        ).setCondition(
-                LiteFlowConditionBuilder.createWhenCondition()
-                        .setExecutable(
-                                new ExecutableEntity().setId("e")
-                                        .addNodeCondComponent(new ExecutableEntity().setId("f").setTag("FHello"))
-                                        .addNodeCondComponent(new ExecutableEntity().setId("g"))
-                                        .addNodeCondComponent(new ExecutableEntity().setId("chain2")
-                                        )).build()
+        LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL(
+                "THEN(a1,c2,a2,c1)"
         ).build();
 
         LiteflowResponse response = flowExecutor.execute2Resp("chain1");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr());
+        Assert.assertEquals("a1[组件A1]==>c2[组件C2]==>a2[组件A2]==>c1[组件C1]", response.getExecuteStepStr());
     }
 }

+ 0 - 2
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclSpringbootTest2.java

@@ -1,7 +1,5 @@
 package com.yomahub.liteflow.test.builder;
 
-import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
-import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
 import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.flow.LiteflowResponse;

+ 23 - 68
liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/builder/BuilderTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.builder;
 
 import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
-import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
 import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
+import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
 import com.yomahub.liteflow.builder.entity.ExecutableEntity;
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.core.FlowExecutorHolder;
@@ -65,17 +65,12 @@ public class BuilderTest extends BaseTest {
                 .build();
 
 
-        LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition(
-                LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build()
+        LiteFlowChainELBuilder.createChain().setChainName("chain2").setEL(
+                "THEN(c, d)"
         ).build();
 
-        LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition(
-                LiteFlowConditionBuilder
-                        .createThenCondition()
-                        .setValue("a,b").build()
-        ).setCondition(
-                LiteFlowConditionBuilder.createWhenCondition()
-                        .setValue("e(f|g|chain2)").build()
+        LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL(
+                "THEN(a, b, WHEN(SWITCH(e).to(f, g, chain2)))"
         ).build();
 
         LiteflowResponse response = flowExecutor.execute2Resp("chain1");
@@ -122,17 +117,12 @@ public class BuilderTest extends BaseTest {
                 .setClazz(GCmp.class)
                 .build();
 
-        LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition(
-                LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build()
+        LiteFlowChainELBuilder.createChain().setChainName("chain2").setEL(
+                "THEN(c, d)"
         ).build();
 
-        LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition(
-                LiteFlowConditionBuilder
-                        .createThenCondition()
-                        .setValue("a,b").build()
-        ).setCondition(
-                LiteFlowConditionBuilder.createWhenCondition()
-                        .setValue("e(f|g|chain2)").build()
+        LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL(
+                "THEN(a, b, WHEN(SWITCH(e).to(f, g, chain2)))"
         ).build();
 
         LiteflowResponse response = flowExecutor.execute2Resp("chain1");
@@ -142,69 +132,34 @@ public class BuilderTest extends BaseTest {
 
     //基于普通组件的builder模式测试
     @Test
-    public void testBuilderForConditionNode() throws Exception {
-        LiteFlowNodeBuilder.createNode().setId("a")
-                .setName("组件A")
+    public void testBuilderForSameNodeMultiTimes() throws Exception {
+        LiteFlowNodeBuilder.createNode().setId("a1")
+                .setName("组件A1")
                 .setType(NodeTypeEnum.COMMON)
                 .setClazz(ACmp.class)
                 .build();
-        LiteFlowNodeBuilder.createNode().setId("b")
-                .setName("组件B")
+        LiteFlowNodeBuilder.createNode().setId("a2")
+                .setName("组件A2")
                 .setType(NodeTypeEnum.COMMON)
-                .setClazz(BCmp.class)
+                .setClazz(ACmp.class)
                 .build();
-        LiteFlowNodeBuilder.createNode().setId("c")
-                .setName("组件C")
+        LiteFlowNodeBuilder.createNode().setId("c1")
+                .setName("组件C1")
                 .setType(NodeTypeEnum.COMMON)
                 .setClazz(CCmp.class)
                 .build();
-        LiteFlowNodeBuilder.createNode().setId("d")
-                .setName("组件D")
+        LiteFlowNodeBuilder.createNode().setId("c2")
+                .setName("组件C2")
                 .setType(NodeTypeEnum.COMMON)
-                .setClazz(DCmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("e")
-                .setName("组件E")
-                .setType(NodeTypeEnum.SWITCH)
-                .setClazz(ECmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("f")
-                .setName("组件F")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(FCmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("g")
-                .setName("组件G")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(GCmp.class)
+                .setClazz(CCmp.class)
                 .build();
 
-
-        LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition(
-                LiteFlowConditionBuilder.createThenCondition()
-                        .setExecutable(new ExecutableEntity().setId("c"))
-                        .setExecutable(new ExecutableEntity().setId("d"))
-                        .build()
-        ).build();
-
-        LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition(
-                LiteFlowConditionBuilder
-                        .createThenCondition()
-                        .setExecutable(new ExecutableEntity().setId("a").setTag("hello"))
-                        .setExecutable(new ExecutableEntity().setId("b"))
-                        .build()
-        ).setCondition(
-                LiteFlowConditionBuilder.createWhenCondition()
-                        .setExecutable(
-                                new ExecutableEntity().setId("e")
-                                        .addNodeCondComponent(new ExecutableEntity().setId("f").setTag("FHello"))
-                                        .addNodeCondComponent(new ExecutableEntity().setId("g"))
-                                        .addNodeCondComponent(new ExecutableEntity().setId("chain2")
-                                        )).build()
+        LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL(
+                "THEN(a1,c2,a2,c1)"
         ).build();
 
         LiteflowResponse response = flowExecutor.execute2Resp("chain1");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr());
+        Assert.assertEquals("a1[组件A1]==>c2[组件C2]==>a2[组件A2]==>c1[组件C1]", response.getExecuteStepStr());
     }
 }

+ 4 - 3
liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java

@@ -1,16 +1,17 @@
 package com.yomahub.liteflow.test.parsecustom.parser;
 
-import com.yomahub.liteflow.parser.ClassJsonFlowParser;
+import com.yomahub.liteflow.parser.el.ClassJsonFlowELParser;
 
 /**
  * 模拟用户自定义源解析
  * @author dongguo.tao
  * @since 2.5.0
  */
-public class CustomJsonFlowParser extends ClassJsonFlowParser {
+public class CustomJsonFlowParser extends ClassJsonFlowELParser {
     @Override
     public String parseCustom() {
         //模拟自定义解析结果
-        return "{\"flow\":{\"nodes\":{\"node\":[{\"id\":\"a\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ACmp\"},{\"id\":\"b\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.BCmp\"},{\"id\":\"c\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.CCmp\"},{\"id\":\"d\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.DCmp\"},{\"id\":\"e\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ECmp\"},{\"id\":\"f\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.FCmp\"},{\"id\":\"g\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.GCmp\"}]},\"chain\":[{\"name\":\"chain2\",\"condition\":[{\"type\":\"then\",\"value\":\"c,g,f\"}]},{\"name\":\"chain1\",\"condition\":[{\"type\":\"then\",\"value\":\"a,c\"},{\"type\":\"when\",\"value\":\"b,d,e(f|g)\"},{\"type\":\"then\",\"value\":\"chain2\"}]}]}}";
+        String content = "{\"flow\":{\"nodes\":{\"node\":[{\"id\":\"a\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ACmp\"},{\"id\":\"b\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.BCmp\"},{\"id\":\"c\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.CCmp\"},{\"id\":\"d\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.DCmp\"},{\"id\":\"e\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ECmp\"},{\"id\":\"f\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.FCmp\"},{\"id\":\"g\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.GCmp\"}]},\"chain\":[{\"name\":\"chain2\",\"value\":\"THEN(c, g, f)\"},{\"name\":\"chain1\",\"value\":\"THEN(a, c, WHEN(b, d, SWITCH(e).to(f, g), chain2))\"}]}}";
+        return content;
     }
 }

+ 3 - 3
liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java

@@ -1,6 +1,6 @@
 package com.yomahub.liteflow.test.parsecustom.parser;
 
-import com.yomahub.liteflow.parser.ClassXmlFlowParser;
+import com.yomahub.liteflow.parser.el.ClassXmlFlowELParser;
 
 /**
  * 非spring环境的自定义xml parser单元测试
@@ -8,10 +8,10 @@ import com.yomahub.liteflow.parser.ClassXmlFlowParser;
  * @author bryan.zhang
  * @since 2.5.7
  */
-public class CustomXmlFlowParser extends ClassXmlFlowParser {
+public class CustomXmlFlowParser extends ClassXmlFlowELParser {
 
     @Override
     public String parseCustom() {
-        return "<?xml version=\"1.0\" encoding=\"UTF-8\"?><flow><nodes><node id=\"a\" class=\"com.yomahub.liteflow.test.parsecustom.cmp.ACmp\"/><node id=\"b\" class=\"com.yomahub.liteflow.test.parsecustom.cmp.BCmp\"/><node id=\"c\" class=\"com.yomahub.liteflow.test.parsecustom.cmp.CCmp\"/><node id=\"d\" class=\"com.yomahub.liteflow.test.parsecustom.cmp.DCmp\"/><node id=\"e\" class=\"com.yomahub.liteflow.test.parsecustom.cmp.ECmp\"/><node id=\"f\" class=\"com.yomahub.liteflow.test.parsecustom.cmp.FCmp\"/><node id=\"g\" class=\"com.yomahub.liteflow.test.parsecustom.cmp.GCmp\"/></nodes><chain name=\"chain1\"><then value=\"a,b,c,d\"/></chain></flow>";
+        return "<?xml version=\"1.0\" encoding=\"UTF-8\"?><flow><nodes><node id=\"a\" class=\"com.yomahub.liteflow.test.parser.cmp.ACmp\"/><node id=\"b\" class=\"com.yomahub.liteflow.test.parser.cmp.BCmp\"/><node id=\"c\" class=\"com.yomahub.liteflow.test.parser.cmp.CCmp\"/><node id=\"d\" class=\"com.yomahub.liteflow.test.parser.cmp.DCmp\"/></nodes><chain name=\"chain1\">THEN(a,b,c,d)</chain></flow>";
     }
 }

+ 0 - 2
liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteFlowXmlScriptBuilderGroovyELTest.java

@@ -1,7 +1,5 @@
 package com.yomahub.liteflow.test.script.groovy;
 
-import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
-import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
 import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
 import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
 import com.yomahub.liteflow.core.FlowExecutor;

+ 0 - 2
liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteFlowXmlScriptBuilderQLExpressELTest.java

@@ -1,7 +1,5 @@
 package com.yomahub.liteflow.test.script.qlexpress;
 
-import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
-import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
 import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
 import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
 import com.yomahub.liteflow.core.FlowExecutor;

+ 0 - 3
liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELSpringbootTest1.java

@@ -1,10 +1,7 @@
 package com.yomahub.liteflow.test.builder;
 
-import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
-import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
 import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
 import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
-import com.yomahub.liteflow.builder.entity.ExecutableEntity;
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.enums.NodeTypeEnum;
 import com.yomahub.liteflow.flow.LiteflowResponse;

+ 0 - 2
liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELSpringbootTest2.java

@@ -1,7 +1,5 @@
 package com.yomahub.liteflow.test.builder;
 
-import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
-import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
 import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.flow.LiteflowResponse;

+ 0 - 1
liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java

@@ -1,6 +1,5 @@
 package com.yomahub.liteflow.test.parsecustom.parser;
 
-import com.yomahub.liteflow.parser.ClassJsonFlowParser;
 import com.yomahub.liteflow.parser.el.ClassJsonFlowELParser;
 
 /**

+ 0 - 1
liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java

@@ -1,6 +1,5 @@
 package com.yomahub.liteflow.test.parsecustom.parser;
 
-import com.yomahub.liteflow.parser.ClassXmlFlowParser;
 import com.yomahub.liteflow.parser.el.ClassXmlFlowELParser;
 import com.yomahub.liteflow.test.parsecustom.bean.TestBean;
 

+ 0 - 83
liteflow-testcase-old/.gitignore

@@ -1,83 +0,0 @@
-# Compiled source #
-###################
-*.com
-*.class
-*.dll
-*.exe
-*.o
-*.so
-
-
-# Packages #
-############
-# it's better to unpack these files and commit the raw source
-# git has its own built in compression methods
-*.7z
-*.dmg
-*.gz
-*.iso
-*.jar
-*.rar
-*.tar
-*.zip
-*.war
-*.del
-*.pmd
-.tern-project
-
-
-# Logs and databases #
-######################
-*.log
-*.log.*
-# OS generated files #
-######################
-.DS_Store*
-ehthumbs.db
-Icon?
-Thumbs.db
-
-
-# Editor Files #
-################
-*~
-*.swp
-
-
-# Gradle Files #
-################
-.gradle
-
-
-# Build output directies
-/target
-*/target
-/build
-*/build
-
-
-# IntelliJ specific files/directories
-out
-.idea
-*.ipr
-*.iws
-*.iml
-atlassian-ide-plugin.xml
-
-
-# Eclipse specific files/directories
-.classpath
-.project
-.settings
-.metadata
-.myeclipse
-
-
-# NetBeans specific files/directories
-.nbattrs
-
-*.mymetadata
-/logs
-*/logs
-
-.flattened-pom.xml

+ 0 - 52
liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml

@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>liteflow-testcase-old</artifactId>
-        <groupId>com.yomahub</groupId>
-        <version>${revision}</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>liteflow-testcase-declare-springboot</artifactId>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.yomahub</groupId>
-            <artifactId>liteflow-spring-boot-starter</artifactId>
-            <version>${revision}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.aspectj</groupId>
-            <artifactId>aspectjweaver</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>${springboot.version}</version>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <version>2.8.2</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>

+ 0 - 21
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java

@@ -1,21 +0,0 @@
-package com.yomahub.liteflow.test;
-
-import com.yomahub.liteflow.flow.FlowBus;
-import com.yomahub.liteflow.property.LiteflowConfigGetter;
-import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
-import com.yomahub.liteflow.spring.ComponentScanner;
-import com.yomahub.liteflow.thread.ExecutorHelper;
-import org.junit.AfterClass;
-
-public class BaseTest {
-
-    @AfterClass
-    public static void cleanScanCache(){
-        ComponentScanner.cleanCache();
-        FlowBus.cleanCache();
-        ExecutorHelper.loadInstance().clearExecutorServiceMap();
-        SpiFactoryCleaner.clean();
-        LiteflowConfigGetter.clean();
-    }
-
-}

+ 0 - 42
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringbootTest.java

@@ -1,42 +0,0 @@
-package com.yomahub.liteflow.test.absoluteConfigPath;
-
-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.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-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 javax.annotation.Resource;
-
-/**
- * springboot环境下异步线程超时日志打印测试
- * @author Bryan.Zhang
- * @since 2.6.4
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/absoluteConfigPath/application.properties")
-@SpringBootTest(classes = AbsoluteConfigPathSpringbootTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.absoluteConfigPath.cmp"})
-public class AbsoluteConfigPathSpringbootTest extends BaseTest {
-
-    private final Logger log = LoggerFactory.getLogger(this.getClass());
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    @Test
-    public void testAbsoluteConfig() throws Exception{
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
-        Assert.assertTrue(response.isSuccess());
-    }
-}

+ 0 - 24
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java

@@ -1,24 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.absoluteConfigPath.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("a")
-@LiteflowCmpDefine
-public class ACmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("ACmp executed!");
-	}
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.absoluteConfigPath.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("b")
-@LiteflowCmpDefine
-public class BCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("BCmp executed!");
-	}
-
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.absoluteConfigPath.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("c")
-@LiteflowCmpDefine
-public class CCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("CCmp executed!");
-	}
-
-}

+ 0 - 41
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java

@@ -1,41 +0,0 @@
-package com.yomahub.liteflow.test.aop;
-
-import com.yomahub.liteflow.test.BaseTest;
-
-/**
- * 切面场景单元测试
- * 在声明式组件场景中,自定义aspect的aop不生效的,因为生成的代理类并不是原类,也不是原类的子类,而是NodeComponent的子类
- * 所以切不到,暂且没有想出办法来解决,这个测试类暂时不用
- * @author Bryan.Zhang
- */
-/*@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/aop/application.properties")
-@SpringBootTest(classes = CustomAOPSpringbootTest.class)
-@EnableAutoConfiguration
-@Import(CustomAspect.class)
-@ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"})*/
-public class CustomAOPSpringbootTest extends BaseTest {
-
-    /*@Resource
-    private FlowExecutor flowExecutor;
-
-    //测试自定义AOP,串行场景
-    @Test
-    public void testCustomAopS() {
-        LiteflowResponse response= flowExecutor.execute2Resp("chain1", "it's a request");
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("before_after", response.getContextBean.getData("a"));
-        Assert.assertEquals("before_after", context.getData("b"));
-        Assert.assertEquals("before_after", context.getData("c"));
-    }
-
-    //测试自定义AOP,并行场景
-    @Test
-    public void testCustomAopP() {
-        LiteflowResponse response= flowExecutor.execute2Resp("chain2", "it's a request");
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("before_after", context.getData("a"));
-        Assert.assertEquals("before_after", context.getData("b"));
-        Assert.assertEquals("before_after", context.getData("c"));
-    }*/
-}

+ 0 - 79
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java

@@ -1,79 +0,0 @@
-package com.yomahub.liteflow.test.aop;
-
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.spring.ComponentScanner;
-import com.yomahub.liteflow.test.BaseTest;
-import com.yomahub.liteflow.test.aop.aspect.CmpAspect;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Import;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-
-/**
- * 切面场景单元测试
- * @author Bryan.Zhang
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/aop/application.properties")
-@SpringBootTest(classes = GlobalAOPSpringbootTest.class)
-@EnableAutoConfiguration
-@Import(CmpAspect.class)
-@ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"})
-public class GlobalAOPSpringbootTest extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    //测试全局AOP,串行场景
-    @Test
-    public void testGlobalAopS() {
-        LiteflowResponse response= flowExecutor.execute2Resp("chain1", "it's a request");
-        DefaultContext context = response.getFirstContextBean();
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("before_after", context.getData("a"));
-        Assert.assertEquals("before_after", context.getData("b"));
-        Assert.assertEquals("before_after", context.getData("c"));
-        Assert.assertEquals("before_after", context.getData("d"));
-        Assert.assertEquals("before_after", context.getData("e"));
-    }
-
-    //测试全局AOP,并行场景
-    @Test
-    public void testGlobalAopP() {
-        LiteflowResponse response= flowExecutor.execute2Resp("chain2", "it's a request");
-        DefaultContext context = response.getFirstContextBean();
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("before_after", context.getData("a"));
-        Assert.assertEquals("before_after", context.getData("b"));
-        Assert.assertEquals("before_after", context.getData("c"));
-        Assert.assertEquals("before_after", context.getData("d"));
-        Assert.assertEquals("before_after", context.getData("e"));
-    }
-
-    @Test
-    public void testGlobalAopException() {
-        LiteflowResponse response= flowExecutor.execute2Resp("chain3", "it's a request");
-        DefaultContext context = response.getFirstContextBean();
-        Assert.assertFalse(response.isSuccess());
-        Assert.assertEquals("before_after", context.getData("a"));
-        Assert.assertEquals("before_after", context.getData("b"));
-        Assert.assertEquals("before_after", context.getData("c"));
-        Assert.assertEquals("before_after", context.getData("f"));
-    }
-
-    @AfterClass
-    public static void cleanScanCache(){
-        BaseTest.cleanScanCache();
-        ComponentScanner.cmpAroundAspect = null;
-    }
-}

+ 0 - 20
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java

@@ -1,20 +0,0 @@
-package com.yomahub.liteflow.test.aop.aspect;
-
-import cn.hutool.core.util.StrUtil;
-import com.yomahub.liteflow.aop.ICmpAroundAspect;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.slot.Slot;
-
-public class CmpAspect implements ICmpAroundAspect {
-    @Override
-    public void beforeProcess(String nodeId, Slot slot) {
-        DefaultContext context = slot.getFirstContextBean();
-        context.setData(nodeId, "before");
-    }
-
-    @Override
-    public void afterProcess(String nodeId, Slot slot) {
-        DefaultContext context = slot.getFirstContextBean();
-        context.setData(nodeId, StrUtil.format("{}_{}", context.getData(nodeId), "after"));
-    }
-}

+ 0 - 28
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java

@@ -1,28 +0,0 @@
-package com.yomahub.liteflow.test.aop.aspect;
-
-import cn.hutool.core.util.StrUtil;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.slot.Slot;
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-
-@Aspect
-public class CustomAspect {
-
-    @Pointcut("execution(* com.yomahub.liteflow.test.aop.cmp1.*.process(*))")
-    public void cut() {
-    }
-
-    @Around("cut()")
-    public Object around(ProceedingJoinPoint jp) throws Throwable {
-        NodeComponent cmp = (NodeComponent) jp.getThis();
-        DefaultContext context = cmp.getFirstContextBean();
-        context.setData(cmp.getNodeId(), "before");
-        Object returnObj = jp.proceed();
-        context.setData(cmp.getNodeId(), StrUtil.format("{}_{}", context.getData(cmp.getNodeId()), "after"));
-        return returnObj;
-    }
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.aop.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("a")
-@LiteflowCmpDefine
-public class ACmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("Acomp executed!");
-	}
-
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.aop.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("b")
-@LiteflowCmpDefine
-public class BCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("Bcomp executed!");
-	}
-
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.aop.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("c")
-@LiteflowCmpDefine
-public class CCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("Ccomp executed!");
-	}
-
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.aop.cmp2;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("d")
-@LiteflowCmpDefine
-public class DCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("Dcomp executed!");
-	}
-
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.aop.cmp2;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("e")
-@LiteflowCmpDefine
-public class ECmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("Ecomp executed!");
-	}
-
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.aop.cmp2;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("f")
-@LiteflowCmpDefine
-public class FCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		throw new RuntimeException("test error");
-	}
-
-}

+ 0 - 139
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringbootTest.java

@@ -1,139 +0,0 @@
-package com.yomahub.liteflow.test.asyncNode;
-
-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 com.yomahub.liteflow.test.asyncNode.exception.TestException;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-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 javax.annotation.Resource;
-
-/**
- * 测试隐式调用子流程
- * 单元测试
- *
- * @author ssss
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/asyncNode/application.properties")
-@SpringBootTest(classes = AsyncNodeSpringbootTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.asyncNode.cmp"})
-public class AsyncNodeSpringbootTest extends BaseTest {
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    /*****
-     * 标准chain 嵌套选择 嵌套子chain进行执行
-     * 验证了when情况下 多个node是并行执行
-     * 验证了默认参数情况下 when可以加载执行
-     * **/
-    @Test
-    public void testAsyncFlow1() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a base request");
-        Assert.assertTrue(response.isSuccess());
-        System.out.println(response.getExecuteStepStr());
-    }
-
-    //这个和test1有点类似,只不过进一步验证了步骤
-    @Test
-    public void testAsyncFlow2() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain2", "it's a base request");
-        Assert.assertTrue(ListUtil.toList("b==>j==>g==>f==>h","b==>j==>g==>h==>f",
-                "b==>j==>h==>g==>f","b==>j==>h==>f==>g",
-                "b==>j==>f==>h==>g","b==>j==>f==>g==>h"
-                ).contains(response.getExecuteStepStr()));
-    }
-
-    //测试errorResume,默认的errorResume为false,这里测试默认的
-    @Test
-    public void testAsyncFlow3_1() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain3-1", "it's a base request");
-        Assert.assertFalse(response.isSuccess());
-        Assert.assertEquals(response.getSlot().getException().getClass(), TestException.class);
-    }
-
-    //测试errorResume,默认的errorResume为false,这里设置为true
-    @Test
-    public void testAsyncFlow3_2() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain3-2", "it's a base request");
-        Assert.assertTrue(response.isSuccess());
-    }
-
-    //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了不抛错
-    @Test
-    public void testAsyncFlow4() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain4", "it's a base request");
-        DefaultContext context = response.getFirstContextBean();
-        //因为不记录错误,所以最终结果是true
-        Assert.assertTrue(response.isSuccess());
-        //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下
-        Integer count = context.getData("count");
-        Assert.assertEquals(new Integer(2), count);
-        //因为配置了不抛错,所以response里的cause应该为null
-        Assert.assertNull(response.getCause());
-    }
-
-    //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了会抛错
-    @Test
-    public void testAsyncFlow5() throws Exception {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain5", "it's a base request");
-        DefaultContext context = response.getFirstContextBean();
-        //整个并行组是报错的,所以最终结果是false
-        Assert.assertFalse(response.isSuccess());
-        //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下
-        Integer count = context.getData("count");
-        Assert.assertEquals(new Integer(2), count);
-        //因为第一个when配置了会报错,所以response里的cause里应该会有TestException
-        Assert.assertEquals(TestException.class, response.getCause().getClass());
-    }
-
-    //不同group的并行组,不会合并,第一个when的errorResume是false,会抛错,那第二个when就不会执行
-    @Test
-    public void testAsyncFlow6() throws Exception {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain6", "it's a base request");
-        DefaultContext context = response.getFirstContextBean();
-        //第一个when会抛错,所以最终结果是false
-        Assert.assertFalse(response.isSuccess());
-        //因为是不同组并行组,第一组的when里的i就抛错了,所以i就执行了1遍
-        Integer count = context.getData("count");
-        Assert.assertEquals(new Integer(1), count);
-        //第一个when会报错,所以最终response的cause里应该会有TestException
-        Assert.assertEquals(TestException.class, response.getCause().getClass());
-    }
-
-    //不同group的并行组,不会合并,第一个when的errorResume是true,不会报错,那第二个when还会继续执行,但是第二个when的errorResume是false,所以第二个when会报错
-    @Test
-    public void testAsyncFlow7() throws Exception {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain7", "it's a base request");
-        DefaultContext context = response.getFirstContextBean();
-        //第二个when会抛错,所以最终结果是false
-        Assert.assertFalse(response.isSuccess());
-        //  传递了slotIndex,则set的size==2
-        Integer count = context.getData("count");
-        Assert.assertEquals(new Integer(2), count);
-        //第一个when会报错,所以最终response的cause里应该会有TestException
-        Assert.assertEquals(TestException.class, response.getCause().getClass());
-    }
-
-    //测试任意异步一个执行完即继续的场景
-    //d g h并行,配置了any=true,其中d耗时1秒,g耗时0.5秒,其他都不设耗时
-    //最终执行效果应该是h先返回,然后执行abc,最后gd
-    //这里要注意的是,由于step是先加入,所以step的打印顺序并不是这样的。但是实际执行是正确的
-    @Test
-    public void testAsyncFlow8() throws Exception {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain8", "it's a base request");
-        DefaultContext context = response.getFirstContextBean();
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertTrue(context.getData("check").toString().startsWith("habc"));
-    }
-}

+ 0 - 29
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java

@@ -1,29 +0,0 @@
-package com.yomahub.liteflow.test.asyncNode.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.slot.Slot;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-
-@Component("a")
-@LiteflowCmpDefine
-public class ACmp{
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) {
-        DefaultContext context = bindCmp.getFirstContextBean();
-        synchronized (NodeComponent.class){
-            if (context.hasData("check")){
-                String str = context.getData("check");
-                str += bindCmp.getNodeId();
-                context.setData("check", str);
-            }else{
-                context.setData("check", bindCmp.getNodeId());
-            }
-        }
-        System.out.println("Acomp executed!");
-    }
-}

+ 0 - 29
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java

@@ -1,29 +0,0 @@
-package com.yomahub.liteflow.test.asyncNode.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.slot.Slot;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-
-@Component("b")
-@LiteflowCmpDefine
-public class BCmp{
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) {
-        DefaultContext context = bindCmp.getFirstContextBean();
-        synchronized (NodeComponent.class){
-            if (context.hasData("check")){
-                String str = context.getData("check");
-                str += bindCmp.getNodeId();
-                context.setData("check", str);
-            }else{
-                context.setData("check", bindCmp.getNodeId());
-            }
-        }
-        System.out.println("Bcomp executed!");
-    }
-}

+ 0 - 29
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java

@@ -1,29 +0,0 @@
-package com.yomahub.liteflow.test.asyncNode.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.slot.Slot;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-
-@Component("c")
-@LiteflowCmpDefine
-public class CCmp{
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) throws Exception {
-        DefaultContext context = bindCmp.getFirstContextBean();
-        synchronized (NodeComponent.class){
-            if (context.hasData("check")){
-                String str = context.getData("check");
-                str += bindCmp.getNodeId();
-                context.setData("check", str);
-            }else{
-                context.setData("check", bindCmp.getNodeId());
-            }
-        }
-        System.out.println("Ccomp executed!");
-    }
-}

+ 0 - 30
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java

@@ -1,30 +0,0 @@
-package com.yomahub.liteflow.test.asyncNode.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.slot.Slot;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-
-@Component("d")
-@LiteflowCmpDefine
-public class DCmp{
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) throws Exception {
-        Thread.sleep(1000);
-        DefaultContext context = bindCmp.getFirstContextBean();
-        synchronized (NodeComponent.class){
-            if (context.hasData("check")){
-                String str = context.getData("check");
-                str += bindCmp.getNodeId();
-                context.setData("check", str);
-            }else{
-                context.setData("check", bindCmp.getNodeId());
-            }
-        }
-        System.out.println("Dcomp executed!");
-    }
-}

+ 0 - 19
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java

@@ -1,19 +0,0 @@
-package com.yomahub.liteflow.test.asyncNode.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-
-@Component("e")
-@LiteflowSwitchCmpDefine
-public class ECmp{
-
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS_SWITCH)
-    public String processSwitch(NodeComponent bindCmp) throws Exception {
-        System.out.println("Ecomp executed!");
-        return "g";
-    }
-}

+ 0 - 18
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java

@@ -1,18 +0,0 @@
-package com.yomahub.liteflow.test.asyncNode.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-
-@Component("f")
-@LiteflowCmpDefine
-public class FCmp{
-
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) throws Exception {
-        System.out.println("Fcomp executed!");
-    }
-}

+ 0 - 31
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java

@@ -1,31 +0,0 @@
-package com.yomahub.liteflow.test.asyncNode.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.slot.Slot;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-
-@Component("g")
-@LiteflowCmpDefine
-public class GCmp{
-
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) throws Exception {
-        Thread.sleep(500);
-        DefaultContext context = bindCmp.getFirstContextBean();
-        synchronized (NodeComponent.class){
-            if (context.hasData("check")){
-                String str = context.getData("check");
-                str += bindCmp.getNodeId();
-                context.setData("check", str);
-            }else{
-                context.setData("check", bindCmp.getNodeId());
-            }
-        }
-        System.out.println("Gcomp executed!");
-    }
-}

+ 0 - 31
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java

@@ -1,31 +0,0 @@
-package com.yomahub.liteflow.test.asyncNode.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.slot.Slot;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-
-@Component("h")
-@LiteflowCmpDefine
-public class HCmp{
-
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) throws Exception {
-        DefaultContext context = bindCmp.getFirstContextBean();
-        synchronized (NodeComponent.class){
-            if (context.hasData("check")){
-                String str = context.getData("check");
-                str += bindCmp.getNodeId();
-                context.setData("check", str);
-            }else{
-                context.setData("check", bindCmp.getNodeId());
-            }
-        }
-
-        System.out.println("Hcomp executed!");
-    }
-}

+ 0 - 31
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java

@@ -1,31 +0,0 @@
-package com.yomahub.liteflow.test.asyncNode.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.slot.Slot;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import com.yomahub.liteflow.test.asyncNode.exception.TestException;
-import org.springframework.stereotype.Component;
-
-
-@Component("i")
-@LiteflowCmpDefine
-public class ICmp {
-
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) throws Exception {
-        DefaultContext context = bindCmp.getFirstContextBean();
-        synchronized (ICmp.class){
-            if (context.hasData("count")){
-                Integer count = context.getData("count");
-                context.setData("count", ++count);
-            } else{
-                context.setData("count", 1);
-            }
-        }
-        System.out.println("Icomp executed! throw Exception!");
-        throw new TestException();
-    }
-}

+ 0 - 19
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java

@@ -1,19 +0,0 @@
-package com.yomahub.liteflow.test.asyncNode.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-
-@Component("j")
-@LiteflowSwitchCmpDefine
-public class JCmp{
-
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS_SWITCH)
-    public String processSwitch(NodeComponent bindCmp) throws Exception {
-        System.out.println("Jcomp executed!");
-        return "chain3";
-    }
-}

+ 0 - 4
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java

@@ -1,4 +0,0 @@
-package com.yomahub.liteflow.test.asyncNode.exception;
-
-public class TestException extends Exception{
-}

+ 0 - 39
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseSpringbootTest.java

@@ -1,39 +0,0 @@
-package com.yomahub.liteflow.test.base;
-
-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.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-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 javax.annotation.Resource;
-
-/**
- * springboot环境最普通的例子测试
- * @author Bryan.Zhang
- * @since 2.6.4
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/base/application.properties")
-@SpringBootTest(classes = BaseSpringbootTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.base.cmp"})
-public class BaseSpringbootTest extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    @Test
-    public void testBase() throws Exception{
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
-        Assert.assertTrue(response.isSuccess());
-    }
-
-}

+ 0 - 24
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java

@@ -1,24 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.base.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("a")
-@LiteflowCmpDefine
-public class ACmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("ACmp executed!");
-	}
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.base.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("b")
-@LiteflowCmpDefine
-public class BCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("BCmp executed!");
-	}
-
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.base.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("c")
-@LiteflowCmpDefine
-public class CCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("CCmp executed!");
-	}
-
-}

+ 0 - 31
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java

@@ -1,31 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.base.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-
-@Component("d")
-@LiteflowCmpDefine
-public class DCmp{
-
-	@Resource
-	private TestDomain testDomain;
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		testDomain.sayHi();
-		System.out.println("CCmp executed!");
-	}
-
-}

+ 0 - 10
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/TestDomain.java

@@ -1,10 +0,0 @@
-package com.yomahub.liteflow.test.base.cmp;
-
-import org.springframework.stereotype.Component;
-
-@Component
-public class TestDomain {
-    public void sayHi(){
-        System.out.println("hello");
-    }
-}

+ 0 - 217
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest1.java

@@ -1,217 +0,0 @@
-package com.yomahub.liteflow.test.builder;
-
-import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
-import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
-import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.builder.entity.ExecutableEntity;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.enums.NodeTypeEnum;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.test.BaseTest;
-import com.yomahub.liteflow.test.builder.cmp1.*;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-
-//基于builder模式的单元测试
-//这里只是最基本的builder模式的测试,只是为了验证在springboot模式下的正常性
-//更详细的builder模式测试用例会单独拉testcase去做
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = BuilderSpringbootTest1.class)
-@EnableAutoConfiguration
-public class BuilderSpringbootTest1 extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    //基于普通组件的builder模式测试
-    @Test
-    public void testBuilder() throws Exception {
-        LiteFlowNodeBuilder.createNode().setId("a")
-                .setName("组件A")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz("com.yomahub.liteflow.test.builder.cmp1.ACmp")
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("b")
-                .setName("组件B")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz("com.yomahub.liteflow.test.builder.cmp1.BCmp")
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("c")
-                .setName("组件C")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz("com.yomahub.liteflow.test.builder.cmp1.CCmp")
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("d")
-                .setName("组件D")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz("com.yomahub.liteflow.test.builder.cmp1.DCmp")
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("e")
-                .setName("组件E")
-                .setType(NodeTypeEnum.SWITCH)
-                .setClazz("com.yomahub.liteflow.test.builder.cmp1.ECmp")
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("f")
-                .setName("组件F")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz("com.yomahub.liteflow.test.builder.cmp1.FCmp")
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("g")
-                .setName("组件G")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz("com.yomahub.liteflow.test.builder.cmp1.GCmp")
-                .build();
-
-
-        LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition(
-                LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build()
-        ).build();
-
-        LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition(
-                LiteFlowConditionBuilder
-                        .createThenCondition()
-                        .setValue("a,b").build()
-        ).setCondition(
-                LiteFlowConditionBuilder.createWhenCondition()
-                        .setValue("e(f|g|chain2)").build()
-        ).build();
-
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1");
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr());
-    }
-
-    //基于普通组件的builder模式测试
-    @Test
-    public void testBuilderForClassAndCode() throws Exception {
-        LiteFlowNodeBuilder.createNode().setId("a")
-                .setName("组件A")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(ACmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("b")
-                .setName("组件B")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(BCmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("c")
-                .setName("组件C")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(CCmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("d")
-                .setName("组件D")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(DCmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("e")
-                .setName("组件E")
-                .setType(NodeTypeEnum.SWITCH)
-                .setClazz(ECmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("f")
-                .setName("组件F")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(FCmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("g")
-                .setName("组件G")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(GCmp.class)
-                .build();
-
-
-        LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition(
-                LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build()
-        ).build();
-
-        LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition(
-                LiteFlowConditionBuilder
-                        .createThenCondition()
-                        .setValue("a,b").build()
-        ).setCondition(
-                LiteFlowConditionBuilder.createWhenCondition()
-                        .setValue("e(f|g|chain2)").build()
-        ).build();
-
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1");
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr());
-    }
-
-
-    //基于普通组件的builder模式测试
-    @Test
-    public void testBuilderForConditionNode() throws Exception {
-        LiteFlowNodeBuilder.createNode().setId("a")
-                .setName("组件A")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(ACmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("b")
-                .setName("组件B")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(BCmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("c")
-                .setName("组件C")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(CCmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("d")
-                .setName("组件D")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(DCmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("e")
-                .setName("组件E")
-                .setType(NodeTypeEnum.SWITCH)
-                .setClazz(ECmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("f")
-                .setName("组件F")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(FCmp.class)
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("g")
-                .setName("组件G")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz(GCmp.class)
-                .build();
-
-
-        LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition(
-                LiteFlowConditionBuilder.createThenCondition()
-                        .setExecutable(new ExecutableEntity().setId("c"))
-                        .setExecutable(new ExecutableEntity().setId("d"))
-                        .build()
-        ).build();
-
-        LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition(
-                LiteFlowConditionBuilder
-                        .createThenCondition()
-                        .setExecutable(new ExecutableEntity().setId("a").setTag("hello"))
-                        .setExecutable(new ExecutableEntity().setId("b"))
-                        .build()
-        ).setCondition(
-                LiteFlowConditionBuilder.createWhenCondition()
-                        .setExecutable(
-                                new ExecutableEntity().setId("e")
-                                        .addNodeCondComponent(new ExecutableEntity().setId("f").setTag("FHello"))
-                                        .addNodeCondComponent(new ExecutableEntity().setId("g"))
-                                        .addNodeCondComponent(new ExecutableEntity().setId("chain2")
-                                        )).build()
-        ).build();
-
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1");
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr());
-    }
-}

+ 0 - 41
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest2.java

@@ -1,41 +0,0 @@
-package com.yomahub.liteflow.test.builder;
-
-import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
-import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
-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.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-
-//基于builder模式的单元测试
-//这里测试的是通过spring去扫描,但是通过代码去构建chain的用例
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = BuilderSpringbootTest2.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.builder.cmp2"})
-public class BuilderSpringbootTest2 extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    //通过spring去扫描组件,通过代码去构建chain
-    @Test
-    public void testBuilder() throws Exception {
-        LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition(
-                LiteFlowConditionBuilder.createThenCondition().setValue("h,i,j").build()
-        ).build();
-
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1");
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("h==>i==>j", response.getExecuteStepStr());
-    }
-}

+ 0 - 22
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java

@@ -1,22 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.builder.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowCmpDefine
-public class ACmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("ACmp executed!");
-	}
-}

+ 0 - 23
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java

@@ -1,23 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.builder.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowCmpDefine
-public class BCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("BCmp executed!");
-	}
-
-}

+ 0 - 23
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java

@@ -1,23 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.builder.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowCmpDefine
-public class CCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("CCmp executed!");
-	}
-
-}

+ 0 - 23
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java

@@ -1,23 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.builder.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowCmpDefine
-public class DCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("DCmp executed!");
-	}
-
-}

+ 0 - 24
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ECmp.java

@@ -1,24 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.builder.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowSwitchCmpDefine
-public class ECmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS_SWITCH)
-	public String processSwitch(NodeComponent bindCmp) throws Exception {
-		System.out.println("ECmp executed!");
-		return "chain2";
-	}
-
-}

+ 0 - 23
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java

@@ -1,23 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.builder.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowCmpDefine
-public class FCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("FCmp executed!");
-	}
-
-}

+ 0 - 23
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/GCmp.java

@@ -1,23 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.builder.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowCmpDefine
-public class GCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("GCmp executed!");
-	}
-
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/HCmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.builder.cmp2;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowComponent;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowComponent("h")
-@LiteflowCmpDefine
-public class HCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("HCmp executed!");
-	}
-
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/ICmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.builder.cmp2;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowComponent;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowComponent("i")
-@LiteflowCmpDefine
-public class ICmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("ICmp executed!");
-	}
-
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/JCmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.builder.cmp2;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowComponent;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowComponent("j")
-@LiteflowCmpDefine
-public class JCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("JCmp executed!");
-	}
-
-}

+ 0 - 64
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringbootTest.java

@@ -1,64 +0,0 @@
-package com.yomahub.liteflow.test.cmpRetry;
-
-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.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-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 javax.annotation.Resource;
-
-
-/**
- * 测试springboot下的节点执行器
- * @author Bryan.Zhang
- * @since 2.5.10
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/cmpRetry/application.properties")
-@SpringBootTest(classes = LiteflowRetrySpringbootTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.cmpRetry.cmp"})
-public class LiteflowRetrySpringbootTest extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    //全局重试配置测试
-    @Test
-    public void testRetry1() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("a==>b==>b==>b", response.getExecuteStepStr());
-    }
-
-    //单个组件重试配置测试
-    @Test
-    public void testRetry2() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertFalse(response.isSuccess());
-        Assert.assertEquals("c==>c==>c==>c==>c==>c", response.getExecuteStepStr());
-    }
-
-    //单个组件指定异常,但抛出的并不是指定异常的场景测试
-    @Test
-    public void testRetry3() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg");
-        Assert.assertFalse(response.isSuccess());
-    }
-
-    //单个组件指定异常重试,抛出的是指定异常或者
-    @Test
-    public void testRetry4() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg");
-        Assert.assertFalse(response.isSuccess());
-        Assert.assertEquals("e==>e==>e==>e==>e==>e", response.getExecuteStepStr());
-    }
-}

+ 0 - 24
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java

@@ -1,24 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.cmpRetry.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowComponent;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowComponent("a")
-@LiteflowCmpDefine
-public class ACmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("ACmp executed!");
-	}
-}

+ 0 - 31
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/BCmp.java

@@ -1,31 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.cmpRetry.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowComponent;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowComponent("b")
-@LiteflowCmpDefine
-public class BCmp {
-
-	private int flag = 0;
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("BCmp executed!");
-		if (flag < 2){
-			flag++;
-			throw new RuntimeException("demo exception");
-		}
-	}
-
-}

+ 0 - 28
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java

@@ -1,28 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.cmpRetry.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowComponent;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.annotation.LiteflowRetry;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowComponent("c")
-@LiteflowRetry(5)
-@LiteflowCmpDefine
-public class CCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("CCmp executed!");
-		throw new RuntimeException("demo exception");
-	}
-
-}

+ 0 - 28
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java

@@ -1,28 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.cmpRetry.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowComponent;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.annotation.LiteflowRetry;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowComponent("d")
-@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class})
-@LiteflowCmpDefine
-public class DCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("DCmp executed!");
-		throw new RuntimeException("demo exception");
-	}
-
-}

+ 0 - 28
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java

@@ -1,28 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.cmpRetry.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowComponent;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.annotation.LiteflowRetry;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-
-@LiteflowComponent("e")
-@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class})
-@LiteflowCmpDefine
-public class ECmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("ECmp executed!");
-		throw new NullPointerException("demo null exception");
-	}
-
-}

+ 0 - 52
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepSpringbootTest.java

@@ -1,52 +0,0 @@
-package com.yomahub.liteflow.test.cmpStep;
-
-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.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-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 javax.annotation.Resource;
-
-/**
- * springboot环境最普通的例子测试
- * @author Bryan.Zhang
- * @since 2.6.4
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/cmpStep/application.properties")
-@SpringBootTest(classes = CmpStepSpringbootTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.cmpStep.cmp"})
-public class CmpStepSpringbootTest extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    @Test
-    public void testStep() throws Exception{
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
-        Assert.assertFalse(response.isSuccess());
-        Assert.assertTrue(response.getExecuteSteps().get("a").isSuccess());
-        Assert.assertTrue(response.getExecuteSteps().get("b").isSuccess());
-        Assert.assertFalse(response.getExecuteSteps().get("c").isSuccess());
-        Assert.assertFalse(response.getExecuteSteps().get("d").isSuccess());
-        Assert.assertTrue(response.getExecuteSteps().get("c").getTimeSpent() >= 2000);
-        Assert.assertEquals(RuntimeException.class, response.getExecuteSteps().get("c").getException().getClass());
-        Assert.assertEquals(RuntimeException.class, response.getExecuteSteps().get("d").getException().getClass());
-    }
-
-    @Test
-    public void testStep2() throws Exception{
-        LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("a==>b", response.getExecuteStepStrWithoutTime());
-    }
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.cmpStep.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("a")
-@LiteflowCmpDefine
-public class ACmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) throws Exception{
-		Thread.sleep(5000L);
-		System.out.println("ACmp executed!");
-	}
-}

+ 0 - 25
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java

@@ -1,25 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.cmpStep.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("b")
-@LiteflowCmpDefine
-public class BCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("BCmp executed!");
-	}
-
-}

+ 0 - 27
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java

@@ -1,27 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.cmpStep.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("c")
-@LiteflowCmpDefine
-public class CCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) throws Exception{
-		System.out.println("CCmp executed!");
-		Thread.sleep(2000);
-		throw new RuntimeException("test error c");
-	}
-
-}

+ 0 - 26
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java

@@ -1,26 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.cmpStep.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("d")
-@LiteflowCmpDefine
-public class DCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("CCmp executed!");
-		throw new RuntimeException("test error d");
-	}
-
-}

+ 0 - 29
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java

@@ -1,29 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.cmpStep.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("e")
-@LiteflowCmpDefine
-public class ECmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("ECmp executed!");
-	}
-
-	@LiteflowMethod(LiteFlowMethodEnum.IS_ACCESS)
-	public boolean isAccess(NodeComponent bindCmp) {
-		return false;
-	}
-}

+ 0 - 94
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorSpringbootTest.java

@@ -1,94 +0,0 @@
-package com.yomahub.liteflow.test.component;
-
-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.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-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.util.ReflectionUtils;
-
-import javax.annotation.Resource;
-
-/**
- * 组件功能点测试
- * 单元测试
- *
- * @author donguo.tao
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/component/application.properties")
-@SpringBootTest(classes = FlowExecutorSpringbootTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.component.cmp1","com.yomahub.liteflow.test.component.cmp2"})
-public class FlowExecutorSpringbootTest extends BaseTest {
-    private static final Logger LOG = LoggerFactory.getLogger(FlowExecutorSpringbootTest.class);
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    //isAccess方法的功能测试
-    @Test
-    public void testIsAccess() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", 101);
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertNotNull(response.getSlot().getResponseData());
-    }
-
-    //组件抛错的功能点测试
-    @Test(expected = ArithmeticException.class)
-    public void testComponentException() throws Exception {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain2", 0);
-        Assert.assertFalse(response.isSuccess());
-        Assert.assertEquals("/ by zero", response.getMessage());
-        ReflectionUtils.rethrowException(response.getCause());
-    }
-
-    //isContinueOnError方法的功能点测试
-    @Test
-    public void testIsContinueOnError() throws Exception {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain3", 0);
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertNull(response.getCause());
-    }
-
-    //isEnd方法的功能点测试
-    @Test
-    public void testIsEnd() throws Exception {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain4", 10);
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("d",response.getExecuteStepStr());
-    }
-
-    //setIsEnd方法的功能点测试
-    @Test
-    public void testSetIsEnd1() throws Exception {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain5", 10);
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("e",response.getExecuteStepStr());
-    }
-
-    //条件组件的功能点测试
-    @Test
-    public void testNodeCondComponent() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain6", 0);
-        Assert.assertTrue(response.isSuccess());
-    }
-
-    //测试setIsEnd如果为true,continueError也为true,那不应该continue了
-    @Test
-    public void testSetIsEnd2() throws Exception {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain7", 10);
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("g",response.getExecuteStepStr());
-    }
-
-}

+ 0 - 30
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java

@@ -1,30 +0,0 @@
-package com.yomahub.liteflow.test.component.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-import java.util.Objects;
-
-
-@Component("a")
-@LiteflowCmpDefine
-public class ACmp{
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) {
-        System.out.println("AComp executed!");
-        bindCmp.getSlot().setResponseData("AComp executed!");
-    }
-
-    @LiteflowMethod(LiteFlowMethodEnum.IS_ACCESS)
-    public boolean isAccess(NodeComponent bindCmp) {
-        Integer requestData = bindCmp.getRequestData();
-        if (Objects.nonNull(requestData) && requestData > 100){
-            return true;
-        }
-        System.out.println("AComp isAccess false.");
-        return false;
-    }
-}

+ 0 - 33
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java

@@ -1,33 +0,0 @@
-package com.yomahub.liteflow.test.component.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-import java.util.Objects;
-
-
-@Component("b")
-@LiteflowCmpDefine
-public class BCmp{
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) {
-        System.out.println("BComp executed!");
-        Integer requestData = bindCmp.getRequestData();
-        Integer divisor = 130;
-        Integer result = divisor / requestData;
-        bindCmp.getSlot().setResponseData(result);
-    }
-
-    @LiteflowMethod(LiteFlowMethodEnum.IS_ACCESS)
-    public boolean isAccess(NodeComponent bindCmp) {
-        Integer requestData = bindCmp.getRequestData();
-        if (Objects.nonNull(requestData)){
-            return true;
-        }
-        return false;
-    }
-
-}

+ 0 - 33
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java

@@ -1,33 +0,0 @@
-package com.yomahub.liteflow.test.component.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-import java.util.Objects;
-
-
-@Component("c")
-@LiteflowCmpDefine
-public class CCmp{
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) {
-        System.out.println("CComp executed!");
-        Integer requestData = bindCmp.getRequestData();
-        Integer divisor = 130;
-        Integer result = divisor / requestData;
-        bindCmp.getSlot().setResponseData(result);
-        System.out.println("responseData="+Integer.parseInt(bindCmp.getSlot().getResponseData()));
-    }
-
-    @LiteflowMethod(LiteFlowMethodEnum.IS_CONTINUE_ON_ERROR)
-    public boolean isContinueOnError(NodeComponent bindCmp) {
-        Integer requestData = bindCmp.getRequestData();
-        if (Objects.nonNull(requestData)){
-            return true;
-        }
-        return false;
-    }
-}

+ 0 - 30
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java

@@ -1,30 +0,0 @@
-package com.yomahub.liteflow.test.component.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-import java.util.Objects;
-
-
-@Component("d")
-@LiteflowCmpDefine
-public class DCmp{
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) throws Exception {
-        System.out.println("DComp executed!");
-    }
-
-    @LiteflowMethod(LiteFlowMethodEnum.IS_END)
-    public boolean isEnd(NodeComponent bindCmp) {
-        //组件的process执行完之后才会执行isEnd
-        Object requestData = bindCmp.getSlot().getResponseData();
-        if (Objects.isNull(requestData)){
-            System.out.println("DComp flow isEnd, because of responseData is null.");
-            return true;
-        }
-        return false;
-    }
-}

+ 0 - 28
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java

@@ -1,28 +0,0 @@
-package com.yomahub.liteflow.test.component.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import com.yomahub.liteflow.util.JsonUtil;
-import org.springframework.stereotype.Component;
-
-import java.util.Objects;
-
-
-@Component("e")
-@LiteflowCmpDefine
-public class ECmp{
-
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-    public void process(NodeComponent bindCmp) throws Exception {
-        System.out.println("EComp executed!");
-        Object responseData = bindCmp.getSlot().getResponseData();
-        if (Objects.isNull(responseData)){
-            System.out.println("EComp responseData flow must be set end .");
-            //执行到某个条件时,手动结束流程。
-            bindCmp.setIsEnd(true);
-        }
-        System.out.println("EComp responseData responseData=" + JsonUtil.toJsonString(responseData));
-    }
-}

+ 0 - 30
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java

@@ -1,30 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.component.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("g")
-@LiteflowCmpDefine
-public class GCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("GCmp executed!");
-		bindCmp.setIsEnd(true);
-	}
-
-	@LiteflowMethod(LiteFlowMethodEnum.IS_CONTINUE_ON_ERROR)
-	public boolean isContinueOnError(NodeComponent bindCmp) {
-		return true;
-	}
-}

+ 0 - 24
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java

@@ -1,24 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.component.cmp1;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("h")
-@LiteflowCmpDefine
-public class HCmp{
-
-	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
-	public void process(NodeComponent bindCmp) {
-		System.out.println("HCmp executed!");
-	}
-}

+ 0 - 26
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp2/FCondCmp.java

@@ -1,26 +0,0 @@
-package com.yomahub.liteflow.test.component.cmp2;
-
-import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-import java.util.Objects;
-
-
-@Component("f")
-@LiteflowSwitchCmpDefine
-public class FCondCmp{
-    @LiteflowMethod(LiteFlowMethodEnum.PROCESS_SWITCH)
-    public String processSwitch(NodeComponent bindCmp) {
-        Integer requestData = bindCmp.getRequestData();
-        if (Objects.isNull(requestData)){
-            return "d";
-        } else if(requestData == 0){
-            return "c";
-        } else {
-            return "b";
-        }
-    }
-}

+ 0 - 38
liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/CustomMethodNameSpringbootTest.java

@@ -1,38 +0,0 @@
-package com.yomahub.liteflow.test.customMethodName;
-
-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.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-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 javax.annotation.Resource;
-
-/**
- * 声明式组件自定义方法的测试用例
- * @author Bryan.Zhang
- * @since 2.7.2
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/customMethodName/application.properties")
-@SpringBootTest(classes = CustomMethodNameSpringbootTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.customMethodName.cmp"})
-public class CustomMethodNameSpringbootTest extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    @Test
-    public void testCustomMethodName() throws Exception{
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
-        Assert.assertTrue(response.isSuccess());
-    }
-}

部分文件因为文件数量过多而无法显示