Răsfoiți Sursa

enhancement #I588BO 对Slot模型的重构,在用户使用中去除Slot模型的概念,引入上下文的概念

bryan31 3 ani în urmă
părinte
comite
eb20a5c43c
100 a modificat fișierele cu 657 adăugiri și 667 ștergeri
  1. 3 3
      liteflow-core/src/main/java/com/yomahub/liteflow/aop/ICmpAroundAspect.java
  2. 31 51
      liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java
  3. 7 2
      liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java
  4. 9 5
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/LiteflowResponse.java
  5. 0 214
      liteflow-core/src/main/java/com/yomahub/liteflow/slot/AbsSlot.java
  6. 12 6
      liteflow-core/src/main/java/com/yomahub/liteflow/slot/DataBus.java
  7. 36 0
      liteflow-core/src/main/java/com/yomahub/liteflow/slot/DefaultContext.java
  8. 0 17
      liteflow-core/src/main/java/com/yomahub/liteflow/slot/DefaultSlot.java
  9. 177 34
      liteflow-core/src/main/java/com/yomahub/liteflow/slot/Slot.java
  10. 2 2
      liteflow-core/src/main/java/com/yomahub/liteflow/spi/CmpAroundAspect.java
  11. 2 2
      liteflow-script-groovy/src/main/java/com/yomahub/liteflow/script/groovy/GroovyScriptExecutor.java
  12. 2 2
      liteflow-script-qlexpress/src/main/java/com/yomahub/liteflow/script/qlexpress/QLExpressScriptExecutor.java
  13. 4 4
      liteflow-spring/src/main/java/com/yomahub/liteflow/spi/spring/SpringCmpAroundAspect.java
  14. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringbootTest.java
  15. 8 8
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java
  16. 18 18
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java
  17. 6 5
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java
  18. 4 3
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java
  19. 15 15
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringbootTest.java
  20. 6 5
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java
  21. 6 5
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java
  22. 6 5
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java
  23. 6 5
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java
  24. 6 5
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java
  25. 6 5
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java
  26. 6 5
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java
  27. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/base/BaseSpringbootTest.java
  28. 4 4
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest1.java
  29. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest2.java
  30. 5 5
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringbootTest.java
  31. 8 8
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorSpringbootTest.java
  32. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesSpringbootTest.java
  33. 7 7
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolSpringbootTest.java
  34. 3 1
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java
  35. 3 1
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java
  36. 3 1
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java
  37. 3 1
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java
  38. 3 1
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java
  39. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/exception/ExceptionSpringBootTest.java
  40. 3 3
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureSpringbootTest.java
  41. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaSpringbootTest.java
  42. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/lazy/LazySpringbootTest.java
  43. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/liteflowcomponent/LiteflowComponentSpringbootTest.java
  44. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/monitor/MonitorSpringbootTest.java
  45. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeSpringbootTest.java
  46. 3 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java
  47. 3 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java
  48. 5 4
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java
  49. 8 8
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorSpringbootTest.java
  50. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringbootTest.java
  51. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlSpringbootTest.java
  52. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/parser/JsonParserSpringbootTest.java
  53. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/parser/SpringELSupportSpringbootTest.java
  54. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/parser/XmlParserSpringbootTest.java
  55. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/parser/YmlParserSpringbootTest.java
  56. 6 6
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallySpringbootTest.java
  57. 5 3
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java
  58. 3 3
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliverySpringbootTest.java
  59. 3 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java
  60. 3 1
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java
  61. 3 3
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleSpringbootTest.java
  62. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/reload/ReloadSpringbootTest.java
  63. 4 4
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotSpringbootTest.java
  64. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowSpringbootTest.java
  65. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigSpringbootTest.java
  66. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonSpringBootTest.java
  67. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLSpringBootTest.java
  68. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlSpringBootTest.java
  69. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java
  70. 7 7
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootJsonTest.java
  71. 7 7
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootXmlTest.java
  72. 6 5
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java
  73. 3 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java
  74. 3 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java
  75. 7 7
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenSpringbootTest.java
  76. 3 1
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java
  77. 3 1
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java
  78. 3 1
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java
  79. 3 1
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java
  80. 3 1
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java
  81. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest1.java
  82. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest2.java
  83. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonSpringbootTest.java
  84. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlSpringbootTest.java
  85. 2 2
      liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlSpringbootTest.java
  86. 2 2
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathTest.java
  87. 15 15
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeTest.java
  88. 6 5
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java
  89. 6 5
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java
  90. 6 5
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java
  91. 6 5
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java
  92. 6 5
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java
  93. 6 5
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java
  94. 6 5
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java
  95. 2 2
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/BaseCommonTest.java
  96. 4 4
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/BuilderTest.java
  97. 5 5
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetryTest.java
  98. 8 8
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorTest.java
  99. 2 2
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigTest1.java
  100. 7 7
      liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolTest.java

+ 3 - 3
liteflow-core/src/main/java/com/yomahub/liteflow/aop/ICmpAroundAspect.java

@@ -14,9 +14,9 @@ import com.yomahub.liteflow.slot.Slot;
  * 实现这个接口并注入到spring上下文即可
  * @author Bryan.Zhang
  */
-public interface ICmpAroundAspect {
+public interface ICmpAroundAspect<T> {
 
-    void beforeProcess(String nodeId, Slot slot);
+    void beforeProcess(String nodeId, T contextBean);
 
-    void afterProcess(String nodeId, Slot slot);
+    void afterProcess(String nodeId, T contextBean);
 }

+ 31 - 51
liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java

@@ -14,8 +14,8 @@ import cn.hutool.core.util.ReUtil;
 import cn.hutool.core.util.StrUtil;
 import com.google.common.collect.Lists;
 import com.yomahub.liteflow.slot.DataBus;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 import com.yomahub.liteflow.flow.element.Chain;
 import com.yomahub.liteflow.flow.element.Node;
@@ -30,10 +30,7 @@ import com.yomahub.liteflow.thread.ExecutorHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 import java.util.concurrent.*;
 
 /**
@@ -169,10 +166,6 @@ public class FlowExecutor {
 
     /**
      * 匹配路径配置,生成对应的解析器
-     *
-     * @param path    配置路径
-     * @param pattern 格式
-     * @return
      */
     private FlowParser matchFormatParser(String path, FlowParserTypeEnum pattern) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
         boolean isLocalFile = isLocalConfig(path);
@@ -217,9 +210,6 @@ public class FlowExecutor {
 
     /**
      * 判定是否为本地文件
-     *
-     * @param path
-     * @return
      */
     private boolean isLocalConfig(String path) {
         return ReUtil.isMatch(LOCAL_XML_CONFIG_REGEX, path)
@@ -229,9 +219,6 @@ public class FlowExecutor {
 
     /**
      * 判定是否为自定义class配置
-     *
-     * @param path
-     * @return
      */
     private boolean isClassConfig(String path) {
         return ReUtil.isMatch(CLASS_CONFIG_REGEX, path);
@@ -239,9 +226,6 @@ public class FlowExecutor {
 
     /**
      * 判定是否为zk配置
-     *
-     * @param path
-     * @return
      */
     private boolean isZKConfig(String path) {
         return ReUtil.isMatch(ZK_CONFIG_REGEX, path);
@@ -249,9 +233,6 @@ public class FlowExecutor {
 
     /**
      * 匹配文本格式,支持xml,json和yml
-     *
-     * @param path
-     * @return
      */
     private FlowParserTypeEnum matchFormatConfig(String path) {
         if (ReUtil.isMatch(LOCAL_XML_CONFIG_REGEX, path) || ReUtil.isMatch(FORMATE_XML_CONFIG_REGEX, path)) {
@@ -262,7 +243,7 @@ public class FlowExecutor {
             return FlowParserTypeEnum.TYPE_YML;
         } else if (isClassConfig(path)) {
             try {
-                Class clazz = Class.forName(path);
+                Class<?> clazz = Class.forName(path);
                 if (ClassXmlFlowParser.class.isAssignableFrom(clazz)) {
                     return FlowParserTypeEnum.TYPE_XML;
                 } else if (ClassJsonFlowParser.class.isAssignableFrom(clazz)) {
@@ -284,36 +265,35 @@ public class FlowExecutor {
     }
 
     //隐式流程的调用方法
-    public <T extends Slot> void invoke(String chainId, Object param, Class<T> slotClazz,
-                                        Integer slotIndex) throws Exception {
-        this.execute(chainId, param, slotClazz, slotIndex, true);
+    public void invoke(String chainId, Object param, Integer slotIndex) throws Exception {
+        this.execute(chainId, param, null, slotIndex, true);
     }
 
-    public <T extends Slot> LiteflowResponse<T> invoke2Resp(String chainId, Object param, Class<T> slotClazz,
-                       Integer slotIndex){
-        return this.execute2Resp(chainId, param, slotClazz, slotIndex, true);
+    public <T> LiteflowResponse<T> invoke2Resp(String chainId, Object param, Integer slotIndex){
+        return this.execute2Resp(chainId, param, null, slotIndex, true);
     }
 
-    public <T extends Slot> void invoke(String nodeId, Integer slotIndex) throws Exception {
+    //单独调用某一个node
+    public void invoke(String nodeId, Integer slotIndex) throws Exception {
         Node node = FlowBus.getNode(nodeId);
         node.execute(slotIndex);
     }
 
-    public DefaultSlot execute(String chainId) throws Exception {
-        return this.execute(chainId, null, DefaultSlot.class, null, false);
+    public Slot<DefaultContext> execute(String chainId) throws Exception {
+        return this.execute(chainId, null, DefaultContext.class, null, false);
     }
 
-    public DefaultSlot execute(String chainId, Object param) throws Exception {
-        return this.execute(chainId, param, DefaultSlot.class, null, false);
+    public Slot<DefaultContext> execute(String chainId, Object param) throws Exception {
+        return this.execute(chainId, param, DefaultContext.class, null, false);
     }
 
-    public <T extends Slot> T execute(String chainId, Object param, Class<T> slotClazz) throws Exception {
-        return this.execute(chainId, param, slotClazz, null, false);
+    public <T> Slot<T> execute(String chainId, Object param, Class<T> contextBeanClazz) throws Exception {
+        return this.execute(chainId, param, contextBeanClazz, null, false);
     }
 
-    public <T extends Slot> T execute(String chainId, Object param, Class<T> slotClazz,
+    public <T> Slot<T> execute(String chainId, Object param, Class<T> contextBeanClazz,
                                       Integer slotIndex, boolean isInnerChain) throws Exception {
-        T slot = this.doExecute(chainId, param, slotClazz, slotIndex, isInnerChain);
+        Slot<T> slot = this.doExecute(chainId, param, contextBeanClazz, slotIndex, isInnerChain);
         if (ObjectUtil.isNotNull(slot.getException())) {
             throw slot.getException();
         } else {
@@ -321,29 +301,29 @@ public class FlowExecutor {
         }
     }
 
-    public LiteflowResponse<DefaultSlot> execute2Resp(String chainId) {
-        return this.execute2Resp(chainId, null, DefaultSlot.class);
+    public LiteflowResponse<DefaultContext> execute2Resp(String chainId) {
+        return this.execute2Resp(chainId, null, DefaultContext.class);
     }
 
-    public LiteflowResponse<DefaultSlot> execute2Resp(String chainId, Object param) {
-        return this.execute2Resp(chainId, param, DefaultSlot.class);
+    public LiteflowResponse<DefaultContext> execute2Resp(String chainId, Object param) {
+        return this.execute2Resp(chainId, param, DefaultContext.class);
     }
 
-    public <T extends Slot> LiteflowResponse<T> execute2Resp(String chainId, Object param, Class<T> slotClazz) {
-        return this.execute2Resp(chainId, param, slotClazz, null, false);
+    public <T> LiteflowResponse<T> execute2Resp(String chainId, Object param, Class<T> contextBeanClazz) {
+        return this.execute2Resp(chainId, param, contextBeanClazz, null, false);
     }
 
-    public <T extends Slot> Future<LiteflowResponse<T>> execute2Future(String chainId, Object param, Class<T> slotClazz) {
+    public <T> Future<LiteflowResponse<T>> execute2Future(String chainId, Object param, Class<T> contextBeanClazz) {
         return ExecutorHelper.loadInstance().buildMainExecutor(liteflowConfig.getMainExecutorClass()).submit(()
-                -> FlowExecutorHolder.loadInstance().execute2Resp(chainId, param, slotClazz, null, false));
+                -> FlowExecutorHolder.loadInstance().execute2Resp(chainId, param, contextBeanClazz, null, false));
 
     }
 
-    public <T extends Slot> LiteflowResponse<T> execute2Resp(String chainId, Object param, Class<T> slotClazz, Integer slotIndex,
-                                                             boolean isInnerChain) {
+    public <T> LiteflowResponse<T> execute2Resp(String chainId, Object param, Class<T> contextBeanClazz,
+                                                Integer slotIndex, boolean isInnerChain) {
         LiteflowResponse<T> response = new LiteflowResponse<>();
 
-        T slot = doExecute(chainId, param, slotClazz, slotIndex, isInnerChain);
+        Slot<T> slot = doExecute(chainId, param, contextBeanClazz, slotIndex, isInnerChain);
 
         if (ObjectUtil.isNotNull(slot.getException())) {
             response.setSuccess(false);
@@ -356,14 +336,14 @@ public class FlowExecutor {
         return response;
     }
 
-    private <T extends Slot> T doExecute(String chainId, Object param, Class<T> slotClazz, Integer slotIndex,
+    private <T> Slot<T> doExecute(String chainId, Object param, Class<T> contextBeanClazz, Integer slotIndex,
                                          boolean isInnerChain) {
         if (FlowBus.needInit()) {
             init();
         }
 
         if (!isInnerChain && ObjectUtil.isNull(slotIndex)) {
-            slotIndex = DataBus.offerSlot(slotClazz);
+            slotIndex = DataBus.offerSlot(contextBeanClazz);
             LOG.info("slot[{}] offered", slotIndex);
         }
 
@@ -371,7 +351,7 @@ public class FlowExecutor {
             throw new NoAvailableSlotException("there is no available slot");
         }
 
-        T slot = DataBus.getSlot(slotIndex);
+        Slot<T> slot = DataBus.getSlot(slotIndex);
         if (ObjectUtil.isNull(slot)) {
             throw new NoAvailableSlotException(StrUtil.format("the slot[{}] is not exist", slotIndex));
         }

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

@@ -71,7 +71,7 @@ public abstract class NodeComponent{
 	}
 
 	public void execute() throws Exception{
-		Slot slot = this.getSlot();
+		Slot<?> slot = this.getSlot();
 		LOG.info("[{}]:[O]start component[{}] execution",slot.getRequestId(),this.getClass().getSimpleName());
 		slot.addStep(new CmpStep(nodeId, name, CmpStepTypeEnum.SINGLE));
 
@@ -153,10 +153,15 @@ public abstract class NodeComponent{
 		this.slotIndexTL.remove();
 	}
 
-	public <T extends Slot> T getSlot(){
+	public <T> Slot<T> getSlot(){
 		return DataBus.getSlot(this.slotIndexTL.get());
 	}
 
+	public <T> T getContextBean(){
+		Slot<T> slot = this.getSlot();
+		return slot.getContextBean();
+	}
+
 	public String getNodeId() {
 		return nodeId;
 	}

+ 9 - 5
liteflow-core/src/main/java/com/yomahub/liteflow/flow/LiteflowResponse.java

@@ -8,7 +8,7 @@ import java.io.Serializable;
  * 执行结果封装类
  * @author zend.wang
  */
-public class LiteflowResponse<T extends Slot> implements Serializable {
+public class LiteflowResponse<T> implements Serializable {
     
     private static final long serialVersionUID = -2792556188993845048L;
     
@@ -18,12 +18,12 @@ public class LiteflowResponse<T extends Slot> implements Serializable {
     
     private Throwable cause;
     
-    private T slot;
+    private Slot<T> slot;
     
     public LiteflowResponse() {
       this(null);
     }
-    public LiteflowResponse(T slot) {
+    public LiteflowResponse(Slot<T> slot) {
         this.success = true;
         this.message = "";
         this.slot = slot;
@@ -53,11 +53,15 @@ public class LiteflowResponse<T extends Slot> implements Serializable {
         this.cause = cause;
     }
     
-    public T getSlot() {
+    public Slot<T> getSlot() {
         return slot;
     }
     
-    public void setSlot(final T slot) {
+    public void setSlot(Slot<T> slot) {
         this.slot = slot;
     }
+
+    public T getContextBean(){
+        return getSlot().getContextBean();
+    }
 }

+ 0 - 214
liteflow-core/src/main/java/com/yomahub/liteflow/slot/AbsSlot.java

@@ -1,214 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.slot;
-
-import cn.hutool.core.util.IdUtil;
-import cn.hutool.core.util.ObjectUtil;
-import com.yomahub.liteflow.exception.NullParamException;
-import com.yomahub.liteflow.flow.entity.CmpStep;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.util.Iterator;
-import java.util.Queue;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-/**
- * Slot的抽象类实现
- * @author Bryan.Zhang
- * @author LeoLee
- */
-@SuppressWarnings("unchecked")
-public abstract class AbsSlot implements Slot {
-
-	private static final Logger LOG = LoggerFactory.getLogger(Slot.class);
-
-	private static final String REQUEST = "_request";
-
-	private static final String RESPONSE = "_response";
-
-	private static final String CHAIN_NAME = "_chain_name";
-
-	private static final String COND_NODE_PREFIX = "_cond_";
-
-	private static final String NODE_INPUT_PREFIX = "_input_";
-
-	private static final String NODE_OUTPUT_PREFIX = "_output_";
-
-	private static final String CHAIN_REQ_PREFIX = "_chain_req_";
-
-	private static final String REQUEST_ID = "_req_id";
-
-	private static final String EXCEPTION = "_exception";
-
-	private static final String PRIVATE_DELIVERY_PREFIX = "_private_d_";
-
-	private final Queue<CmpStep> executeSteps = new ConcurrentLinkedQueue<>();
-
-	private String executeStepsStr;
-
-	protected ConcurrentHashMap<String, Object> dataMap = new ConcurrentHashMap<String, Object>();
-
-	private <T> void putDataMap(String key, T t) {
-		if (ObjectUtil.isNull(t)) {
-			//data slot is a ConcurrentHashMap, so null value will trigger NullPointerException
-			throw new NullParamException("data slot can't accept null param");
-		}
-		dataMap.put(key, t);
-	}
-
-	public <T> T getInput(String nodeId){
-		return (T)dataMap.get(NODE_INPUT_PREFIX + nodeId);
-	}
-
-	public <T> T getOutput(String nodeId){
-		return (T)dataMap.get(NODE_OUTPUT_PREFIX + nodeId);
-	}
-
-	public <T> void setInput(String nodeId,T t){
-		putDataMap(NODE_INPUT_PREFIX + nodeId, t);
-	}
-
-	public <T> void setOutput(String nodeId,T t){
-		putDataMap(NODE_OUTPUT_PREFIX + nodeId, t);
-	}
-
-	public <T> T getRequestData(){
-		return (T)dataMap.get(REQUEST);
-	}
-
-	public <T> void setRequestData(T t){
-		putDataMap(REQUEST, t);
-	}
-
-	public <T> T getResponseData(){
-		return (T)dataMap.get(RESPONSE);
-	}
-
-	public <T> void setResponseData(T t){
-		putDataMap(RESPONSE, t);
-	}
-
-	public <T> T getChainReqData(String chainId) {
-		return (T)dataMap.get(CHAIN_REQ_PREFIX + chainId);
-	}
-
-	public <T> void setChainReqData(String chainId, T t) {
-		putDataMap(CHAIN_REQ_PREFIX + chainId, t);
-	}
-
-	public boolean hasData(String key){
-		return dataMap.containsKey(key);
-	}
-
-	public <T> T getData(String key){
-		return (T)dataMap.get(key);
-	}
-
-	public <T> void setData(String key, T t){
-		putDataMap(key, t);
-	}
-
-	public <T> void setPrivateDeliveryData(String nodeId, T t){
-		String privateDKey = PRIVATE_DELIVERY_PREFIX + nodeId;
-		synchronized (this){
-			if (dataMap.containsKey(privateDKey)){
-				Queue<T> queue = (Queue<T>) dataMap.get(privateDKey);
-				queue.add(t);
-			}else{
-				Queue<T> queue = new ConcurrentLinkedQueue<>();
-				queue.add(t);
-				this.setData(privateDKey, queue);
-			}
-		}
-	}
-
-	public <T> Queue<T> getPrivateDeliveryQueue(String nodeId){
-		String privateDKey = PRIVATE_DELIVERY_PREFIX + nodeId;
-		if(dataMap.containsKey(privateDKey)){
-			return (Queue<T>) dataMap.get(privateDKey);
-		}else{
-			return null;
-		}
-	}
-
-	public <T> T getPrivateDeliveryData(String nodeId){
-		String privateDKey = PRIVATE_DELIVERY_PREFIX + nodeId;
-		if(dataMap.containsKey(privateDKey)){
-			Queue<T> queue = (Queue<T>) dataMap.get(privateDKey);
-			return queue.poll();
-		}else{
-			return null;
-		}
-	}
-
-	public <T> void setCondResult(String key, T t){
-		putDataMap(COND_NODE_PREFIX + key, t);
-	}
-
-	public <T> T getCondResult(String key){
-		return (T)dataMap.get(COND_NODE_PREFIX + key);
-	}
-
-	public void setChainName(String chainName) {
-		putDataMap(CHAIN_NAME, chainName);
-	}
-
-	public String getChainName() {
-		return (String)dataMap.get(CHAIN_NAME);
-	}
-
-	public void addStep(CmpStep step){
-		this.executeSteps.add(step);
-	}
-
-	public String getExecuteStepStr(){
-		StringBuilder str = new StringBuilder();
-		CmpStep cmpStep;
-		for (Iterator<CmpStep> it = executeSteps.iterator(); it.hasNext();) {
-			cmpStep = it.next();
-			str.append(cmpStep);
-			if(it.hasNext()){
-				str.append("==>");
-			}
-		}
-		this.executeStepsStr = str.toString();
-		return this.executeStepsStr;
-	}
-
-	public void printStep(){
-		if (ObjectUtil.isNull(this.executeStepsStr)){
-			this.executeStepsStr = getExecuteStepStr();
-		}
-		LOG.info("[{}]:CHAIN_NAME[{}]\n{}",getRequestId(),this.getChainName(), this.executeStepsStr);
-	}
-
-	@Override
-	public void generateRequestId() {
-		dataMap.put(REQUEST_ID, IdUtil.fastSimpleUUID());
-	}
-
-	@Override
-	public String getRequestId() {
-		return (String)dataMap.get(REQUEST_ID);
-	}
-
-	public Queue<CmpStep> getExecuteSteps() {
-		return executeSteps;
-	}
-
-	@Override
-	public Exception getException() {
-		return (Exception) this.dataMap.get(EXCEPTION);
-	}
-
-	@Override
-	public void setException(Exception e) {
-		putDataMap(EXCEPTION, e);
-	}
-}

+ 12 - 6
liteflow-core/src/main/java/com/yomahub/liteflow/slot/DataBus.java

@@ -9,6 +9,7 @@ package com.yomahub.liteflow.slot;
 
 import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.ReflectUtil;
 import com.yomahub.liteflow.property.LiteflowConfig;
 import com.yomahub.liteflow.property.LiteflowConfigGetter;
 import org.slf4j.Logger;
@@ -33,7 +34,7 @@ public class DataBus {
 	//这里为什么采用ConcurrentHashMap作为slot存放的容器?
 	//因为ConcurrentHashMap的随机取值复杂度也和数组一样为O(1),并且没有并发问题,还有自动扩容的功能
 	//用数组的话,扩容涉及copy,线程安全问题还要自己处理
-	private static ConcurrentHashMap<Integer, Slot> SLOTS;
+	private static ConcurrentHashMap<Integer, Slot<?>> SLOTS;
 
 	private static ConcurrentLinkedQueue<Integer> QUEUE;
 
@@ -54,9 +55,10 @@ public class DataBus {
 		}
 	}
 
-	public static int offerSlot(Class<? extends Slot> slotClazz) {
+	public static <T> int offerSlot(Class<T> contextClazz) {
 		try {
-			Slot slot = slotClazz.newInstance();
+			T contextBean = ReflectUtil.newInstance(contextClazz);
+			Slot<T> slot = new Slot<>(contextBean);
 
 			//这里有没有并发问题?
 			//没有,因为QUEUE的类型为ConcurrentLinkedQueue,并发情况下,每次取到的index不会相同
@@ -92,9 +94,13 @@ public class DataBus {
 		return -1;
 	}
 
-	@SuppressWarnings("unchecked")
-	public static <T extends Slot> T getSlot(int slotIndex){
-		return (T)SLOTS.get(slotIndex);
+	public static <T> Slot<T> getSlot(int slotIndex){
+		return (Slot<T>) SLOTS.get(slotIndex);
+	}
+
+	public static <T> T getContextBean(int slotIndex){
+		Slot<T> slot = getSlot(slotIndex);
+		return slot.getContextBean();
 	}
 
 	public static void releaseSlot(int slotIndex){

+ 36 - 0
liteflow-core/src/main/java/com/yomahub/liteflow/slot/DefaultContext.java

@@ -0,0 +1,36 @@
+package com.yomahub.liteflow.slot;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.exception.NullParamException;
+
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * Liteflow的默认上下文Bean
+ * 这个建议自己去实现一个强类型的bean,正式业务不建议用这个
+ * @author Bryan.Zhang
+ * @since 2.7.0
+ */
+public class DefaultContext {
+
+    private final ConcurrentHashMap<String, Object> dataMap = new ConcurrentHashMap<>();
+
+    private <T> void putDataMap(String key, T t) {
+        if (ObjectUtil.isNull(t)) {
+            throw new NullParamException("data can't accept null param");
+        }
+        dataMap.put(key, t);
+    }
+
+    public boolean hasData(String key){
+        return dataMap.containsKey(key);
+    }
+
+    public <T> T getData(String key){
+        return (T) dataMap.get(key);
+    }
+
+    public <T> void setData(String key, T t){
+        putDataMap(key, t);
+    }
+}

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

@@ -1,17 +0,0 @@
-/**
- * <p>Title: liteflow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.slot;
-
-/**
- * 默认Slot的实现类
- * 不建议业务系统直接用此类,此类基于弱类型Map,应该自己去继承AbsSlot
- * @author Bryan.Zhang
- */
-public class DefaultSlot extends AbsSlot {
-
-}

+ 177 - 34
liteflow-core/src/main/java/com/yomahub/liteflow/slot/Slot.java

@@ -7,62 +7,205 @@
  */
 package com.yomahub.liteflow.slot;
 
+import cn.hutool.core.util.IdUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.yomahub.liteflow.exception.NullParamException;
 import com.yomahub.liteflow.flow.entity.CmpStep;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.util.Iterator;
+import java.util.Queue;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
 
 /**
- * Slot的接口
+ * Slot的抽象类实现
  * @author Bryan.Zhang
+ * @author LeoLee
  */
-public interface Slot {
-	<T> T getInput(String nodeId);
+@SuppressWarnings("unchecked")
+public class Slot<O>{
 
-	<T> T getOutput(String nodeId);
+	private static final Logger LOG = LoggerFactory.getLogger(Slot.class);
 
-	<T> void setInput(String nodeId,T t);
+	private static final String REQUEST = "_request";
 
-	<T> void setOutput(String nodeId,T t);
+	private static final String RESPONSE = "_response";
 
-	<T> T getRequestData();
+	private static final String CHAIN_NAME = "_chain_name";
 
-	<T> void setRequestData(T t);
+	private static final String COND_NODE_PREFIX = "_cond_";
 
-	<T> T getResponseData();
+	private static final String NODE_INPUT_PREFIX = "_input_";
 
-	<T> void setChainReqData(String chainId, T t);
+	private static final String NODE_OUTPUT_PREFIX = "_output_";
 
-	<T> T getChainReqData(String chainId);
+	private static final String CHAIN_REQ_PREFIX = "_chain_req_";
 
-	<T> void setResponseData(T t);
+	private static final String REQUEST_ID = "_req_id";
 
-	boolean hasData(String key);
+	private static final String EXCEPTION = "_exception";
 
-	<T> T getData(String key);
+	private static final String PRIVATE_DELIVERY_PREFIX = "_private_d_";
 
-	<T> void setData(String key, T t);
+	private final Queue<CmpStep> executeSteps = new ConcurrentLinkedQueue<>();
 
-	<T> void setCondResult(String key, T t);
+	private String executeStepsStr;
 
-	<T> T getCondResult(String key);
+	protected ConcurrentHashMap<String, Object> metaDataMap = new ConcurrentHashMap<>();
 
-	void addStep(CmpStep step);
+	private O contextBean;
 
-	String getExecuteStepStr();
+	public Slot() {
+	}
 
-	void printStep();
+	public Slot(O contextBean) {
+		this.contextBean = contextBean;
+	}
 
-	void generateRequestId();
+	private <T> void putMetaDataMap(String key, T t) {
+		if (ObjectUtil.isNull(t)) {
+			//data slot is a ConcurrentHashMap, so null value will trigger NullPointerException
+			throw new NullParamException("data slot can't accept null param");
+		}
+		metaDataMap.put(key, t);
+	}
 
-	String getRequestId();
-
-	void setChainName(String chainName);
-
-	String getChainName();
-
-	void setException(Exception e);
-
-	Exception getException();
-
-	<T> void setPrivateDeliveryData(String nodeId, T t);
-
-	<T> T getPrivateDeliveryData(String nodeId);
+	public <T> T getInput(String nodeId){
+		return (T) metaDataMap.get(NODE_INPUT_PREFIX + nodeId);
+	}
+
+	public <T> T getOutput(String nodeId){
+		return (T) metaDataMap.get(NODE_OUTPUT_PREFIX + nodeId);
+	}
+
+	public <T> void setInput(String nodeId,T t){
+		putMetaDataMap(NODE_INPUT_PREFIX + nodeId, t);
+	}
+
+	public <T> void setOutput(String nodeId,T t){
+		putMetaDataMap(NODE_OUTPUT_PREFIX + nodeId, t);
+	}
+
+	public <T> T getRequestData(){
+		return (T) metaDataMap.get(REQUEST);
+	}
+
+	public <T> void setRequestData(T t){
+		putMetaDataMap(REQUEST, t);
+	}
+
+	public <T> T getResponseData(){
+		return (T) metaDataMap.get(RESPONSE);
+	}
+
+	public <T> void setResponseData(T t){
+		putMetaDataMap(RESPONSE, t);
+	}
+
+	public <T> T getChainReqData(String chainId) {
+		return (T) metaDataMap.get(CHAIN_REQ_PREFIX + chainId);
+	}
+
+	public <T> void setChainReqData(String chainId, T t) {
+		putMetaDataMap(CHAIN_REQ_PREFIX + chainId, t);
+	}
+
+	public <T> void setPrivateDeliveryData(String nodeId, T t){
+		String privateDKey = PRIVATE_DELIVERY_PREFIX + nodeId;
+		synchronized (this){
+			if (metaDataMap.containsKey(privateDKey)){
+				Queue<T> queue = (Queue<T>) metaDataMap.get(privateDKey);
+				queue.add(t);
+			}else{
+				Queue<T> queue = new ConcurrentLinkedQueue<>();
+				queue.add(t);
+				this.putMetaDataMap(privateDKey, queue);
+			}
+		}
+	}
+
+	public <T> Queue<T> getPrivateDeliveryQueue(String nodeId){
+		String privateDKey = PRIVATE_DELIVERY_PREFIX + nodeId;
+		if(metaDataMap.containsKey(privateDKey)){
+			return (Queue<T>) metaDataMap.get(privateDKey);
+		}else{
+			return null;
+		}
+	}
+
+	public <T> T getPrivateDeliveryData(String nodeId){
+		String privateDKey = PRIVATE_DELIVERY_PREFIX + nodeId;
+		if(metaDataMap.containsKey(privateDKey)){
+			Queue<T> queue = (Queue<T>) metaDataMap.get(privateDKey);
+			return queue.poll();
+		}else{
+			return null;
+		}
+	}
+
+	public <T> void setCondResult(String key, T t){
+		putMetaDataMap(COND_NODE_PREFIX + key, t);
+	}
+
+	public <T> T getCondResult(String key){
+		return (T) metaDataMap.get(COND_NODE_PREFIX + key);
+	}
+
+	public void setChainName(String chainName) {
+		putMetaDataMap(CHAIN_NAME, chainName);
+	}
+
+	public String getChainName() {
+		return (String) metaDataMap.get(CHAIN_NAME);
+	}
+
+	public void addStep(CmpStep step){
+		this.executeSteps.add(step);
+	}
+
+	public String getExecuteStepStr(){
+		StringBuilder str = new StringBuilder();
+		CmpStep cmpStep;
+		for (Iterator<CmpStep> it = executeSteps.iterator(); it.hasNext();) {
+			cmpStep = it.next();
+			str.append(cmpStep);
+			if(it.hasNext()){
+				str.append("==>");
+			}
+		}
+		this.executeStepsStr = str.toString();
+		return this.executeStepsStr;
+	}
+
+	public void printStep(){
+		if (ObjectUtil.isNull(this.executeStepsStr)){
+			this.executeStepsStr = getExecuteStepStr();
+		}
+		LOG.info("[{}]:CHAIN_NAME[{}]\n{}",getRequestId(),this.getChainName(), this.executeStepsStr);
+	}
+
+	public void generateRequestId() {
+		metaDataMap.put(REQUEST_ID, IdUtil.fastSimpleUUID());
+	}
+
+	public String getRequestId() {
+		return (String) metaDataMap.get(REQUEST_ID);
+	}
+
+	public Queue<CmpStep> getExecuteSteps() {
+		return executeSteps;
+	}
+
+	public Exception getException() {
+		return (Exception) this.metaDataMap.get(EXCEPTION);
+	}
+
+	public void setException(Exception e) {
+		putMetaDataMap(EXCEPTION, e);
+	}
+
+	public O getContextBean() {
+		return contextBean;
+	}
 }

+ 2 - 2
liteflow-core/src/main/java/com/yomahub/liteflow/spi/CmpAroundAspect.java

@@ -9,7 +9,7 @@ import com.yomahub.liteflow.slot.Slot;
  */
 public interface CmpAroundAspect extends SpiPriority {
 
-    void beforeProcess(String nodeId, Slot slot);
+    void beforeProcess(String nodeId, Slot<?> slot);
 
-    void afterProcess(String nodeId, Slot slot);
+    void afterProcess(String nodeId, Slot<?> slot);
 }

+ 2 - 2
liteflow-script-groovy/src/main/java/com/yomahub/liteflow/script/groovy/GroovyScriptExecutor.java

@@ -55,8 +55,8 @@ public class GroovyScriptExecutor implements ScriptExecutor {
 
             CompiledScript compiledScript = compiledScriptMap.get(nodeId);
             Bindings bindings = new SimpleBindings();
-            Slot slot = DataBus.getSlot(slotIndex);
-            bindings.put("slot", slot);
+            Object contextBean = DataBus.getContextBean(slotIndex);
+            bindings.put("context", contextBean);
             return compiledScript.eval(bindings);
         }catch (Exception e){
             log.error(e.getMessage(), e);

+ 2 - 2
liteflow-script-qlexpress/src/main/java/com/yomahub/liteflow/script/qlexpress/QLExpressScriptExecutor.java

@@ -59,9 +59,9 @@ public class QLExpressScriptExecutor implements ScriptExecutor {
             }
 
             InstructionSet instructionSet = compiledScriptMap.get(nodeId);
-            Slot slot = DataBus.getSlot(slotIndex);
+            Object contextBean = DataBus.getContextBean(slotIndex);
             DefaultContext<String, Object> context = new DefaultContext<>();
-            context.put("slot", slot);
+            context.put("context", contextBean);
             return expressRunner.execute(instructionSet, context, errorList, true, false, null);
         }catch (Exception e){
             for (String scriptErrorMsg : errorList){

+ 4 - 4
liteflow-spring/src/main/java/com/yomahub/liteflow/spi/spring/SpringCmpAroundAspect.java

@@ -12,16 +12,16 @@ import com.yomahub.liteflow.spring.ComponentScanner;
  */
 public class SpringCmpAroundAspect implements CmpAroundAspect {
     @Override
-    public void beforeProcess(String nodeId, Slot slot) {
+    public void beforeProcess(String nodeId, Slot<?> slot) {
         if (ObjectUtil.isNotNull(ComponentScanner.cmpAroundAspect)) {
-            ComponentScanner.cmpAroundAspect.beforeProcess(nodeId, slot);
+            ComponentScanner.cmpAroundAspect.beforeProcess(nodeId, slot.getContextBean());
         }
     }
 
     @Override
-    public void afterProcess(String nodeId, Slot slot) {
+    public void afterProcess(String nodeId, Slot<?> slot) {
         if (ObjectUtil.isNotNull(ComponentScanner.cmpAroundAspect)) {
-            ComponentScanner.cmpAroundAspect.afterProcess(nodeId, slot);
+            ComponentScanner.cmpAroundAspect.afterProcess(nodeId, slot.getContextBean());
         }
     }
 

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.absoluteConfigPath;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -36,7 +36,7 @@ public class AbsoluteConfigPathSpringbootTest extends BaseTest {
 
     @Test
     public void testAbsoluteConfig() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
     }
 }

+ 8 - 8
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java

@@ -22,20 +22,20 @@ public class CustomAOPSpringbootTest extends BaseTest {
     //测试自定义AOP,串行场景
     @Test
     public void testCustomAopS() {
-        LiteflowResponse<DefaultSlot> response= flowExecutor.execute2Resp("chain1", "it's a request");
+        LiteflowResponse<DefaultContext> response= flowExecutor.execute2Resp("chain1", "it's a request");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("before_after", response.getSlot().getData("a"));
-        Assert.assertEquals("before_after", response.getSlot().getData("b"));
-        Assert.assertEquals("before_after", response.getSlot().getData("c"));
+        Assert.assertEquals("before_after", response.getContextBean.getData("a"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("b"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("c"));
     }
 
     //测试自定义AOP,并行场景
     @Test
     public void testCustomAopP() {
-        LiteflowResponse<DefaultSlot> response= flowExecutor.execute2Resp("chain2", "it's a request");
+        LiteflowResponse<DefaultContext> response= flowExecutor.execute2Resp("chain2", "it's a request");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("before_after", response.getSlot().getData("a"));
-        Assert.assertEquals("before_after", response.getSlot().getData("b"));
-        Assert.assertEquals("before_after", response.getSlot().getData("c"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("a"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("b"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("c"));
     }*/
 }

+ 18 - 18
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.aop;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -37,35 +37,35 @@ public class GlobalAOPSpringbootTest extends BaseTest {
     //测试全局AOP,串行场景
     @Test
     public void testGlobalAopS() {
-        LiteflowResponse<DefaultSlot> response= flowExecutor.execute2Resp("chain1", "it's a request");
+        LiteflowResponse<DefaultContext> response= flowExecutor.execute2Resp("chain1", "it's a request");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("before_after", response.getSlot().getData("a"));
-        Assert.assertEquals("before_after", response.getSlot().getData("b"));
-        Assert.assertEquals("before_after", response.getSlot().getData("c"));
-        Assert.assertEquals("before_after", response.getSlot().getData("d"));
-        Assert.assertEquals("before_after", response.getSlot().getData("e"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("a"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("b"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("c"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("d"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("e"));
     }
 
     //测试全局AOP,并行场景
     @Test
     public void testGlobalAopP() {
-        LiteflowResponse<DefaultSlot> response= flowExecutor.execute2Resp("chain2", "it's a request");
+        LiteflowResponse<DefaultContext> response= flowExecutor.execute2Resp("chain2", "it's a request");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("before_after", response.getSlot().getData("a"));
-        Assert.assertEquals("before_after", response.getSlot().getData("b"));
-        Assert.assertEquals("before_after", response.getSlot().getData("c"));
-        Assert.assertEquals("before_after", response.getSlot().getData("d"));
-        Assert.assertEquals("before_after", response.getSlot().getData("e"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("a"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("b"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("c"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("d"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("e"));
     }
 
     @Test
     public void testGlobalAopException() {
-        LiteflowResponse<DefaultSlot> response= flowExecutor.execute2Resp("chain3", "it's a request");
+        LiteflowResponse<DefaultContext> response= flowExecutor.execute2Resp("chain3", "it's a request");
         Assert.assertFalse(response.isSuccess());
-        Assert.assertEquals("before_after", response.getSlot().getData("a"));
-        Assert.assertEquals("before_after", response.getSlot().getData("b"));
-        Assert.assertEquals("before_after", response.getSlot().getData("c"));
-        Assert.assertEquals("before_after", response.getSlot().getData("f"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("a"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("b"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("c"));
+        Assert.assertEquals("before_after", response.getContextBean().getData("f"));
     }
 
     @AfterClass

+ 6 - 5
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java

@@ -2,16 +2,17 @@ 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 {
+public class CmpAspect implements ICmpAroundAspect<DefaultContext> {
     @Override
-    public void beforeProcess(String nodeId, Slot slot) {
-        slot.setData(nodeId, "before");
+    public void beforeProcess(String nodeId, DefaultContext contextBean) {
+        contextBean.setData(nodeId, "before");
     }
 
     @Override
-    public void afterProcess(String nodeId, Slot slot) {
-        slot.setData(nodeId, StrUtil.format("{}_{}", slot.getData(nodeId), "after"));
+    public void afterProcess(String nodeId, DefaultContext contextBean) {
+        contextBean.setData(nodeId, StrUtil.format("{}_{}", contextBean.getData(nodeId), "after"));
     }
 }

+ 4 - 3
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java

@@ -2,6 +2,7 @@ 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;
@@ -18,10 +19,10 @@ public class CustomAspect {
     @Around("cut()")
     public Object around(ProceedingJoinPoint jp) throws Throwable {
         NodeComponent cmp = (NodeComponent) jp.getThis();
-        Slot slot = cmp.getSlot();
-        slot.setData(cmp.getNodeId(), "before");
+        DefaultContext context = cmp.getContextBean();
+        context.setData(cmp.getNodeId(), "before");
         Object returnObj = jp.proceed();
-        slot.setData(cmp.getNodeId(), StrUtil.format("{}_{}", slot.getData(cmp.getNodeId()), "after"));
+        context.setData(cmp.getNodeId(), StrUtil.format("{}_{}", context.getData(cmp.getNodeId()), "after"));
         return returnObj;
     }
 }

+ 15 - 15
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringbootTest.java

@@ -2,8 +2,8 @@ package com.yomahub.liteflow.test.asyncNode;
 
 import cn.hutool.core.collection.ListUtil;
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -39,7 +39,7 @@ public class AsyncNodeSpringbootTest extends BaseTest {
      * **/
     @Test
     public void testAsyncFlow1() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "it's a base request");
         Assert.assertTrue(response.isSuccess());
         System.out.println(response.getSlot().getExecuteStepStr());
     }
@@ -47,7 +47,7 @@ public class AsyncNodeSpringbootTest extends BaseTest {
     //这个和test1有点类似,只不过进一步验证了步骤
     @Test
     public void testAsyncFlow2() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "it's a base request");
+        LiteflowResponse<DefaultContext> 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"
@@ -57,7 +57,7 @@ public class AsyncNodeSpringbootTest extends BaseTest {
     //测试errorResume,默认的errorResume为false,这里测试默认的
     @Test
     public void testAsyncFlow3_1() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3-1", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3-1", "it's a base request");
         Assert.assertFalse(response.isSuccess());
         Assert.assertEquals(response.getSlot().getException().getClass(), TestException.class);
     }
@@ -65,18 +65,18 @@ public class AsyncNodeSpringbootTest extends BaseTest {
     //测试errorResume,默认的errorResume为false,这里设置为true
     @Test
     public void testAsyncFlow3_2() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3-2", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3-2", "it's a base request");
         Assert.assertTrue(response.isSuccess());
     }
 
     //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了不抛错
     @Test
     public void testAsyncFlow4() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain4", "it's a base request");
         //因为不记录错误,所以最终结果是true
         Assert.assertTrue(response.isSuccess());
         //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下
-        Integer count = response.getSlot().getData("count");
+        Integer count = response.getContextBean().getData("count");
         Assert.assertEquals(new Integer(2), count);
         //因为配置了不抛错,所以response里的cause应该为null
         Assert.assertNull(response.getCause());
@@ -85,11 +85,11 @@ public class AsyncNodeSpringbootTest extends BaseTest {
     //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了会抛错
     @Test
     public void testAsyncFlow5() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain5", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain5", "it's a base request");
         //整个并行组是报错的,所以最终结果是false
         Assert.assertFalse(response.isSuccess());
         //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下
-        Integer count = response.getSlot().getData("count");
+        Integer count = response.getContextBean().getData("count");
         Assert.assertEquals(new Integer(2), count);
         //因为第一个when配置了会报错,所以response里的cause里应该会有TestException
         Assert.assertEquals(TestException.class, response.getCause().getClass());
@@ -98,11 +98,11 @@ public class AsyncNodeSpringbootTest extends BaseTest {
     //不同group的并行组,不会合并,第一个when的errorResume是false,会抛错,那第二个when就不会执行
     @Test
     public void testAsyncFlow6() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain6", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain6", "it's a base request");
         //第一个when会抛错,所以最终结果是false
         Assert.assertFalse(response.isSuccess());
         //因为是不同组并行组,第一组的when里的i就抛错了,所以i就执行了1遍
-        Integer count = response.getSlot().getData("count");
+        Integer count = response.getContextBean().getData("count");
         Assert.assertEquals(new Integer(1), count);
         //第一个when会报错,所以最终response的cause里应该会有TestException
         Assert.assertEquals(TestException.class, response.getCause().getClass());
@@ -111,11 +111,11 @@ public class AsyncNodeSpringbootTest extends BaseTest {
     //不同group的并行组,不会合并,第一个when的errorResume是true,不会报错,那第二个when还会继续执行,但是第二个when的errorResume是false,所以第二个when会报错
     @Test
     public void testAsyncFlow7() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain7", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain7", "it's a base request");
         //第二个when会抛错,所以最终结果是false
         Assert.assertFalse(response.isSuccess());
         //  传递了slotIndex,则set的size==2
-        Integer count = response.getSlot().getData("count");
+        Integer count = response.getContextBean().getData("count");
         Assert.assertEquals(new Integer(2), count);
         //第一个when会报错,所以最终response的cause里应该会有TestException
         Assert.assertEquals(TestException.class, response.getCause().getClass());
@@ -127,8 +127,8 @@ public class AsyncNodeSpringbootTest extends BaseTest {
     //这里要注意的是,由于step是先加入,所以step的打印顺序并不是这样的。但是实际执行是正确的
     @Test
     public void testAsyncFlow8() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain8", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain8", "it's a base request");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertTrue(response.getSlot().getData("check").toString().startsWith("habc"));
+        Assert.assertTrue(response.getContextBean().getData("check").toString().startsWith("habc"));
     }
 }

+ 6 - 5
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java

@@ -3,6 +3,7 @@ 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;
@@ -13,14 +14,14 @@ import org.springframework.stereotype.Component;
 public class ACmp{
     @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
     public void process(NodeComponent bindCmp) {
-        Slot slot = bindCmp.getSlot();
+        DefaultContext context = bindCmp.getContextBean();
         synchronized (NodeComponent.class){
-            if (slot.hasData("check")){
-                String str = slot.getData("check");
+            if (context.hasData("check")){
+                String str = context.getData("check");
                 str += bindCmp.getNodeId();
-                slot.setData("check", str);
+                context.setData("check", str);
             }else{
-                slot.setData("check", bindCmp.getNodeId());
+                context.setData("check", bindCmp.getNodeId());
             }
         }
         System.out.println("Acomp executed!");

+ 6 - 5
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java

@@ -3,6 +3,7 @@ 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;
@@ -13,14 +14,14 @@ import org.springframework.stereotype.Component;
 public class BCmp{
     @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
     public void process(NodeComponent bindCmp) {
-        Slot slot = bindCmp.getSlot();
+        DefaultContext context = bindCmp.getContextBean();
         synchronized (NodeComponent.class){
-            if (slot.hasData("check")){
-                String str = slot.getData("check");
+            if (context.hasData("check")){
+                String str = context.getData("check");
                 str += bindCmp.getNodeId();
-                slot.setData("check", str);
+                context.setData("check", str);
             }else{
-                slot.setData("check", bindCmp.getNodeId());
+                context.setData("check", bindCmp.getNodeId());
             }
         }
         System.out.println("Bcomp executed!");

+ 6 - 5
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java

@@ -3,6 +3,7 @@ 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;
@@ -13,14 +14,14 @@ import org.springframework.stereotype.Component;
 public class CCmp{
     @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
     public void process(NodeComponent bindCmp) throws Exception {
-        Slot slot = bindCmp.getSlot();
+        DefaultContext context = bindCmp.getContextBean();
         synchronized (NodeComponent.class){
-            if (slot.hasData("check")){
-                String str = slot.getData("check");
+            if (context.hasData("check")){
+                String str = context.getData("check");
                 str += bindCmp.getNodeId();
-                slot.setData("check", str);
+                context.setData("check", str);
             }else{
-                slot.setData("check", bindCmp.getNodeId());
+                context.setData("check", bindCmp.getNodeId());
             }
         }
         System.out.println("Ccomp executed!");

+ 6 - 5
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java

@@ -3,6 +3,7 @@ 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;
@@ -14,14 +15,14 @@ public class DCmp{
     @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
     public void process(NodeComponent bindCmp) throws Exception {
         Thread.sleep(1000);
-        Slot slot = bindCmp.getSlot();
+        DefaultContext context = bindCmp.getContextBean();
         synchronized (NodeComponent.class){
-            if (slot.hasData("check")){
-                String str = slot.getData("check");
+            if (context.hasData("check")){
+                String str = context.getData("check");
                 str += bindCmp.getNodeId();
-                slot.setData("check", str);
+                context.setData("check", str);
             }else{
-                slot.setData("check", bindCmp.getNodeId());
+                context.setData("check", bindCmp.getNodeId());
             }
         }
         System.out.println("Dcomp executed!");

+ 6 - 5
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java

@@ -3,6 +3,7 @@ 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;
@@ -15,14 +16,14 @@ public class GCmp{
     @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
     public void process(NodeComponent bindCmp) throws Exception {
         Thread.sleep(500);
-        Slot slot = bindCmp.getSlot();
+        DefaultContext context = bindCmp.getContextBean();
         synchronized (NodeComponent.class){
-            if (slot.hasData("check")){
-                String str = slot.getData("check");
+            if (context.hasData("check")){
+                String str = context.getData("check");
                 str += bindCmp.getNodeId();
-                slot.setData("check", str);
+                context.setData("check", str);
             }else{
-                slot.setData("check", bindCmp.getNodeId());
+                context.setData("check", bindCmp.getNodeId());
             }
         }
         System.out.println("Gcomp executed!");

+ 6 - 5
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java

@@ -3,6 +3,7 @@ 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;
@@ -14,14 +15,14 @@ public class HCmp{
 
     @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
     public void process(NodeComponent bindCmp) throws Exception {
-        Slot slot = bindCmp.getSlot();
+        DefaultContext context = bindCmp.getContextBean();
         synchronized (NodeComponent.class){
-            if (slot.hasData("check")){
-                String str = slot.getData("check");
+            if (context.hasData("check")){
+                String str = context.getData("check");
                 str += bindCmp.getNodeId();
-                slot.setData("check", str);
+                context.setData("check", str);
             }else{
-                slot.setData("check", bindCmp.getNodeId());
+                context.setData("check", bindCmp.getNodeId());
             }
         }
 

+ 6 - 5
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java

@@ -3,6 +3,7 @@ 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;
@@ -15,12 +16,12 @@ public class ICmp {
 
     @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
     public void process(NodeComponent bindCmp) throws Exception {
-        Slot slot = bindCmp.getSlot();
-        if (slot.hasData("count")){
-            Integer count = slot.getData("count");
-            slot.setData("count", ++count);
+        DefaultContext context = bindCmp.getContextBean();
+        if (context.hasData("count")){
+            Integer count = context.getData("count");
+            context.setData("count", ++count);
         } else{
-            slot.setData("count", 1);
+            context.setData("count", 1);
         }
         System.out.println("Icomp executed! throw Exception!");
         throw new TestException();

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/base/BaseSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.base;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -32,7 +32,7 @@ public class BaseSpringbootTest extends BaseTest {
 
     @Test
     public void testBase() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
     }
 

+ 4 - 4
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest1.java

@@ -4,10 +4,10 @@ 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.slot.DefaultSlot;
 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;
@@ -83,7 +83,7 @@ public class BuilderSpringbootTest1 extends BaseTest {
                         .setValue("e(f|g|chain2)").build()
         ).build();
 
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getSlot().getExecuteStepStr());
     }
@@ -141,7 +141,7 @@ public class BuilderSpringbootTest1 extends BaseTest {
                         .setValue("e(f|g|chain2)").build()
         ).build();
 
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getSlot().getExecuteStepStr());
     }
@@ -210,7 +210,7 @@ public class BuilderSpringbootTest1 extends BaseTest {
                                         )).build()
         ).build();
 
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getSlot().getExecuteStepStr());
     }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest2.java

@@ -3,8 +3,8 @@ 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.slot.DefaultSlot;
 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;
@@ -34,7 +34,7 @@ public class BuilderSpringbootTest2 extends BaseTest {
                 LiteFlowConditionBuilder.createThenCondition().setValue("h,i,j").build()
         ).build();
 
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("h==>i==>j", response.getSlot().getExecuteStepStr());
     }

+ 5 - 5
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.cmpRetry;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -34,7 +34,7 @@ public class LiteflowRetrySpringbootTest extends BaseTest {
     //全局重试配置测试
     @Test
     public void testRetry1() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a==>b==>b==>b", response.getSlot().getExecuteStepStr());
     }
@@ -42,7 +42,7 @@ public class LiteflowRetrySpringbootTest extends BaseTest {
     //单个组件重试配置测试
     @Test
     public void testRetry2() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain2", "arg");
         Assert.assertFalse(response.isSuccess());
         Assert.assertEquals("c==>c==>c==>c==>c==>c", response.getSlot().getExecuteStepStr());
     }
@@ -50,14 +50,14 @@ public class LiteflowRetrySpringbootTest extends BaseTest {
     //单个组件指定异常,但抛出的并不是指定异常的场景测试
     @Test
     public void testRetry3() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3", "arg");
         Assert.assertFalse(response.isSuccess());
     }
 
     //单个组件指定异常重试,抛出的是指定异常或者
     @Test
     public void testRetry4() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain4", "arg");
         Assert.assertFalse(response.isSuccess());
         Assert.assertEquals("e==>e==>e==>e==>e==>e", response.getSlot().getExecuteStepStr());
     }

+ 8 - 8
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.component;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -38,7 +38,7 @@ public class FlowExecutorSpringbootTest extends BaseTest {
     //isAccess方法的功能测试
     @Test
     public void testIsAccess() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", 101);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", 101);
         Assert.assertTrue(response.isSuccess());
         Assert.assertNotNull(response.getSlot().getResponseData());
     }
@@ -46,7 +46,7 @@ public class FlowExecutorSpringbootTest extends BaseTest {
     //组件抛错的功能点测试
     @Test(expected = ArithmeticException.class)
     public void testComponentException() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", 0);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain2", 0);
         Assert.assertFalse(response.isSuccess());
         Assert.assertEquals("/ by zero", response.getMessage());
         ReflectionUtils.rethrowException(response.getCause());
@@ -55,7 +55,7 @@ public class FlowExecutorSpringbootTest extends BaseTest {
     //isContinueOnError方法的功能点测试
     @Test
     public void testIsContinueOnError() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3", 0);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3", 0);
         Assert.assertTrue(response.isSuccess());
         Assert.assertNull(response.getCause());
     }
@@ -63,7 +63,7 @@ public class FlowExecutorSpringbootTest extends BaseTest {
     //isEnd方法的功能点测试
     @Test
     public void testIsEnd() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", 10);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain4", 10);
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("d",response.getSlot().getExecuteStepStr());
     }
@@ -71,7 +71,7 @@ public class FlowExecutorSpringbootTest extends BaseTest {
     //setIsEnd方法的功能点测试
     @Test
     public void testSetIsEnd1() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain5", 10);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain5", 10);
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("e",response.getSlot().getExecuteStepStr());
     }
@@ -79,14 +79,14 @@ public class FlowExecutorSpringbootTest extends BaseTest {
     //条件组件的功能点测试
     @Test
     public void testNodeCondComponent() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain6", 0);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain6", 0);
         Assert.assertTrue(response.isSuccess());
     }
 
     //测试setIsEnd如果为true,continueError也为true,那不应该continue了
     @Test
     public void testSetIsEnd2() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain7", 10);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain7", 10);
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("g",response.getSlot().getExecuteStepStr());
     }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.customNodes;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -37,7 +37,7 @@ public class CustomNodesSpringbootTest extends BaseTest {
 
     @Test
     public void testCustomNodes() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
         response = flowExecutor.execute2Resp("chain2", "arg");
         Assert.assertTrue(response.isSuccess());

+ 7 - 7
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.customWhenThreadPool;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -40,9 +40,9 @@ public class CustomWhenThreadPoolSpringbootTest extends BaseTest {
      */
     @Test
     public void testGlobalThreadPool() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain", "arg");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertTrue(response.getSlot().getData("threadName").toString().startsWith("lf-when-thead"));
+        Assert.assertTrue(response.getContextBean().getData("threadName").toString().startsWith("lf-when-thead"));
     }
 
     /**
@@ -50,9 +50,9 @@ public class CustomWhenThreadPoolSpringbootTest extends BaseTest {
      */
     @Test
     public void testGlobalAndCustomWhenThreadPool() {
-        LiteflowResponse<DefaultSlot> response1 = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response1 = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response1.isSuccess());
-        Assert.assertTrue(response1.getSlot().getData("threadName").toString().startsWith("customer-when-1-thead"));
+        Assert.assertTrue(response1.getContextBean().getData("threadName").toString().startsWith("customer-when-1-thead"));
     }
 
 
@@ -64,9 +64,9 @@ public class CustomWhenThreadPoolSpringbootTest extends BaseTest {
         // 使用when - thread1
         testGlobalAndCustomWhenThreadPool();
         // chain配置同一个thead1
-        LiteflowResponse<DefaultSlot> response2 = flowExecutor.execute2Resp("chain2", "arg");
+        LiteflowResponse<DefaultContext> response2 = flowExecutor.execute2Resp("chain2", "arg");
         Assert.assertTrue(response2.isSuccess());
-        Assert.assertTrue(response2.getSlot().getData("threadName").toString().startsWith("customer-when-1-thead"));
+        Assert.assertTrue(response2.getContextBean().getData("threadName").toString().startsWith("customer-when-1-thead"));
 
     }
 }

+ 3 - 1
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java

@@ -11,6 +11,7 @@ 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.slot.DefaultContext;
 import org.springframework.stereotype.Component;
 
 @Component("b")
@@ -19,7 +20,8 @@ public class BCmp{
 
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
-		bindCmp.getSlot().setData("threadName", Thread.currentThread().getName());
+		DefaultContext context = bindCmp.getContextBean();
+		context.setData("threadName", Thread.currentThread().getName());
 		System.out.println("BCmp executed!");
 	}
 

+ 3 - 1
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java

@@ -11,6 +11,7 @@ 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.slot.DefaultContext;
 import org.springframework.stereotype.Component;
 
 @Component("c")
@@ -19,7 +20,8 @@ public class CCmp{
 
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
-		bindCmp.getSlot().setData("threadName", Thread.currentThread().getName());
+		DefaultContext context = bindCmp.getContextBean();
+		context.setData("threadName", Thread.currentThread().getName());
 		System.out.println("CCmp executed!");
 	}
 

+ 3 - 1
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java

@@ -11,6 +11,7 @@ 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.slot.DefaultContext;
 import org.springframework.stereotype.Component;
 
 @Component("d")
@@ -19,7 +20,8 @@ public class DCmp{
 
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
-		bindCmp.getSlot().setData("threadName", Thread.currentThread().getName());
+		DefaultContext context = bindCmp.getContextBean();
+		context.setData("threadName", Thread.currentThread().getName());
 		System.out.println("DCmp executed!");
 	}
 

+ 3 - 1
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java

@@ -11,6 +11,7 @@ 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.slot.DefaultContext;
 import org.springframework.stereotype.Component;
 
 @Component("e")
@@ -19,7 +20,8 @@ public class ECmp{
 
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
-		bindCmp.getSlot().setData("threadName", Thread.currentThread().getName());
+		DefaultContext context = bindCmp.getContextBean();
+		context.setData("threadName", Thread.currentThread().getName());
 		System.out.println("ECmp executed!");
 	}
 

+ 3 - 1
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java

@@ -11,6 +11,7 @@ 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.slot.DefaultContext;
 import org.springframework.stereotype.Component;
 
 @Component("f")
@@ -19,7 +20,8 @@ public class FCmp{
 
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
-		bindCmp.getSlot().setData("threadName", Thread.currentThread().getName());
+		DefaultContext context = bindCmp.getContextBean();
+		context.setData("threadName", Thread.currentThread().getName());
 		System.out.println("FCmp executed!");
 	}
 

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/exception/ExceptionSpringBootTest.java

@@ -1,13 +1,13 @@
 package com.yomahub.liteflow.test.exception;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.exception.ChainNotFoundException;
 import com.yomahub.liteflow.exception.ConfigErrorException;
 import com.yomahub.liteflow.exception.FlowExecutorNotInitException;
 import com.yomahub.liteflow.exception.FlowSystemException;
 import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.junit.Assert;
 import org.junit.Test;
@@ -75,7 +75,7 @@ public class ExceptionSpringBootTest extends BaseTest {
 
     @Test
     public void testGetSlotFromResponseWhenException() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "test");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain4", "test");
         Assert.assertFalse(response.isSuccess());
         Assert.assertNotNull(response.getCause());
         Assert.assertNotNull(response.getSlot());

+ 3 - 3
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.execute2Future;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -33,8 +33,8 @@ public class Executor2FutureSpringbootTest extends BaseTest {
 
     @Test
     public void testFuture() throws Exception{
-        Future<LiteflowResponse<DefaultSlot>> future = flowExecutor.execute2Future("chain1", "arg", DefaultSlot.class);
-        LiteflowResponse<DefaultSlot> response = future.get();
+        Future<LiteflowResponse<DefaultContext>> future = flowExecutor.execute2Future("chain1", "arg", DefaultContext.class);
+        LiteflowResponse<DefaultContext> response = future.get();
         Assert.assertTrue(response.isSuccess());
     }
 

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaSpringbootTest.java

@@ -1,9 +1,9 @@
 package com.yomahub.liteflow.test.flowmeta;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.flow.FlowBus;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import com.yomahub.liteflow.test.flowmeta.cmp2.DCmp;
 import org.junit.Assert;
@@ -31,7 +31,7 @@ public class FlowMetaSpringbootTest extends BaseTest {
     @Test
     public void testFlowMeta() {
         FlowBus.addCommonNode("d", "d组件", DCmp.class.getName());
-        LiteflowResponse<DefaultSlot> response= flowExecutor.execute2Resp("chain1", "it's a request");
+        LiteflowResponse<DefaultContext> response= flowExecutor.execute2Resp("chain1", "it's a request");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a==>b==>c==>d[d组件]", response.getSlot().getExecuteStepStr());
     }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/lazy/LazySpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.lazy;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -27,7 +27,7 @@ public class LazySpringbootTest extends BaseTest {
 
     @Test
     public void testLazy() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
     }
 }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/liteflowcomponent/LiteflowComponentSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.liteflowcomponent;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -32,7 +32,7 @@ public class LiteflowComponentSpringbootTest extends BaseTest {
 
     @Test
     public void testConfig() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a[A组件]==>b[B组件]==>c[C组件]==>b[B组件]==>a[A组件]==>d", response.getSlot().getExecuteStepStr());
     }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/monitor/MonitorSpringbootTest.java

@@ -1,9 +1,9 @@
 package com.yomahub.liteflow.test.monitor;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.monitor.MonitorBus;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.spi.holder.ContextAwareHolder;
 import com.yomahub.liteflow.test.BaseTest;
 import org.junit.AfterClass;
@@ -35,7 +35,7 @@ public class MonitorSpringbootTest extends BaseTest {
 
     @Test
     public void testMonitor() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
 
         Thread.sleep(10000);

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.multipleType;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -32,7 +32,7 @@ public class LiteflowMultipleTypeSpringbootTest extends BaseTest {
 
     @Test
     public void testMultipleType() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a==>b==>c==>b==>a", response.getSlot().getExecuteStepStr());
         response = flowExecutor.execute2Resp("chain3", "arg");

+ 3 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java

@@ -2,6 +2,7 @@ package com.yomahub.liteflow.test.nodeExecutor;
 
 import com.yomahub.liteflow.core.NodeComponent;
 import com.yomahub.liteflow.slot.DataBus;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 import com.yomahub.liteflow.flow.executor.NodeExecutor;
 
@@ -11,9 +12,9 @@ import com.yomahub.liteflow.flow.executor.NodeExecutor;
 public class CustomerDefaultNodeExecutor extends NodeExecutor {
     @Override
     public void execute(NodeComponent instance) throws Exception {
-        Slot slot = DataBus.getSlot(instance.getSlotIndex());
+        DefaultContext context = instance.getContextBean();
         LOG.info("使用customerDefaultNodeExecutor进行执行");
-        slot.setData("customerDefaultNodeExecutor", this.getClass());
+        context.setData("customerDefaultNodeExecutor", this.getClass());
         super.execute(instance);
     }
 }

+ 3 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java

@@ -2,6 +2,7 @@ package com.yomahub.liteflow.test.nodeExecutor;
 
 import com.yomahub.liteflow.core.NodeComponent;
 import com.yomahub.liteflow.slot.DataBus;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 import com.yomahub.liteflow.flow.executor.NodeExecutor;
 
@@ -11,9 +12,9 @@ import com.yomahub.liteflow.flow.executor.NodeExecutor;
 public class CustomerNodeExecutor extends NodeExecutor {
     @Override
     public void execute(NodeComponent instance) throws Exception {
-        Slot slot = DataBus.getSlot(instance.getSlotIndex());
+        DefaultContext context = instance.getContextBean();
         LOG.info("使用customerNodeExecutor进行执行");
-        slot.setData("customerNodeExecutor", this.getClass());
+        context.setData("customerNodeExecutor", this.getClass());
         super.execute(instance);
     }
 

+ 5 - 4
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java

@@ -2,6 +2,7 @@ package com.yomahub.liteflow.test.nodeExecutor;
 
 import com.yomahub.liteflow.core.NodeComponent;
 import com.yomahub.liteflow.slot.DataBus;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 import com.yomahub.liteflow.flow.executor.NodeExecutor;
 
@@ -13,17 +14,17 @@ import java.util.concurrent.TimeUnit;
 public class CustomerNodeExecutorAndCustomRetry extends NodeExecutor {
     @Override
     public void execute(NodeComponent instance) throws Exception {
-        Slot slot = DataBus.getSlot(instance.getSlotIndex());
+        DefaultContext context = instance.getContextBean();
         LOG.info("使用customerNodeExecutorAndCustomRetry进行执行");
-        slot.setData("customerNodeExecutorAndCustomRetry", this.getClass());
+        context.setData("customerNodeExecutorAndCustomRetry", this.getClass());
         super.execute(instance);
     }
 
     @Override
     protected void retry(NodeComponent instance, int currentRetryCount) throws Exception {
         TimeUnit.MICROSECONDS.sleep(20L);
-        Slot slot = DataBus.getSlot(instance.getSlotIndex());
-        slot.setData("retryLogic", this.getClass());
+        DefaultContext context = instance.getContextBean();
+        context.setData("retryLogic", this.getClass());
         super.retry(instance, currentRetryCount);
     }
 }

+ 8 - 8
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.nodeExecutor;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -35,25 +35,25 @@ public class LiteflowNodeExecutorSpringbootTest extends BaseTest {
     // 默认执行器测试
     @Test
     public void testCustomerDefaultNodeExecutor() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals(CustomerDefaultNodeExecutor.class, response.getSlot().getData("customerDefaultNodeExecutor"));
+        Assert.assertEquals(CustomerDefaultNodeExecutor.class, response.getContextBean().getData("customerDefaultNodeExecutor"));
         Assert.assertEquals("a", response.getSlot().getExecuteStepStr());
     }
 
     //默认执行器测试+全局重试配置测试
     @Test
     public void testDefaultExecutorForRetry() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain2", "arg");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals(CustomerDefaultNodeExecutor.class, response.getSlot().getData("customerDefaultNodeExecutor"));
+        Assert.assertEquals(CustomerDefaultNodeExecutor.class, response.getContextBean().getData("customerDefaultNodeExecutor"));
         Assert.assertEquals("b==>b==>b", response.getSlot().getExecuteStepStr());
     }
 
     //自定义执行器测试
     @Test
     public void testCustomerExecutor() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3", "arg");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("c", response.getSlot().getExecuteStepStr());
     }
@@ -61,9 +61,9 @@ public class LiteflowNodeExecutorSpringbootTest extends BaseTest {
     //自定义执行器测试+全局重试配置测试
     @Test
     public void testCustomExecutorForRetry() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain4", "arg");
         Assert.assertFalse(response.isSuccess());
-        Assert.assertEquals(CustomerNodeExecutorAndCustomRetry.class, response.getSlot().getData("retryLogic"));
+        Assert.assertEquals(CustomerNodeExecutorAndCustomRetry.class, response.getContextBean().getData("retryLogic"));
         Assert.assertEquals("d==>d==>d==>d==>d==>d", response.getSlot().getExecuteStepStr());
     }
 }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.parsecustom;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -33,7 +33,7 @@ public class CustomParserJsonSpringbootTest extends BaseTest {
     //测试springboot场景的自定义json parser
     @Test
     public void testJsonCustomParser() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "args");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "args");
         Assert.assertTrue(response.isSuccess());
     }
 }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.parsecustom;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -34,7 +34,7 @@ public class CustomParserXmlSpringbootTest extends BaseTest {
     //测试springboot场景的自定义json parser
     @Test
     public void testXmlCustomParser() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "args");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "args");
         Assert.assertTrue(response.isSuccess());
     }
 }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/parser/JsonParserSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.parser;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -31,7 +31,7 @@ public class JsonParserSpringbootTest extends BaseTest {
     //测试spring场景的json parser
     @Test
     public void testJsonParser() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain2", "arg");
         Assert.assertTrue(response.isSuccess());
     }
 }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/parser/SpringELSupportSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.parser;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -26,7 +26,7 @@ public class SpringELSupportSpringbootTest extends BaseTest {
     //测试springEL的解析情况
     @Test
     public void testSpringELParser() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
     }
 }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/parser/XmlParserSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.parser;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -31,7 +31,7 @@ public class XmlParserSpringbootTest extends BaseTest {
     //测试无springboot场景的xml parser
     @Test
     public void testXmlParser() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
     }
 }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/parser/YmlParserSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.parser;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -31,7 +31,7 @@ public class YmlParserSpringbootTest extends BaseTest {
     //测试无springboot场景的yml parser
     @Test
     public void testYmlParser() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain2", "arg");
         Assert.assertTrue(response.isSuccess());
     }
 }

+ 6 - 6
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallySpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.preAndFinally;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -33,7 +33,7 @@ public class PreAndFinallySpringbootTest extends BaseTest {
     //测试普通的pre和finally节点
     @Test
     public void testPreAndFinally1() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getSlot().getExecuteStepStr());
     }
@@ -41,7 +41,7 @@ public class PreAndFinallySpringbootTest extends BaseTest {
     //测试pre和finally节点不放在开头和结尾的情况
     @Test
     public void testPreAndFinally2() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain2", "arg");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getSlot().getExecuteStepStr());
     }
@@ -49,7 +49,7 @@ public class PreAndFinallySpringbootTest extends BaseTest {
     //测试有节点报错是否还执行finally节点的情况,其中d节点会报错,但依旧执行f1,f2节点
     @Test
     public void testPreAndFinally3() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3", "arg");
         Assert.assertFalse(response.isSuccess());
         Assert.assertEquals("p1==>p2==>a==>d==>f1==>f2", response.getSlot().getExecuteStepStr());
     }
@@ -57,8 +57,8 @@ public class PreAndFinallySpringbootTest extends BaseTest {
     //测试在finally节点里是否能获取exception
     @Test
     public void testPreAndFinally4() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain4", "arg");
         Assert.assertFalse(response.isSuccess());
-        Assert.assertTrue(response.getSlot().getData("hasEx"));
+        Assert.assertTrue(response.getContextBean().getData("hasEx"));
     }
 }

+ 5 - 3
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java

@@ -11,6 +11,7 @@ import cn.hutool.core.util.ObjectUtil;
 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;
@@ -21,11 +22,12 @@ public class Finally3Cmp{
 
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) throws Exception{
-		Slot slot = bindCmp.getSlot();
+		Slot<DefaultContext> slot = bindCmp.getSlot();
+		DefaultContext context = slot.getContextBean();
 		if (ObjectUtil.isNull(slot.getException())){
-			slot.setData("hasEx", false);
+			context.setData("hasEx", false);
 		}else{
-			slot.setData("hasEx", true);
+			context.setData("hasEx", true);
 		}
 		System.out.println("Finally3Cmp executed!");
 	}

+ 3 - 3
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliverySpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.privateDelivery;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -33,8 +33,8 @@ public class PrivateDeliverySpringbootTest extends BaseTest {
 
     @Test
     public void testPrivateDelivery() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
-        Set<Integer> set = response.getSlot().getData("testSet");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
+        Set<Integer> set = response.getContextBean().getData("testSet");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals(100, set.size());
     }

+ 3 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java

@@ -11,6 +11,7 @@ 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.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
 
@@ -23,8 +24,8 @@ public class ACmp{
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
 		System.out.println("ACmp executed!");
-		Slot slot = bindCmp.getSlot();
-		slot.setData("testSet", new HashSet<>());
+		DefaultContext context = bindCmp.getContextBean();
+		context.setData("testSet", new HashSet<>());
 
 		for (int i = 0; i < 100; i++) {
 			bindCmp.sendPrivateDeliveryData("b",i+1);

+ 3 - 1
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java

@@ -12,6 +12,7 @@ import com.yomahub.liteflow.annotation.LiteflowComponent;
 import com.yomahub.liteflow.annotation.LiteflowMethod;
 import com.yomahub.liteflow.core.NodeComponent;
 import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
+import com.yomahub.liteflow.slot.DefaultContext;
 
 import java.util.Set;
 
@@ -23,7 +24,8 @@ public class BCmp{
     public void process(NodeComponent bindCmp) {
         System.out.println("BCmp executed!");
         Integer value = bindCmp.getPrivateDeliveryData();
-        Set<Integer> testSet = bindCmp.getSlot().getData("testSet");
+        DefaultContext context = bindCmp.getContextBean();
+        Set<Integer> testSet = context.getData("testSet");
         testSet.add(value);
     }
 }

+ 3 - 3
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleSpringbootTest.java

@@ -2,10 +2,10 @@ package com.yomahub.liteflow.test.refreshRule;
 
 import cn.hutool.core.io.resource.ResourceUtil;
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.enums.FlowParserTypeEnum;
 import com.yomahub.liteflow.flow.FlowBus;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.junit.Assert;
 import org.junit.Test;
@@ -38,7 +38,7 @@ public class RefreshRuleSpringbootTest extends BaseTest {
     public void testRefresh1() throws Exception{
         String content = ResourceUtil.readUtf8Str("classpath: /refreshRule/flow_update.xml");
         FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, content);
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
     }
 
@@ -57,7 +57,7 @@ public class RefreshRuleSpringbootTest extends BaseTest {
         }).start();
 
         for (int i = 0; i < 500; i++) {
-            LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+            LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
             Assert.assertTrue(response.isSuccess());
             try {
                 Thread.sleep(10L);

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/reload/ReloadSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.reload;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -35,7 +35,7 @@ public class ReloadSpringbootTest extends BaseTest {
     @Test
     public void testReload() throws Exception{
         flowExecutor.reloadRule();
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
     }
 }

+ 4 - 4
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotSpringbootTest.java

@@ -3,8 +3,8 @@ package com.yomahub.liteflow.test.resizeSlot;
 import cn.hutool.core.util.ReflectUtil;
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.slot.DataBus;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -43,13 +43,13 @@ public class ResizeSlotSpringbootTest extends BaseTest {
     public void testResize() throws Exception{
         ExecutorService pool = Executors.newCachedThreadPool();
 
-        List<Future<LiteflowResponse<DefaultSlot>>> futureList = new ArrayList<>();
+        List<Future<LiteflowResponse<DefaultContext>>> futureList = new ArrayList<>();
         for (int i = 0; i < 100; i++) {
-            Future<LiteflowResponse<DefaultSlot>> future = pool.submit(() -> flowExecutor.execute2Resp("chain1", "arg"));
+            Future<LiteflowResponse<DefaultContext>> future = pool.submit(() -> flowExecutor.execute2Resp("chain1", "arg"));
             futureList.add(future);
         }
 
-        for(Future<LiteflowResponse<DefaultSlot>> future : futureList){
+        for(Future<LiteflowResponse<DefaultContext>> future : futureList){
             Assert.assertTrue(future.get().isSuccess());
         }
 

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.subflow;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -37,7 +37,7 @@ public class ImplicitSubFlowSpringbootTest extends BaseTest {
     //这里GCmp中隐式的调用chain4,从而执行了h,m
     @Test
     public void testImplicitSubFlow() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3", "it's a request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3", "it's a request");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("f==>g==>h==>m", response.getSlot().getExecuteStepStr());
 

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigSpringbootTest.java

@@ -1,10 +1,10 @@
 package com.yomahub.liteflow.test.subflow;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.exception.MultipleParsersException;
 import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.junit.Assert;
 import org.junit.Test;
@@ -36,7 +36,7 @@ public class SubflowInDifferentConfigSpringbootTest extends BaseTest {
     //是否按照流程定义配置执行
     @Test
     public void testExplicitSubFlow1() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "it's a request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "it's a request");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a==>b==>b==>a==>e==>d", response.getSlot().getExecuteStepStr());
     }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonSpringBootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.subflow;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -33,7 +33,7 @@ public class SubflowJsonSpringBootTest extends BaseTest {
     //是否按照流程定义配置执行
     @Test
     public void testExplicitSubFlow() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "it's a request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "it's a request");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getSlot().getExecuteStepStr());
     }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLSpringBootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.subflow;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -33,7 +33,7 @@ public class SubflowXMLSpringBootTest extends BaseTest {
     //是否按照流程定义配置执行
     @Test
     public void testExplicitSubFlow() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "it's a request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "it's a request");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getSlot().getExecuteStepStr());
     }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlSpringBootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.subflow;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -33,7 +33,7 @@ public class SubflowYmlSpringBootTest extends BaseTest {
     //是否按照流程定义配置执行
     @Test
     public void testExplicitSubFlowYml() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "it's a request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "it's a request");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getSlot().getExecuteStepStr());
     }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java

@@ -4,8 +4,8 @@ import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
 import com.yomahub.liteflow.annotation.LiteflowMethod;
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
+import com.yomahub.liteflow.slot.DefaultContext;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -26,6 +26,6 @@ public class GCmp{
 
         System.out.println("Gcmp executed!");
 
-        flowExecutor.invoke("chain4", "it's implicit subflow.", DefaultSlot.class, bindCmp.getSlotIndex());
+        flowExecutor.invoke("chain4", "it's implicit subflow.", bindCmp.getSlotIndex());
     }
 }

+ 7 - 7
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootJsonTest.java

@@ -2,8 +2,8 @@ package com.yomahub.liteflow.test.tag;
 
 import cn.hutool.core.collection.ConcurrentHashSet;
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -33,14 +33,14 @@ public class NodeTagSpringbootJsonTest extends BaseTest {
 
     @Test
     public void testTag1() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("123",response.getSlot().getData("test"));
+        Assert.assertEquals("123",response.getContextBean().getData("test"));
     }
 
     @Test
     public void testTag2() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain2", "arg");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a==>a==>a==>c==>e", response.getSlot().getExecuteStepStr());
     }
@@ -50,9 +50,9 @@ public class NodeTagSpringbootJsonTest extends BaseTest {
     @Test
     public void testTag3() throws Exception{
         for (int i = 0; i < 50; i++) {
-            LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3", "arg");
+            LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3", "arg");
             Assert.assertTrue(response.isSuccess());
-            ConcurrentHashSet<String> testSet = response.getSlot().getData("test");
+            ConcurrentHashSet<String> testSet = response.getContextBean().getData("test");
             Assert.assertEquals(3, testSet.size());
         }
     }
@@ -60,7 +60,7 @@ public class NodeTagSpringbootJsonTest extends BaseTest {
     //测试tag是否能在isAccess中起效
     @Test
     public void testTag4() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain4", "arg");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("g", response.getSlot().getExecuteStepStr());
     }

+ 7 - 7
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootXmlTest.java

@@ -2,8 +2,8 @@ package com.yomahub.liteflow.test.tag;
 
 import cn.hutool.core.collection.ConcurrentHashSet;
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -33,14 +33,14 @@ public class NodeTagSpringbootXmlTest extends BaseTest {
 
     @Test
     public void testTag1() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("123",response.getSlot().getData("test"));
+        Assert.assertEquals("123",response.getContextBean().getData("test"));
     }
 
     @Test
     public void testTag2() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain2", "arg");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a==>a==>a==>c==>e", response.getSlot().getExecuteStepStr());
     }
@@ -50,9 +50,9 @@ public class NodeTagSpringbootXmlTest extends BaseTest {
     @Test
     public void testTag3() throws Exception{
         for (int i = 0; i < 50; i++) {
-            LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3", "arg");
+            LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3", "arg");
             Assert.assertTrue(response.isSuccess());
-            ConcurrentHashSet<String> testSet = response.getSlot().getData("test");
+            ConcurrentHashSet<String> testSet = response.getContextBean().getData("test");
             Assert.assertEquals(3, testSet.size());
         }
     }
@@ -60,7 +60,7 @@ public class NodeTagSpringbootXmlTest extends BaseTest {
     //测试tag是否能在isAccess中起效
     @Test
     public void testTag4() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain4", "arg");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("g", response.getSlot().getExecuteStepStr());
     }

+ 6 - 5
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java

@@ -11,6 +11,7 @@ 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.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
 
@@ -22,13 +23,13 @@ public class ACmp{
 	public void process(NodeComponent bindCmp) {
 		String testKey = "test";
 
-		Slot slot = bindCmp.getSlot();
-		if (slot.getData(testKey) == null){
-			slot.setData(testKey,bindCmp.getTag());
+		DefaultContext context = bindCmp.getContextBean();
+		if (context.getData(testKey) == null){
+			context.setData(testKey,bindCmp.getTag());
 		}else{
-			String s = slot.getData(testKey);
+			String s = context.getData(testKey);
 			s += bindCmp.getTag();
-			slot.setData(testKey, s);
+			context.setData(testKey, s);
 		}
 	}
 }

+ 3 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java

@@ -12,6 +12,7 @@ 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.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
 
@@ -21,7 +22,7 @@ public class B1Cmp{
 
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
-		Slot slot = bindCmp.getSlot();
-		slot.setData("test",new ConcurrentHashSet<String>());
+		DefaultContext context = bindCmp.getContextBean();
+		context.setData("test",new ConcurrentHashSet<String>());
 	}
 }

+ 3 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java

@@ -12,6 +12,7 @@ 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.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
 
@@ -21,8 +22,8 @@ public class BCmp{
 
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
-		Slot slot = bindCmp.getSlot();
-		ConcurrentHashSet<String> testSet = slot.getData("test");
+		DefaultContext context = bindCmp.getContextBean();
+		ConcurrentHashSet<String> testSet = context.getData("test");
 		testSet.add(bindCmp.getTag());
 	}
 }

+ 7 - 7
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenSpringbootTest.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.useTTLInWhen;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -32,11 +32,11 @@ public class UseTTLInWhenSpringbootTest extends BaseTest {
 
     @Test
     public void testUseTTLInWhen() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
-        Assert.assertEquals("hello,b", response.getSlot().getData("b"));
-        Assert.assertEquals("hello,c", response.getSlot().getData("c"));
-        Assert.assertEquals("hello,d", response.getSlot().getData("d"));
-        Assert.assertEquals("hello,e", response.getSlot().getData("e"));
-        Assert.assertEquals("hello,f", response.getSlot().getData("f"));
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
+        Assert.assertEquals("hello,b", response.getContextBean().getData("b"));
+        Assert.assertEquals("hello,c", response.getContextBean().getData("c"));
+        Assert.assertEquals("hello,d", response.getContextBean().getData("d"));
+        Assert.assertEquals("hello,e", response.getContextBean().getData("e"));
+        Assert.assertEquals("hello,f", response.getContextBean().getData("f"));
     }
 }

+ 3 - 1
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java

@@ -11,6 +11,7 @@ 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.slot.DefaultContext;
 import com.yomahub.liteflow.test.useTTLInWhen.TestTL;
 import org.springframework.stereotype.Component;
 
@@ -21,7 +22,8 @@ public class BCmp{
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
 		String value = TestTL.get();
-		bindCmp.getSlot().setData(bindCmp.getNodeId(),value+",b");
+		DefaultContext context = bindCmp.getContextBean();
+		context.setData(bindCmp.getNodeId(),value+",b");
 		System.out.println("BCmp executed!");
 	}
 

+ 3 - 1
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java

@@ -11,6 +11,7 @@ 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.slot.DefaultContext;
 import com.yomahub.liteflow.test.useTTLInWhen.TestTL;
 import org.springframework.stereotype.Component;
 
@@ -21,7 +22,8 @@ public class CCmp{
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
 		String value = TestTL.get();
-		bindCmp.getSlot().setData(bindCmp.getNodeId(),value+",c");
+		DefaultContext context = bindCmp.getContextBean();
+		context.setData(bindCmp.getNodeId(),value+",c");
 		System.out.println("CCmp executed!");
 	}
 

+ 3 - 1
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java

@@ -11,6 +11,7 @@ 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.slot.DefaultContext;
 import com.yomahub.liteflow.test.useTTLInWhen.TestTL;
 import org.springframework.stereotype.Component;
 
@@ -21,7 +22,8 @@ public class DCmp{
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
 		String value = TestTL.get();
-		bindCmp.getSlot().setData(bindCmp.getNodeId(),value+",d");
+		DefaultContext context = bindCmp.getContextBean();
+		context.setData(bindCmp.getNodeId(),value+",d");
 		System.out.println("DCmp executed!");
 	}
 

+ 3 - 1
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java

@@ -11,6 +11,7 @@ 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.slot.DefaultContext;
 import com.yomahub.liteflow.test.useTTLInWhen.TestTL;
 import org.springframework.stereotype.Component;
 
@@ -21,7 +22,8 @@ public class ECmp{
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
 		String value = TestTL.get();
-		bindCmp.getSlot().setData(bindCmp.getNodeId(),value+",e");
+		DefaultContext context = bindCmp.getContextBean();
+		context.setData(bindCmp.getNodeId(),value+",e");
 		System.out.println("ECmp executed!");
 	}
 

+ 3 - 1
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java

@@ -11,6 +11,7 @@ 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.slot.DefaultContext;
 import com.yomahub.liteflow.test.useTTLInWhen.TestTL;
 import org.springframework.stereotype.Component;
 
@@ -21,7 +22,8 @@ public class FCmp{
 	@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
 	public void process(NodeComponent bindCmp) {
 		String value = TestTL.get();
-		bindCmp.getSlot().setData(bindCmp.getNodeId(),value+",f");
+		DefaultContext context = bindCmp.getContextBean();
+		context.setData(bindCmp.getNodeId(),value+",f");
 		System.out.println("FCmp executed!");
 	}
 

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest1.java

@@ -1,9 +1,9 @@
 package com.yomahub.liteflow.test.whenTimeOut;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.exception.WhenTimeoutException;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.junit.Assert;
 import org.junit.Test;
@@ -38,7 +38,7 @@ public class WhenTimeOutSpringbootTest1 extends BaseTest {
     //其中b和c在when情况下超时,所以抛出了WhenTimeoutException这个错
     @Test
     public void testWhenTimeOut() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertFalse(response.isSuccess());
         Assert.assertEquals(WhenTimeoutException.class, response.getCause().getClass());
     }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest2.java

@@ -1,8 +1,8 @@
 package com.yomahub.liteflow.test.whenTimeOut;
 
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 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;
@@ -37,7 +37,7 @@ public class WhenTimeOutSpringbootTest2 extends BaseTest {
     //其中d,e,f都sleep 4秒,其中def是不同的组,超时设置5秒
     @Test
     public void testWhenTimeOut() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
     }
 }

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonSpringbootTest.java

@@ -2,8 +2,8 @@ package com.yomahub.liteflow.test.zookeeper;
 
 import cn.hutool.core.io.resource.ResourceUtil;
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.I0Itec.zkclient.ZkClient;
 import org.I0Itec.zkclient.exception.ZkMarshallingError;
@@ -72,7 +72,7 @@ public class ZkNodeWithJsonSpringbootTest extends BaseTest {
     
     @Test
     public void testZkNodeWithJson() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
     }
     

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlSpringbootTest.java

@@ -2,8 +2,8 @@ package com.yomahub.liteflow.test.zookeeper;
 
 import cn.hutool.core.io.resource.ResourceUtil;
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.I0Itec.zkclient.ZkClient;
 import org.I0Itec.zkclient.exception.ZkMarshallingError;
@@ -72,7 +72,7 @@ public class ZkNodeWithXmlSpringbootTest extends BaseTest {
     
     @Test
     public void testZkNodeWithXml() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
     }
     

+ 2 - 2
liteflow-testcase-declare-component/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlSpringbootTest.java

@@ -2,8 +2,8 @@ package com.yomahub.liteflow.test.zookeeper;
 
 import cn.hutool.core.io.resource.ResourceUtil;
 import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.I0Itec.zkclient.ZkClient;
 import org.I0Itec.zkclient.exception.ZkMarshallingError;
@@ -72,7 +72,7 @@ public class ZkNodeWithYmlSpringbootTest extends BaseTest {
     
     @Test
     public void testZkNodeWithYml() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
     }
     

+ 2 - 2
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathTest.java

@@ -2,9 +2,9 @@ package com.yomahub.liteflow.test.absoluteConfigPath;
 
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -28,7 +28,7 @@ public class AbsoluteConfigPathTest extends BaseTest {
 
     @Test
     public void testAbsoluteConfig() throws Exception{
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
     }
 }

+ 15 - 15
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeTest.java

@@ -3,9 +3,9 @@ package com.yomahub.liteflow.test.asyncNode;
 import cn.hutool.core.collection.ListUtil;
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import com.yomahub.liteflow.test.asyncNode.exception.TestException;
 import org.junit.Assert;
@@ -36,7 +36,7 @@ public class AsyncNodeTest extends BaseTest {
      * **/
     @Test
     public void testAsyncFlow1() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "it's a base request");
         Assert.assertTrue(response.isSuccess());
         System.out.println(response.getSlot().getExecuteStepStr());
     }
@@ -44,7 +44,7 @@ public class AsyncNodeTest extends BaseTest {
     //这个和test1有点类似,只不过进一步验证了步骤
     @Test
     public void testAsyncFlow2() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "it's a base request");
+        LiteflowResponse<DefaultContext> 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"
@@ -54,7 +54,7 @@ public class AsyncNodeTest extends BaseTest {
     //测试errorResume,默认的errorResume为false,这里测试默认的
     @Test
     public void testAsyncFlow3_1() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3-1", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3-1", "it's a base request");
         Assert.assertFalse(response.isSuccess());
         Assert.assertEquals(response.getSlot().getException().getClass(), TestException.class);
     }
@@ -62,18 +62,18 @@ public class AsyncNodeTest extends BaseTest {
     //测试errorResume,默认的errorResume为false,这里设置为true
     @Test
     public void testAsyncFlow3_2() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3-2", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3-2", "it's a base request");
         Assert.assertTrue(response.isSuccess());
     }
 
     //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了不抛错
     @Test
     public void testAsyncFlow4() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain4", "it's a base request");
         //因为不记录错误,所以最终结果是true
         Assert.assertTrue(response.isSuccess());
         //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下
-        Integer count = response.getSlot().getData("count");
+        Integer count = response.getContextBean().getData("count");
         Assert.assertEquals(new Integer(2), count);
         //因为配置了不抛错,所以response里的cause应该为null
         Assert.assertNull(response.getCause());
@@ -82,11 +82,11 @@ public class AsyncNodeTest extends BaseTest {
     //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了会抛错
     @Test
     public void testAsyncFlow5() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain5", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain5", "it's a base request");
         //整个并行组是报错的,所以最终结果是false
         Assert.assertFalse(response.isSuccess());
         //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下
-        Integer count = response.getSlot().getData("count");
+        Integer count = response.getContextBean().getData("count");
         Assert.assertEquals(new Integer(2), count);
         //因为第一个when配置了会报错,所以response里的cause里应该会有TestException
         Assert.assertEquals(TestException.class, response.getCause().getClass());
@@ -95,11 +95,11 @@ public class AsyncNodeTest extends BaseTest {
     //不同group的并行组,不会合并,第一个when的errorResume是false,会抛错,那第二个when就不会执行
     @Test
     public void testAsyncFlow6() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain6", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain6", "it's a base request");
         //第一个when会抛错,所以最终结果是false
         Assert.assertFalse(response.isSuccess());
         //因为是不同组并行组,第一组的when里的i就抛错了,所以i就执行了1遍
-        Integer count = response.getSlot().getData("count");
+        Integer count = response.getContextBean().getData("count");
         Assert.assertEquals(new Integer(1), count);
         //第一个when会报错,所以最终response的cause里应该会有TestException
         Assert.assertEquals(TestException.class, response.getCause().getClass());
@@ -108,11 +108,11 @@ public class AsyncNodeTest extends BaseTest {
     //不同group的并行组,不会合并,第一个when的errorResume是true,不会报错,那第二个when还会继续执行,但是第二个when的errorResume是false,所以第二个when会报错
     @Test
     public void testAsyncFlow7() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain7", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain7", "it's a base request");
         //第二个when会抛错,所以最终结果是false
         Assert.assertFalse(response.isSuccess());
         //  传递了slotIndex,则set的size==2
-        Integer count = response.getSlot().getData("count");
+        Integer count = response.getContextBean().getData("count");
         Assert.assertEquals(new Integer(2), count);
         //第一个when会报错,所以最终response的cause里应该会有TestException
         Assert.assertEquals(TestException.class, response.getCause().getClass());
@@ -124,8 +124,8 @@ public class AsyncNodeTest extends BaseTest {
     //这里要注意的是,由于step是先加入,所以step的打印顺序并不是这样的。但是实际执行是正确的
     @Test
     public void testAsyncFlow8() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain8", "it's a base request");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain8", "it's a base request");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertTrue(response.getSlot().getData("check").toString().startsWith("habc"));
+        Assert.assertTrue(response.getContextBean().getData("check").toString().startsWith("habc"));
     }
 }

+ 6 - 5
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java

@@ -1,20 +1,21 @@
 package com.yomahub.liteflow.test.asyncNode.cmp;
 
 import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 
 
 public class ACmp extends NodeComponent {
     @Override
     public void process() {
-        Slot slot = this.getSlot();
+        DefaultContext context = this.getContextBean();
         synchronized (NodeComponent.class){
-            if (slot.hasData("check")){
-                String str = slot.getData("check");
+            if (context.hasData("check")){
+                String str = context.getData("check");
                 str += this.getNodeId();
-                slot.setData("check", str);
+                context.setData("check", str);
             }else{
-                slot.setData("check", this.getNodeId());
+                context.setData("check", this.getNodeId());
             }
         }
         System.out.println("Acomp executed!");

+ 6 - 5
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java

@@ -1,20 +1,21 @@
 package com.yomahub.liteflow.test.asyncNode.cmp;
 
 import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 
 
 public class BCmp extends NodeComponent {
     @Override
     public void process() {
-        Slot slot = this.getSlot();
+        DefaultContext context = this.getContextBean();
         synchronized (NodeComponent.class){
-            if (slot.hasData("check")){
-                String str = slot.getData("check");
+            if (context.hasData("check")){
+                String str = context.getData("check");
                 str += this.getNodeId();
-                slot.setData("check", str);
+                context.setData("check", str);
             }else{
-                slot.setData("check", this.getNodeId());
+                context.setData("check", this.getNodeId());
             }
         }
         System.out.println("Bcomp executed!");

+ 6 - 5
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java

@@ -1,20 +1,21 @@
 package com.yomahub.liteflow.test.asyncNode.cmp;
 
 import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 
 
 public class CCmp extends NodeComponent {
     @Override
     public void process() throws Exception {
-        Slot slot = this.getSlot();
+        DefaultContext context = this.getContextBean();
         synchronized (NodeComponent.class){
-            if (slot.hasData("check")){
-                String str = slot.getData("check");
+            if (context.hasData("check")){
+                String str = context.getData("check");
                 str += this.getNodeId();
-                slot.setData("check", str);
+                context.setData("check", str);
             }else{
-                slot.setData("check", this.getNodeId());
+                context.setData("check", this.getNodeId());
             }
         }
         System.out.println("Ccomp executed!");

+ 6 - 5
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java

@@ -1,6 +1,7 @@
 package com.yomahub.liteflow.test.asyncNode.cmp;
 
 import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 
 
@@ -8,14 +9,14 @@ public class DCmp extends NodeComponent {
     @Override
     public void process() throws Exception {
         Thread.sleep(1000);
-        Slot slot = this.getSlot();
+        DefaultContext context = this.getContextBean();
         synchronized (NodeComponent.class){
-            if (slot.hasData("check")){
-                String str = slot.getData("check");
+            if (context.hasData("check")){
+                String str = context.getData("check");
                 str += this.getNodeId();
-                slot.setData("check", str);
+                context.setData("check", str);
             }else{
-                slot.setData("check", this.getNodeId());
+                context.setData("check", this.getNodeId());
             }
         }
         System.out.println("Dcomp executed!");

+ 6 - 5
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java

@@ -1,6 +1,7 @@
 package com.yomahub.liteflow.test.asyncNode.cmp;
 
 import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 
 
@@ -9,14 +10,14 @@ public class GCmp extends NodeComponent {
     @Override
     public void process() throws Exception {
         Thread.sleep(500);
-        Slot slot = this.getSlot();
+        DefaultContext context = this.getContextBean();
         synchronized (NodeComponent.class){
-            if (slot.hasData("check")){
-                String str = slot.getData("check");
+            if (context.hasData("check")){
+                String str = context.getData("check");
                 str += this.getNodeId();
-                slot.setData("check", str);
+                context.setData("check", str);
             }else{
-                slot.setData("check", this.getNodeId());
+                context.setData("check", this.getNodeId());
             }
         }
         System.out.println("Gcomp executed!");

+ 6 - 5
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java

@@ -1,6 +1,7 @@
 package com.yomahub.liteflow.test.asyncNode.cmp;
 
 import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 
 
@@ -8,14 +9,14 @@ public class HCmp extends NodeComponent {
 
     @Override
     public void process() throws Exception {
-        Slot slot = this.getSlot();
+        DefaultContext context = this.getContextBean();
         synchronized (NodeComponent.class){
-            if (slot.hasData("check")){
-                String str = slot.getData("check");
+            if (context.hasData("check")){
+                String str = context.getData("check");
                 str += this.getNodeId();
-                slot.setData("check", str);
+                context.setData("check", str);
             }else{
-                slot.setData("check", this.getNodeId());
+                context.setData("check", this.getNodeId());
             }
         }
 

+ 6 - 5
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java

@@ -1,6 +1,7 @@
 package com.yomahub.liteflow.test.asyncNode.cmp;
 
 import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.slot.Slot;
 import com.yomahub.liteflow.test.asyncNode.exception.TestException;
 
@@ -9,12 +10,12 @@ public class ICmp extends NodeComponent {
 
     @Override
     public void process() throws Exception {
-        Slot slot = this.getSlot();
-        if (slot.hasData("count")) {
-            Integer count = slot.getData("count");
-            slot.setData("count", ++count);
+        DefaultContext context = this.getContextBean();
+        if (context.hasData("count")) {
+            Integer count = context.getData("count");
+            context.setData("count", ++count);
         } else {
-            slot.setData("count", 1);
+            context.setData("count", 1);
         }
         System.out.println("Icomp executed! throw Exception!");
         throw new TestException();

+ 2 - 2
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/BaseCommonTest.java

@@ -2,9 +2,9 @@ package com.yomahub.liteflow.test.base;
 
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -23,7 +23,7 @@ public class BaseCommonTest extends BaseTest{
 
     @Test
     public void testBase(){
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "test0");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "test0");
         Assert.assertTrue(response.isSuccess());
     }
 }

+ 4 - 4
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/BuilderTest.java

@@ -5,11 +5,11 @@ import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
 import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.builder.entity.ExecutableEntity;
 import com.yomahub.liteflow.enums.NodeTypeEnum;
 import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import com.yomahub.liteflow.test.builder.cmp.ACmp;
 import com.yomahub.liteflow.test.builder.cmp.BCmp;
@@ -85,7 +85,7 @@ public class BuilderTest extends BaseTest {
                         .setValue("e(f|g|chain2)").build()
         ).build();
 
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getSlot().getExecuteStepStr());
     }
@@ -142,7 +142,7 @@ public class BuilderTest extends BaseTest {
                         .setValue("e(f|g|chain2)").build()
         ).build();
 
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getSlot().getExecuteStepStr());
     }
@@ -210,7 +210,7 @@ public class BuilderTest extends BaseTest {
                                         )).build()
         ).build();
 
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getSlot().getExecuteStepStr());
     }

+ 5 - 5
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetryTest.java

@@ -2,9 +2,9 @@ package com.yomahub.liteflow.test.cmpRetry;
 
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -32,7 +32,7 @@ public class LiteflowRetryTest extends BaseTest {
     //全局重试配置测试
     @Test
     public void testRetry1() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("a==>b==>b==>b", response.getSlot().getExecuteStepStr());
     }
@@ -40,7 +40,7 @@ public class LiteflowRetryTest extends BaseTest {
     //单个组件重试配置测试
     @Test
     public void testRetry2() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain2", "arg");
         Assert.assertFalse(response.isSuccess());
         Assert.assertEquals("c==>c==>c==>c==>c==>c", response.getSlot().getExecuteStepStr());
     }
@@ -48,14 +48,14 @@ public class LiteflowRetryTest extends BaseTest {
     //单个组件指定异常,但抛出的并不是指定异常的场景测试
     @Test
     public void testRetry3() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3", "arg");
         Assert.assertFalse(response.isSuccess());
     }
 
     //单个组件指定异常重试,抛出的是指定异常或者
     @Test
     public void testRetry4() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain4", "arg");
         Assert.assertFalse(response.isSuccess());
         Assert.assertEquals("e==>e==>e==>e==>e==>e", response.getSlot().getExecuteStepStr());
     }

+ 8 - 8
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorTest.java

@@ -2,9 +2,9 @@ package com.yomahub.liteflow.test.component;
 
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -30,7 +30,7 @@ public class FlowExecutorTest extends BaseTest {
     //isAccess方法的功能测试
     @Test
     public void testIsAccess() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", 101);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", 101);
         Assert.assertTrue(response.isSuccess());
         Assert.assertNotNull(response.getSlot().getResponseData());
     }
@@ -38,7 +38,7 @@ public class FlowExecutorTest extends BaseTest {
     //组件抛错的功能点测试
     @Test(expected = ArithmeticException.class)
     public void testComponentException() throws Throwable {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", 0);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain2", 0);
         Assert.assertFalse(response.isSuccess());
         Assert.assertEquals("/ by zero", response.getMessage());
         throw response.getCause();
@@ -47,7 +47,7 @@ public class FlowExecutorTest extends BaseTest {
     //isContinueOnError方法的功能点测试
     @Test
     public void testIsContinueOnError() throws Throwable {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3", 0);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain3", 0);
         Assert.assertTrue(response.isSuccess());
         Assert.assertNull(response.getCause());
     }
@@ -55,7 +55,7 @@ public class FlowExecutorTest extends BaseTest {
     //isEnd方法的功能点测试
     @Test
     public void testIsEnd() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", 10);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain4", 10);
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("d",response.getSlot().getExecuteStepStr());
     }
@@ -63,7 +63,7 @@ public class FlowExecutorTest extends BaseTest {
     //setIsEnd方法的功能点测试
     @Test
     public void testSetIsEnd1() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain5", 10);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain5", 10);
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("e",response.getSlot().getExecuteStepStr());
     }
@@ -71,14 +71,14 @@ public class FlowExecutorTest extends BaseTest {
     //条件组件的功能点测试
     @Test
     public void testNodeCondComponent() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain6", 0);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain6", 0);
         Assert.assertTrue(response.isSuccess());
     }
 
     //测试setIsEnd如果为true,continueError也为true,那不应该continue了
     @Test
     public void testSetIsEnd2() throws Exception {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain7", 10);
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain7", 10);
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("g",response.getSlot().getExecuteStepStr());
     }

+ 2 - 2
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigTest1.java

@@ -2,10 +2,10 @@ package com.yomahub.liteflow.test.config;
 
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.property.LiteflowConfig;
 import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -30,7 +30,7 @@ public class LiteflowConfigTest1 extends BaseTest {
     @Test
     public void testConfig() {
         LiteflowConfig config = LiteflowConfigGetter.get();
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response.isSuccess());
         Assert.assertEquals("config/flow.xml", config.getRuleSource());
         Assert.assertEquals(15, config.getWhenMaxWaitSeconds().intValue());

+ 7 - 7
liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolTest.java

@@ -2,9 +2,9 @@ package com.yomahub.liteflow.test.customWhenThreadPool;
 
 import com.yomahub.liteflow.core.FlowExecutor;
 import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.slot.DefaultSlot;
 import com.yomahub.liteflow.flow.LiteflowResponse;
 import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.slot.DefaultContext;
 import com.yomahub.liteflow.test.BaseTest;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -32,9 +32,9 @@ public class CustomWhenThreadPoolTest extends BaseTest {
      */
     @Test
     public void testGlobalThreadPool() {
-        LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain", "arg");
+        LiteflowResponse<DefaultContext> response = flowExecutor.execute2Resp("chain", "arg");
         Assert.assertTrue(response.isSuccess());
-        Assert.assertTrue(response.getSlot().getData("threadName").toString().startsWith("lf-when-thead"));
+        Assert.assertTrue(response.getContextBean().getData("threadName").toString().startsWith("lf-when-thead"));
     }
 
     /**
@@ -42,9 +42,9 @@ public class CustomWhenThreadPoolTest extends BaseTest {
      */
     @Test
     public void testGlobalAndCustomWhenThreadPool() {
-        LiteflowResponse<DefaultSlot> response1 = flowExecutor.execute2Resp("chain1", "arg");
+        LiteflowResponse<DefaultContext> response1 = flowExecutor.execute2Resp("chain1", "arg");
         Assert.assertTrue(response1.isSuccess());
-        Assert.assertTrue(response1.getSlot().getData("threadName").toString().startsWith("customer-when-1-thead"));
+        Assert.assertTrue(response1.getContextBean().getData("threadName").toString().startsWith("customer-when-1-thead"));
     }
 
 
@@ -56,9 +56,9 @@ public class CustomWhenThreadPoolTest extends BaseTest {
         // 使用when - thread1
         testGlobalAndCustomWhenThreadPool();
         // chain配置同一个thead1
-        LiteflowResponse<DefaultSlot> response2 = flowExecutor.execute2Resp("chain2", "arg");
+        LiteflowResponse<DefaultContext> response2 = flowExecutor.execute2Resp("chain2", "arg");
         Assert.assertTrue(response2.isSuccess());
-        Assert.assertTrue(response2.getSlot().getData("threadName").toString().startsWith("customer-when-1-thead"));
+        Assert.assertTrue(response2.getContextBean().getData("threadName").toString().startsWith("customer-when-1-thead"));
 
     }
 }

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff