bryan.zhang пре 5 година
родитељ
комит
05ad325783
92 измењених фајлова са 679 додато и 618 уклоњено
  1. 13 13
      docs/guide_cn.md
  2. 11 6
      liteflow-core/pom.xml
  3. 16 19
      liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java
  4. 13 9
      liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java
  5. 2 2
      liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeCondComponent.java
  6. 4 4
      liteflow-core/src/main/java/com/yomahub/liteflow/entity/config/Chain.java
  7. 3 3
      liteflow-core/src/main/java/com/yomahub/liteflow/entity/config/Condition.java
  8. 11 11
      liteflow-core/src/main/java/com/yomahub/liteflow/entity/config/Node.java
  9. 1 1
      liteflow-core/src/main/java/com/yomahub/liteflow/entity/config/ThenCondition.java
  10. 1 1
      liteflow-core/src/main/java/com/yomahub/liteflow/entity/config/WhenCondition.java
  11. 32 34
      liteflow-core/src/main/java/com/yomahub/liteflow/entity/data/AbsSlot.java
  12. 7 7
      liteflow-core/src/main/java/com/yomahub/liteflow/entity/data/CmpStep.java
  13. 1 1
      liteflow-core/src/main/java/com/yomahub/liteflow/entity/data/CmpStepType.java
  14. 8 8
      liteflow-core/src/main/java/com/yomahub/liteflow/entity/data/DataBus.java
  15. 1 1
      liteflow-core/src/main/java/com/yomahub/liteflow/entity/data/DefaultSlot.java
  16. 20 20
      liteflow-core/src/main/java/com/yomahub/liteflow/entity/data/Slot.java
  17. 4 4
      liteflow-core/src/main/java/com/yomahub/liteflow/entity/monitor/CompStatistics.java
  18. 2 2
      liteflow-core/src/main/java/com/yomahub/liteflow/exception/ChainNotFoundException.java
  19. 2 2
      liteflow-core/src/main/java/com/yomahub/liteflow/exception/ComponentNotAccessException.java
  20. 2 2
      liteflow-core/src/main/java/com/yomahub/liteflow/exception/FlowExecutorNotInitException.java
  21. 2 2
      liteflow-core/src/main/java/com/yomahub/liteflow/exception/FlowSystemException.java
  22. 2 2
      liteflow-core/src/main/java/com/yomahub/liteflow/exception/NoAvailableSlotException.java
  23. 2 2
      liteflow-core/src/main/java/com/yomahub/liteflow/exception/ParseException.java
  24. 3 3
      liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java
  25. 4 5
      liteflow-core/src/main/java/com/yomahub/liteflow/monitor/MonitorBus.java
  26. 2 2
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassXmlFlowParser.java
  27. 3 3
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalXmlFlowParser.java
  28. 3 3
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/RegexEntity.java
  29. 10 10
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/XmlFlowParser.java
  30. 13 13
      liteflow-core/src/main/java/com/yomahub/liteflow/parser/ZookeeperXmlFlowParser.java
  31. 3 4
      liteflow-core/src/main/java/com/yomahub/liteflow/spring/ComponentScaner.java
  32. 4 4
      liteflow-core/src/main/java/com/yomahub/liteflow/util/Dom4JReader.java
  33. 2 2
      liteflow-core/src/main/java/com/yomahub/liteflow/util/IOUtil.java
  34. 3 3
      liteflow-core/src/main/java/com/yomahub/liteflow/util/LOGOPrinter.java
  35. 4 7
      liteflow-core/src/main/java/com/yomahub/liteflow/util/LimitQueue.java
  36. 0 30
      liteflow-core/src/test/java/com/thebeastshop/liteflow/test/TestMain.java
  37. 0 60
      liteflow-core/src/test/java/com/thebeastshop/liteflow/test/TestWithSpringMain.java
  38. 0 37
      liteflow-core/src/test/resources/config/flow.xml
  39. 0 28
      liteflow-core/src/test/resources/log4j.xml
  40. 0 40
      liteflow-core/src/test/resources/spring-test.xml
  41. 8 6
      liteflow-spring-boot-starter/pom.xml
  42. 3 3
      liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowAutoConfiguration.java
  43. 2 2
      liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowExecutorInit.java
  44. 1 1
      liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java
  45. 3 3
      liteflow-spring-boot-starter/src/main/resources/META-INF/spring.factories
  46. 63 0
      liteflow-test-spring/pom.xml
  47. 22 0
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/Runner.java
  48. 2 2
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/AComponent.java
  49. 2 2
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/BComponent.java
  50. 2 2
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/CComponent.java
  51. 3 3
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/CondComponent.java
  52. 3 3
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/DComponent.java
  53. 2 2
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/EComponent.java
  54. 2 2
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/FComponent.java
  55. 2 2
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/GComponent.java
  56. 4 4
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/HComponent.java
  57. 3 3
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/M1Component.java
  58. 3 3
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/M2Component.java
  59. 4 4
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/M3Component.java
  60. 4 4
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/MComponent.java
  61. 3 3
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/P1Component.java
  62. 3 3
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/P2Component.java
  63. 4 4
      liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/PComponent.java
  64. 22 0
      liteflow-test-spring/src/main/resources/applicationContext.xml
  65. 8 8
      liteflow-test-spring/src/main/resources/config/flow.xml
  66. 47 0
      liteflow-test-spring/src/main/resources/logback.xml
  67. 21 13
      liteflow-test-springboot/pom.xml
  68. 1 1
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/FlowtestApplication.java
  69. 4 4
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/TestFlow.java
  70. 4 5
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/AComponent.java
  71. 4 5
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/BComponent.java
  72. 4 5
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/CComponent.java
  73. 3 4
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/CondComponent.java
  74. 6 7
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/DComponent.java
  75. 4 5
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/EComponent.java
  76. 4 5
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/FComponent.java
  77. 3 4
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/GComponent.java
  78. 5 8
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/HComponent.java
  79. 6 7
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/M1Component.java
  80. 6 7
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/M2Component.java
  81. 5 8
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/M3Component.java
  82. 8 9
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/MComponent.java
  83. 6 7
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/P1Component.java
  84. 6 7
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/P2Component.java
  85. 8 9
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/PComponent.java
  86. 1 1
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/curator/CuratorTest.java
  87. 1 1
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/curator/CuratorTest2.java
  88. 1 1
      liteflow-test-springboot/src/main/java/com/yomahub/flowtest/regex/RegexTest.java
  89. 0 0
      liteflow-test-springboot/src/main/resources/application.properties
  90. 38 0
      liteflow-test-springboot/src/main/resources/config/flow.xml
  91. 1 1
      liteflow-test-springboot/src/test/java/com/yomahub/flowtest/FlowtestApplicationTests.java
  92. 90 15
      pom.xml

+ 13 - 13
docs/guide_cn.md

@@ -4,7 +4,7 @@ liteflow需要你的项目使用maven
 ## 1.1依赖
 ```xml
 <dependency>
-	<groupId>com.thebeastshop.liteflow</groupId>
+	<groupId>com.yomahub.liteflow</groupId>
 	<artifactId>liteflow</artifactId>
 	<version>${liteFlow.version}</version>
 </dependency>
@@ -19,11 +19,11 @@ liteflow需要你的项目使用maven
 <?xml version="1.0" encoding="UTF-8"?>
 <flow>
 	<nodes>
-		<node id="a" class="com.thebeastshop.liteflow.test.component.AComponent"/>
-		<node id="b" class="com.thebeastshop.liteflow.test.component.BComponent"/>
-		<node id="c" class="com.thebeastshop.liteflow.test.component.CComponent"/>
-		<node id="d" class="com.thebeastshop.liteflow.test.component.DComponent"/>
-		<node id="e" class="com.thebeastshop.liteflow.test.component.EComponent"/>
+		<node id="a" class="com.yomahub.liteflow.test.component.AComponent"/>
+		<node id="b" class="com.yomahub.liteflow.test.component.BComponent"/>
+		<node id="c" class="com.yomahub.liteflow.test.component.CComponent"/>
+		<node id="d" class="com.yomahub.liteflow.test.component.DComponent"/>
+		<node id="e" class="com.yomahub.liteflow.test.component.EComponent"/>
 	</nodes>
 	
 	<chain name="demoChain">
@@ -74,8 +74,8 @@ Slot slot = executor.execute("demoChain", "arg");
 ## 2.1流程配置可以省略的部分
 流程配置中的`nodes`节点,可以不用配置了,支持spring的自动扫描方式。你需要在你的spring配置文件中定义
 ```xml
-<context:component-scan base-package="com.thebeastshop.liteflow.test.component" />
-<bean class="com.thebeastshop.liteflow.spring.ComponentScaner"/>
+<context:component-scan base-package="com.yomahub.liteflow.test.component" />
+<bean class="ComponentScaner"/>
 ```
 
 当然,你的组件节点也需要注册进spirng容器
@@ -93,7 +93,7 @@ public class AComponent extends NodeComponent
 
 ## 2.2spring中执行器的配置
 ```xml
-<bean id="flowExecutor" class="com.thebeastshop.liteflow.core.FlowExecutor">
+<bean id="flowExecutor" class="FlowExecutor">
 	<property name="rulePath">
 		<list>
 			<value>/config/flow.xml</value>
@@ -111,7 +111,7 @@ liteFlow提供了liteflow-spring-boot-starter依赖包
 
 ```xml
 <dependency>
-  <groupId>com.thebeastshop</groupId>
+  <groupId>com.yomahub</groupId>
   <artifactId>liteflow-spring-boot-starter</artifactId>
   <version>2.1.0</version>
 </dependency>
@@ -138,7 +138,7 @@ liteFlow支持把配置放在zk集群中,并支持实时修改流程
 
 ```xml
 <!-- 这种是zk方式配置 -->
-<bean id="flowExecutor" class="com.thebeastshop.liteflow.core.FlowExecutor">
+<bean id="flowExecutor" class="FlowExecutor">
 	<property name="rulePath">
 		<list>
 			<value>127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183</value>
@@ -175,10 +175,10 @@ public class TestCustomParser extends ClassXmlFlowParser {
 
 spring中需要改的地方还是执行器的配置,只需要在配置的路径地方放入自定义类的类路径即可  
 ```xml
-<bean id="flowExecutor" class="com.thebeastshop.liteflow.core.FlowExecutor">
+<bean id="flowExecutor" class="FlowExecutor">
 	<property name="rulePath">
 		<list>
-			<value>com.thebeastshop.liteflow.test.TestCustomParser</value>
+			<value>com.yomahub.liteflow.test.TestCustomParser</value>
 		</list>
 	</property>
 </bean>

+ 11 - 6
liteflow-core/pom.xml

@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<groupId>com.thebeastshop</groupId>
-    <artifactId>liteflow-core</artifactId>
-    <packaging>jar</packaging>
-    <modelVersion>4.0.0</modelVersion>
+	<modelVersion>4.0.0</modelVersion>
+	<packaging>jar</packaging>
+	<artifactId>liteflow-core</artifactId>
+	<description>liteflow core</description>
 
     <parent>
-		<groupId>com.thebeastshop</groupId>
+		<groupId>com.yomahub</groupId>
 		<artifactId>liteflow</artifactId>
-		<version>2.1.3</version>
+		<version>2.2.0-SNAPSHOT</version>
 	</parent>
 
 	<dependencies>
@@ -28,22 +28,27 @@
         <dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring-beans</artifactId>
+			<optional>true</optional>
 		</dependency>
 		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring-context</artifactId>
+			<optional>true</optional>
 		</dependency>
 		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring-aop</artifactId>
+			<optional>true</optional>
 		</dependency>
 		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring-expression</artifactId>
+            <optional>true</optional>
 		</dependency>
 		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring-test</artifactId>
+			<optional>true</optional>
 		</dependency>
 		<dependency>
 			<groupId>org.slf4j</groupId>

+ 16 - 19
liteflow-core/src/main/java/com/thebeastshop/liteflow/core/FlowExecutor.java → liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java

@@ -7,7 +7,7 @@
  * @Date 2017-7-31
  * @version 1.0
  */
-package com.thebeastshop.liteflow.core;
+package com.yomahub.liteflow.core;
 
 import java.text.MessageFormat;
 import java.util.List;
@@ -20,24 +20,21 @@ import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.thebeastshop.liteflow.entity.config.Chain;
-import com.thebeastshop.liteflow.entity.config.Condition;
-import com.thebeastshop.liteflow.entity.config.Node;
-import com.thebeastshop.liteflow.entity.config.ThenCondition;
-import com.thebeastshop.liteflow.entity.config.WhenCondition;
-import com.thebeastshop.liteflow.entity.data.DataBus;
-import com.thebeastshop.liteflow.entity.data.DefaultSlot;
-import com.thebeastshop.liteflow.entity.data.Slot;
-import com.thebeastshop.liteflow.exception.ChainNotFoundException;
-import com.thebeastshop.liteflow.exception.FlowExecutorNotInitException;
-import com.thebeastshop.liteflow.exception.FlowSystemException;
-import com.thebeastshop.liteflow.exception.NoAvailableSlotException;
-import com.thebeastshop.liteflow.exception.ParseException;
-import com.thebeastshop.liteflow.flow.FlowBus;
-import com.thebeastshop.liteflow.parser.LocalXmlFlowParser;
-import com.thebeastshop.liteflow.parser.XmlFlowParser;
-import com.thebeastshop.liteflow.parser.ZookeeperXmlFlowParser;
-import com.thebeastshop.liteflow.util.LOGOPrinter;
+import com.yomahub.liteflow.entity.config.Chain;
+import com.yomahub.liteflow.entity.config.Condition;
+import com.yomahub.liteflow.entity.config.Node;
+import com.yomahub.liteflow.entity.config.ThenCondition;
+import com.yomahub.liteflow.entity.config.WhenCondition;
+import com.yomahub.liteflow.entity.data.DataBus;
+import com.yomahub.liteflow.entity.data.DefaultSlot;
+import com.yomahub.liteflow.entity.data.Slot;
+import com.yomahub.liteflow.exception.ChainNotFoundException;
+import com.yomahub.liteflow.exception.FlowExecutorNotInitException;
+import com.yomahub.liteflow.exception.NoAvailableSlotException;
+import com.yomahub.liteflow.flow.FlowBus;
+import com.yomahub.liteflow.parser.LocalXmlFlowParser;
+import com.yomahub.liteflow.parser.XmlFlowParser;
+import com.yomahub.liteflow.parser.ZookeeperXmlFlowParser;
 
 public class FlowExecutor {
 

+ 13 - 9
liteflow-core/src/main/java/com/thebeastshop/liteflow/core/NodeComponent.java → liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java

@@ -7,21 +7,21 @@
  * @Date 2017-7-28
  * @version 1.0
  */
-package com.thebeastshop.liteflow.core;
+package com.yomahub.liteflow.core;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.time.StopWatch;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.thebeastshop.liteflow.entity.config.Node;
-import com.thebeastshop.liteflow.entity.data.CmpStep;
-import com.thebeastshop.liteflow.entity.data.CmpStepType;
-import com.thebeastshop.liteflow.entity.data.DataBus;
-import com.thebeastshop.liteflow.entity.data.Slot;
-import com.thebeastshop.liteflow.entity.monitor.CompStatistics;
-import com.thebeastshop.liteflow.flow.FlowBus;
-import com.thebeastshop.liteflow.monitor.MonitorBus;
+import com.yomahub.liteflow.entity.config.Node;
+import com.yomahub.liteflow.entity.data.CmpStep;
+import com.yomahub.liteflow.entity.data.CmpStepType;
+import com.yomahub.liteflow.entity.data.DataBus;
+import com.yomahub.liteflow.entity.data.Slot;
+import com.yomahub.liteflow.entity.monitor.CompStatistics;
+import com.yomahub.liteflow.flow.FlowBus;
+import com.yomahub.liteflow.monitor.MonitorBus;
 
 public abstract class NodeComponent {
 
@@ -74,6 +74,7 @@ public abstract class NodeComponent {
 
 	/**
 	 * 是否进入该节点
+	 * @return boolean
 	 */
 	protected boolean isAccess(){
 		return true;
@@ -81,6 +82,7 @@ public abstract class NodeComponent {
 
 	/**
 	 * 出错是否继续执行
+	 * @return boolean
 	 */
 	protected boolean isContinueOnError() {
 		return false;
@@ -88,6 +90,7 @@ public abstract class NodeComponent {
 
 	/**
 	 * 是否结束整个流程(不往下继续执行)
+	 * @return boolean
 	 */
 	protected boolean isEnd() {
 		Boolean isEnd = isEndTL.get();
@@ -100,6 +103,7 @@ public abstract class NodeComponent {
 
 	/**
 	 * 设置是否结束整个流程
+	 * @param isEnd
 	 */
 	protected void setIsEnd(boolean isEnd){
 		this.isEndTL.set(isEnd);

+ 2 - 2
liteflow-core/src/main/java/com/thebeastshop/liteflow/core/NodeCondComponent.java → liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeCondComponent.java

@@ -7,7 +7,7 @@
  * @Date 2017-7-28
  * @version 1.0
  */
-package com.thebeastshop.liteflow.core;
+package com.yomahub.liteflow.core;
 
 import org.springframework.stereotype.Component;
 
@@ -20,7 +20,7 @@ public abstract class NodeCondComponent extends NodeComponent {
 		String nodeId = component.value();
 		this.getSlot().setCondResult(this.getClass().getName(), nodeId);
 	}
-	
+
 	protected abstract Class<? extends NodeComponent> processCond() throws Exception;
 
 }

+ 4 - 4
liteflow-core/src/main/java/com/thebeastshop/liteflow/entity/config/Chain.java → liteflow-core/src/main/java/com/yomahub/liteflow/entity/config/Chain.java

@@ -7,16 +7,16 @@
  * @Date 2017-7-28
  * @version 1.0
  */
-package com.thebeastshop.liteflow.entity.config;
+package com.yomahub.liteflow.entity.config;
 
 import java.util.List;
 
 public class Chain {
-	
+
 	private String chainName;
-	
+
 	private List<Condition> conditionList;
-	
+
 	public Chain(String chainName, List<Condition> conditionList) {
 		this.chainName = chainName;
 		this.conditionList = conditionList;

+ 3 - 3
liteflow-core/src/main/java/com/thebeastshop/liteflow/entity/config/Condition.java → liteflow-core/src/main/java/com/yomahub/liteflow/entity/config/Condition.java

@@ -7,14 +7,14 @@
  * @Date 2017-7-28
  * @version 1.0
  */
-package com.thebeastshop.liteflow.entity.config;
+package com.yomahub.liteflow.entity.config;
 
 import java.util.List;
 
 public class Condition {
-	
+
 	private List<Node> nodeList;
-	
+
 	public Condition(List<Node> nodeList) {
 		this.nodeList = nodeList;
 	}

+ 11 - 11
liteflow-core/src/main/java/com/thebeastshop/liteflow/entity/config/Node.java → liteflow-core/src/main/java/com/yomahub/liteflow/entity/config/Node.java

@@ -7,27 +7,27 @@
  * @Date 2017-7-28
  * @version 1.0
  */
-package com.thebeastshop.liteflow.entity.config;
+package com.yomahub.liteflow.entity.config;
 
 import java.util.HashMap;
 import java.util.Map;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeComponent;
 
 public class Node {
-	
+
 	private String id;
-	
+
 	private String clazz;
-	
+
 	private NodeComponent instance;
-	
+
 	private Map<String, Node> condNodeMap = new HashMap<String, Node>();
-	
+
 	public Node(){
-		
+
 	}
-	
+
 	public Node(String id, String clazz, NodeComponent instance) {
 		this.id = id;
 		this.clazz = clazz;
@@ -57,11 +57,11 @@ public class Node {
 	public void setInstance(NodeComponent instance) {
 		this.instance = instance;
 	}
-	
+
 	public Node getCondNode(String nodeId){
 		return this.condNodeMap.get(nodeId);
 	}
-	
+
 	public void setCondNode(String nodeId, Node condNode){
 		this.condNodeMap.put(nodeId, condNode);
 	}

+ 1 - 1
liteflow-core/src/main/java/com/thebeastshop/liteflow/entity/config/ThenCondition.java → liteflow-core/src/main/java/com/yomahub/liteflow/entity/config/ThenCondition.java

@@ -7,7 +7,7 @@
  * @Date 2017-7-28
  * @version 1.0
  */
-package com.thebeastshop.liteflow.entity.config;
+package com.yomahub.liteflow.entity.config;
 
 import java.util.List;
 

+ 1 - 1
liteflow-core/src/main/java/com/thebeastshop/liteflow/entity/config/WhenCondition.java → liteflow-core/src/main/java/com/yomahub/liteflow/entity/config/WhenCondition.java

@@ -7,7 +7,7 @@
  * @Date 2017-7-28
  * @version 1.0
  */
-package com.thebeastshop.liteflow.entity.config;
+package com.yomahub.liteflow.entity.config;
 
 import java.util.List;
 

+ 32 - 34
liteflow-core/src/main/java/com/thebeastshop/liteflow/entity/data/AbsSlot.java → liteflow-core/src/main/java/com/yomahub/liteflow/entity/data/AbsSlot.java

@@ -7,13 +7,11 @@
  * @Date 2017-8-3
  * @version 1.0
  */
-package com.thebeastshop.liteflow.entity.data;
+package com.yomahub.liteflow.entity.data;
 
 import java.util.ArrayDeque;
-import java.util.ArrayList;
 import java.util.Deque;
 import java.util.Iterator;
-import java.util.List;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.slf4j.Logger;
@@ -21,93 +19,93 @@ import org.slf4j.LoggerFactory;
 
 @SuppressWarnings("unchecked")
 public abstract class AbsSlot implements Slot{
-	
+
 	private static final Logger LOG = LoggerFactory.getLogger(Slot.class);
-	
+
 	private final String REQUEST = "request";
-	
+
 	private final String RESPONSE = "response";
-	
+
 	private final String CHAINNAME = "chain_name";
-	
+
 	private final String COND_NODE_PREFIX = "cond_";
-	
+
 	private final String NODE_INPUT_PREFIX = "input_";
-	
+
 	private final String NODE_OUTPUT_PREFIX = "output_";
-	
+
 	private final String CHAIN_REQ_PREFIX = "chain_req_";
-	
+
 	private final String REQUEST_ID = "req_id";
-	
+
 	private Deque<CmpStep> executeSteps = new ArrayDeque<CmpStep>();
-	
+
 	protected ConcurrentHashMap<String, Object> dataMap = new ConcurrentHashMap<String, Object>();
-	
+
 	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){
 		dataMap.put(NODE_INPUT_PREFIX + nodeId, t);
 	}
-	
+
 	public <T> void setOutput(String nodeId,T t){
 		dataMap.put(NODE_OUTPUT_PREFIX + nodeId, t);
 	}
-	
+
 	public <T> T getRequestData(){
 		return (T)dataMap.get(REQUEST);
 	}
-	
+
 	public <T> void setRequestData(T t){
 		dataMap.put(REQUEST, t);
 	}
-	
+
 	public <T> T getResponseData(){
 		return (T)dataMap.get(RESPONSE);
 	}
-	
+
 	public <T> void setResponseData(T t){
 		dataMap.put(RESPONSE, t);
 	}
-	
+
 	public <T> T getChainReqData(String chainId) {
 		return (T)dataMap.get(CHAIN_REQ_PREFIX + chainId);
 	}
-	
+
 	public <T> void setChainReqData(String chainId, T t) {
 		dataMap.put(CHAIN_REQ_PREFIX + chainId, t);
 	}
-	
+
 	public <T> T getData(String key){
 		return (T)dataMap.get(key);
 	}
-	
+
 	public <T> void setData(String key, T t){
 		dataMap.put(key, t);
 	}
-	
+
 	public <T> void setCondResult(String key, T t){
 		dataMap.put(COND_NODE_PREFIX + key, t);
 	}
-	
+
 	public <T> T getCondResult(String key){
 		return (T)dataMap.get(COND_NODE_PREFIX + key);
 	}
-	
+
 	public void setChainName(String chainName) {
 		dataMap.put(CHAINNAME, chainName);
 	}
-	
+
 	public String getChainName() {
 		return (String)dataMap.get(CHAINNAME);
 	}
-	
+
 	public void addStep(CmpStep step){
 		CmpStep lastStep = this.executeSteps.peekLast();
 		if(lastStep != null && lastStep.equals(step)) {
@@ -116,7 +114,7 @@ public abstract class AbsSlot implements Slot{
 			this.executeSteps.add(step);
 		}
 	}
-	
+
 	public void printStep(){
 		StringBuffer str = new StringBuffer();
 		CmpStep cmpStep = null;
@@ -129,12 +127,12 @@ public abstract class AbsSlot implements Slot{
 		}
 		LOG.info("[{}]:CHAIN_NAME[{}]\n{}",getRequestId(),this.getChainName(),str.toString());
 	}
-	
+
 	@Override
 	public void generateRequestId() {
 		dataMap.put(REQUEST_ID, new Long(System.nanoTime()).toString());
 	}
-	
+
 	@Override
 	public String getRequestId() {
 		return (String)dataMap.get(REQUEST_ID);

+ 7 - 7
liteflow-core/src/main/java/com/thebeastshop/liteflow/entity/data/CmpStep.java → liteflow-core/src/main/java/com/yomahub/liteflow/entity/data/CmpStep.java

@@ -7,15 +7,15 @@
  * @Date 2017-12-8
  * @version 1.0
  */
-package com.thebeastshop.liteflow.entity.data;
+package com.yomahub.liteflow.entity.data;
 
 import java.text.MessageFormat;
 
 public class CmpStep {
 	private String nodeId;
-	
+
 	private CmpStepType stepType;
-	
+
 	public CmpStep(String nodeId, CmpStepType stepType) {
 		this.nodeId = nodeId;
 		this.stepType = stepType;
@@ -36,7 +36,7 @@ public class CmpStep {
 	public void setStepType(CmpStepType stepType) {
 		this.stepType = stepType;
 	}
-	
+
 	@Override
 	public String toString() {
 		if(stepType.equals(CmpStepType.SINGLE)) {
@@ -44,10 +44,10 @@ public class CmpStep {
 		}else {
 			return MessageFormat.format("{0}({1})", nodeId,stepType);
 		}
-		
-		
+
+
 	}
-	
+
 	@Override
 	public boolean equals(Object obj) {
 		if (obj == null) {

+ 1 - 1
liteflow-core/src/main/java/com/thebeastshop/liteflow/entity/data/CmpStepType.java → liteflow-core/src/main/java/com/yomahub/liteflow/entity/data/CmpStepType.java

@@ -7,7 +7,7 @@
  * @Date 2017-12-8
  * @version 1.0
  */
-package com.thebeastshop.liteflow.entity.data;
+package com.yomahub.liteflow.entity.data;
 
 public enum CmpStepType {
 	START,

+ 8 - 8
liteflow-core/src/main/java/com/thebeastshop/liteflow/entity/data/DataBus.java → liteflow-core/src/main/java/com/yomahub/liteflow/entity/data/DataBus.java

@@ -7,7 +7,7 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.entity.data;
+package com.yomahub.liteflow.entity.data;
 
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -15,15 +15,15 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class DataBus {
-	
+
 	private static final Logger LOG = LoggerFactory.getLogger(DataBus.class);
-	
+
 	public static final int SLOT_SIZE = 1024;
-	
+
 	public static AtomicInteger OCCUPY_COUNT = new AtomicInteger(0);
-	
+
 	private static Slot[] slots = new Slot[SLOT_SIZE];
-	
+
 	public synchronized static int offerSlot(Class<? extends Slot> slotClazz){
 		try{
 			for(int i = 0; i < slots.length; i++){
@@ -39,12 +39,12 @@ public class DataBus {
 		}
 		return -1;
 	}
-	
+
 	@SuppressWarnings("unchecked")
 	public static <T extends Slot> T getSlot(int slotIndex){
 		return (T)slots[slotIndex];
 	}
-	
+
 	public static void releaseSlot(int slotIndex){
 		if(slots[slotIndex] != null){
 			LOG.info("[{}]:slot[{}] released",slots[slotIndex].getRequestId(),slotIndex);

+ 1 - 1
liteflow-core/src/main/java/com/thebeastshop/liteflow/entity/data/DefaultSlot.java → liteflow-core/src/main/java/com/yomahub/liteflow/entity/data/DefaultSlot.java

@@ -7,7 +7,7 @@
  * @Date 2017-12-4
  * @version 1.0
  */
-package com.thebeastshop.liteflow.entity.data;
+package com.yomahub.liteflow.entity.data;
 
 public class DefaultSlot extends AbsSlot {
 

+ 20 - 20
liteflow-core/src/main/java/com/thebeastshop/liteflow/entity/data/Slot.java → liteflow-core/src/main/java/com/yomahub/liteflow/entity/data/Slot.java

@@ -7,46 +7,46 @@
  * @Date 2017-12-4
  * @version 1.0
  */
-package com.thebeastshop.liteflow.entity.data;
+package com.yomahub.liteflow.entity.data;
 
 public interface Slot {
 	public <T> T getInput(String nodeId);
-	
+
 	public <T> T getOutput(String nodeId);
-	
+
 	public <T> void setInput(String nodeId,T t);
-	
+
 	public <T> void setOutput(String nodeId,T t);
-	
+
 	public <T> T getRequestData();
-	
+
 	public <T> void setRequestData(T t);
-	
+
 	public <T> T getResponseData();
-	
+
 	public <T> void setChainReqData(String chainId, T t);
-	
+
 	public <T> T getChainReqData(String chainId);
-	
+
 	public <T> void setResponseData(T t);
-	
+
 	public <T> T getData(String key);
-	
+
 	public <T> void setData(String key, T t);
-	
+
 	public <T> void setCondResult(String key, T t);
-	
+
 	public <T> T getCondResult(String key);
-	
+
 	public void addStep(CmpStep step);
-	
+
 	public void printStep();
-	
+
 	public void generateRequestId();
-	
+
 	public String getRequestId();
-	
+
 	public void setChainName(String chainName);
-	
+
 	public String getChainName();
 }

+ 4 - 4
liteflow-core/src/main/java/com/thebeastshop/liteflow/entity/monitor/CompStatistics.java → liteflow-core/src/main/java/com/yomahub/liteflow/entity/monitor/CompStatistics.java

@@ -7,14 +7,14 @@
  * @Date 2017-8-4
  * @version 1.0
  */
-package com.thebeastshop.liteflow.entity.monitor;
+package com.yomahub.liteflow.entity.monitor;
 
 public class CompStatistics {
-	
+
 	private String componentClazzName;
-	
+
 	private long timeSpent;
-	
+
 	private long memorySpent;
 
 	public String getComponentClazzName() {

+ 2 - 2
liteflow-core/src/main/java/com/thebeastshop/liteflow/exception/ChainNotFoundException.java → liteflow-core/src/main/java/com/yomahub/liteflow/exception/ChainNotFoundException.java

@@ -1,9 +1,9 @@
-package com.thebeastshop.liteflow.exception;
+package com.yomahub.liteflow.exception;
 
 public class ChainNotFoundException extends RuntimeException {
 
 	private static final long serialVersionUID = 1L;
-	
+
 	/** 异常信息 */
 	private String message;
 

+ 2 - 2
liteflow-core/src/main/java/com/thebeastshop/liteflow/exception/ComponentNotAccessException.java → liteflow-core/src/main/java/com/yomahub/liteflow/exception/ComponentNotAccessException.java

@@ -1,9 +1,9 @@
-package com.thebeastshop.liteflow.exception;
+package com.yomahub.liteflow.exception;
 
 public class ComponentNotAccessException extends RuntimeException {
 
 	private static final long serialVersionUID = 1L;
-	
+
 	/** 异常信息 */
 	private String message;
 

+ 2 - 2
liteflow-core/src/main/java/com/thebeastshop/liteflow/exception/FlowExecutorNotInitException.java → liteflow-core/src/main/java/com/yomahub/liteflow/exception/FlowExecutorNotInitException.java

@@ -1,9 +1,9 @@
-package com.thebeastshop.liteflow.exception;
+package com.yomahub.liteflow.exception;
 
 public class FlowExecutorNotInitException extends RuntimeException {
 
 	private static final long serialVersionUID = 1L;
-	
+
 	/** 异常信息 */
 	private String message;
 

+ 2 - 2
liteflow-core/src/main/java/com/thebeastshop/liteflow/exception/FlowSystemException.java → liteflow-core/src/main/java/com/yomahub/liteflow/exception/FlowSystemException.java

@@ -1,9 +1,9 @@
-package com.thebeastshop.liteflow.exception;
+package com.yomahub.liteflow.exception;
 
 public class FlowSystemException extends RuntimeException {
 
 	private static final long serialVersionUID = 1L;
-	
+
 	/** 异常信息 */
 	private String message;
 

+ 2 - 2
liteflow-core/src/main/java/com/thebeastshop/liteflow/exception/NoAvailableSlotException.java → liteflow-core/src/main/java/com/yomahub/liteflow/exception/NoAvailableSlotException.java

@@ -1,9 +1,9 @@
-package com.thebeastshop.liteflow.exception;
+package com.yomahub.liteflow.exception;
 
 public class NoAvailableSlotException extends RuntimeException {
 
 	private static final long serialVersionUID = 1L;
-	
+
 	/** 异常信息 */
 	private String message;
 

+ 2 - 2
liteflow-core/src/main/java/com/thebeastshop/liteflow/exception/ParseException.java → liteflow-core/src/main/java/com/yomahub/liteflow/exception/ParseException.java

@@ -1,9 +1,9 @@
-package com.thebeastshop.liteflow.exception;
+package com.yomahub.liteflow.exception;
 
 public class ParseException extends RuntimeException {
 
 	private static final long serialVersionUID = 1L;
-	
+
 	/** 异常信息 */
 	private String message;
 

+ 3 - 3
liteflow-core/src/main/java/com/thebeastshop/liteflow/flow/FlowBus.java → liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java

@@ -7,15 +7,15 @@
  * @Date 2017-7-28
  * @version 1.0
  */
-package com.thebeastshop.liteflow.flow;
+package com.yomahub.liteflow.flow;
 
 import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.commons.collections4.MapUtils;
 
-import com.thebeastshop.liteflow.entity.config.Chain;
-import com.thebeastshop.liteflow.entity.config.Node;
+import com.yomahub.liteflow.entity.config.Chain;
+import com.yomahub.liteflow.entity.config.Node;
 
 public class FlowBus {
 

+ 4 - 5
liteflow-core/src/main/java/com/thebeastshop/liteflow/monitor/MonitorBus.java → liteflow-core/src/main/java/com/yomahub/liteflow/monitor/MonitorBus.java

@@ -7,7 +7,7 @@
  * @Date 2017-8-4
  * @version 1.0
  */
-package com.thebeastshop.liteflow.monitor;
+package com.yomahub.liteflow.monitor;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -23,13 +23,12 @@ import java.util.Map.Entry;
 import java.util.Timer;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.commons.collections4.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.thebeastshop.liteflow.entity.data.DataBus;
-import com.thebeastshop.liteflow.entity.monitor.CompStatistics;
-import com.thebeastshop.liteflow.util.LimitQueue;
+import com.yomahub.liteflow.entity.data.DataBus;
+import com.yomahub.liteflow.entity.monitor.CompStatistics;
+import com.yomahub.liteflow.util.LimitQueue;
 
 public class MonitorBus {
 

+ 2 - 2
liteflow-core/src/main/java/com/thebeastshop/liteflow/parser/ClassXmlFlowParser.java → liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassXmlFlowParser.java

@@ -1,4 +1,4 @@
-package com.thebeastshop.liteflow.parser;
+package com.yomahub.liteflow.parser;
 
 public abstract class ClassXmlFlowParser extends XmlFlowParser {
 	@Override
@@ -6,6 +6,6 @@ public abstract class ClassXmlFlowParser extends XmlFlowParser {
 		String content = parseCustom();
 		parse(content);
 	}
-	
+
 	public abstract String parseCustom();
 }

+ 3 - 3
liteflow-core/src/main/java/com/thebeastshop/liteflow/parser/LocalXmlFlowParser.java → liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalXmlFlowParser.java

@@ -7,14 +7,14 @@
  * @Date 2017-7-28
  * @version 1.0
  */
-package com.thebeastshop.liteflow.parser;
+package com.yomahub.liteflow.parser;
 
-import com.thebeastshop.liteflow.util.IOUtil;
+import com.yomahub.liteflow.util.IOUtil;
 
 public class LocalXmlFlowParser extends XmlFlowParser{
 
 	private final String ENCODING_FORMAT = "UTF-8";
-	
+
 	public void parseMain(String rulePath) throws Exception {
 		String ruleContent = IOUtil.read(rulePath, ENCODING_FORMAT);
 		parse(ruleContent);

+ 3 - 3
liteflow-core/src/main/java/com/thebeastshop/liteflow/parser/RegexEntity.java → liteflow-core/src/main/java/com/yomahub/liteflow/parser/RegexEntity.java

@@ -1,11 +1,11 @@
-package com.thebeastshop.liteflow.parser;
+package com.yomahub.liteflow.parser;
 
 import java.util.Arrays;
 
 public class RegexEntity {
-	
+
 	private String condNode;
-	
+
 	private String[] realNodeArray;
 
 	public String getCondNode() {

+ 10 - 10
liteflow-core/src/main/java/com/thebeastshop/liteflow/parser/XmlFlowParser.java → liteflow-core/src/main/java/com/yomahub/liteflow/parser/XmlFlowParser.java

@@ -1,4 +1,4 @@
-package com.thebeastshop.liteflow.parser;
+package com.yomahub.liteflow.parser;
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -13,15 +13,15 @@ import org.dom4j.Element;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.entity.config.Chain;
-import com.thebeastshop.liteflow.entity.config.Condition;
-import com.thebeastshop.liteflow.entity.config.Node;
-import com.thebeastshop.liteflow.entity.config.ThenCondition;
-import com.thebeastshop.liteflow.entity.config.WhenCondition;
-import com.thebeastshop.liteflow.flow.FlowBus;
-import com.thebeastshop.liteflow.spring.ComponentScaner;
-import com.thebeastshop.liteflow.util.Dom4JReader;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.config.Chain;
+import com.yomahub.liteflow.entity.config.Condition;
+import com.yomahub.liteflow.entity.config.Node;
+import com.yomahub.liteflow.entity.config.ThenCondition;
+import com.yomahub.liteflow.entity.config.WhenCondition;
+import com.yomahub.liteflow.flow.FlowBus;
+import com.yomahub.liteflow.spring.ComponentScaner;
+import com.yomahub.liteflow.util.Dom4JReader;
 
 public abstract class XmlFlowParser {
 

+ 13 - 13
liteflow-core/src/main/java/com/thebeastshop/liteflow/parser/ZookeeperXmlFlowParser.java → liteflow-core/src/main/java/com/yomahub/liteflow/parser/ZookeeperXmlFlowParser.java

@@ -1,4 +1,4 @@
-package com.thebeastshop.liteflow.parser;
+package com.yomahub.liteflow.parser;
 
 import java.text.MessageFormat;
 
@@ -10,18 +10,18 @@ import org.apache.curator.framework.recipes.cache.NodeCacheListener;
 import org.apache.curator.retry.RetryNTimes;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import com.thebeastshop.liteflow.exception.ParseException;
+import com.yomahub.liteflow.exception.ParseException;
 
 public class ZookeeperXmlFlowParser extends XmlFlowParser{
-	
+
 	private static final Logger LOG = LoggerFactory.getLogger(ZookeeperXmlFlowParser.class);
-	
+
 	private String nodePath = "/lite-flow/flow";
-	
+
 	public ZookeeperXmlFlowParser() {
-		
+
 	}
-	
+
 	public ZookeeperXmlFlowParser(String node) {
 		nodePath = node;
 	}
@@ -33,21 +33,21 @@ public class ZookeeperXmlFlowParser extends XmlFlowParser{
                 new RetryNTimes(10, 5000)
         );
         client.start();
-        
+
         if (client.checkExists().forPath(nodePath) == null) {
         	client.create().creatingParentsIfNeeded().forPath(nodePath, "".getBytes());
         }
-        
+
         String content = new String(client.getData().forPath(nodePath));
-        
-        
+
+
         if(StringUtils.isBlank(content)) {
         	String error = MessageFormat.format("the node[{0}] value is empty", nodePath);
         	throw new ParseException(error);
         }
         parse(content);
-        
-        
+
+
         final NodeCache cache = new NodeCache(client,nodePath);
         cache.start();
 

+ 3 - 4
liteflow-core/src/main/java/com/thebeastshop/liteflow/spring/ComponentScaner.java → liteflow-core/src/main/java/com/yomahub/liteflow/spring/ComponentScaner.java

@@ -7,7 +7,7 @@
  * @Date 2017-11-23
  * @version 1.0
  */
-package com.thebeastshop.liteflow.spring;
+package com.yomahub.liteflow.spring;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -17,9 +17,8 @@ import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.config.BeanPostProcessor;
 import org.springframework.core.Ordered;
 import org.springframework.core.PriorityOrdered;
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.entity.config.Node;
-import com.thebeastshop.liteflow.util.LOGOPrinter;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.util.LOGOPrinter;
 
 public class ComponentScaner implements BeanPostProcessor, PriorityOrdered {
 

+ 4 - 4
liteflow-core/src/main/java/com/thebeastshop/liteflow/util/Dom4JReader.java → liteflow-core/src/main/java/com/yomahub/liteflow/util/Dom4JReader.java

@@ -1,4 +1,4 @@
-package com.thebeastshop.liteflow.util;
+package com.yomahub.liteflow.util;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -16,9 +16,9 @@ import org.dom4j.io.SAXReader;
 import org.xml.sax.InputSource;
 
 public class Dom4JReader {
-	
+
 	private static final String ENCODING_FORMAT = "UTF-8";
-	
+
     public static Document getDocument(String text) throws DocumentException {
         return DocumentHelper.parseText(text);
     }
@@ -114,4 +114,4 @@ public class Dom4JReader {
 
         return saxReader.read(url);
     }
-}
+}

+ 2 - 2
liteflow-core/src/main/java/com/thebeastshop/liteflow/util/IOUtil.java → liteflow-core/src/main/java/com/yomahub/liteflow/util/IOUtil.java

@@ -1,4 +1,4 @@
-package com.thebeastshop.liteflow.util;
+package com.yomahub.liteflow.util;
 
 import java.io.FileInputStream;
 import java.io.InputStream;
@@ -26,4 +26,4 @@ public class IOUtil {
 
         return content;
     }
-}
+}

+ 3 - 3
liteflow-core/src/main/java/com/thebeastshop/liteflow/util/LOGOPrinter.java → liteflow-core/src/main/java/com/yomahub/liteflow/util/LOGOPrinter.java

@@ -1,12 +1,12 @@
-package com.thebeastshop.liteflow.util;
+package com.yomahub.liteflow.util;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class LOGOPrinter {
-	
+
 	private static final Logger LOG = LoggerFactory.getLogger(LOGOPrinter.class);
-	
+
 	public static void print() {
 		StringBuilder str = new StringBuilder("\n");
 		str.append("================================================================================================\n");

+ 4 - 7
liteflow-core/src/main/java/com/thebeastshop/liteflow/util/LimitQueue.java → liteflow-core/src/main/java/com/yomahub/liteflow/util/LimitQueue.java

@@ -7,7 +7,7 @@
  * @Date 2017-8-4
  * @version 1.0
  */
-package com.thebeastshop.liteflow.util;
+package com.yomahub.liteflow.util;
 
 import java.util.Collection;
 import java.util.Iterator;
@@ -30,6 +30,8 @@ public class LimitQueue<E> implements Queue<E> {
 
 	/**
 	 * 入队
+	 * @param e
+	 * @return
 	 */
 	@Override
 	public boolean offer(E e) {
@@ -42,6 +44,7 @@ public class LimitQueue<E> implements Queue<E> {
 
 	/**
 	 * 出队
+	 * @return
 	 */
 	@Override
 	public E poll() {
@@ -50,10 +53,7 @@ public class LimitQueue<E> implements Queue<E> {
 
 	/**
 	 * 获取队列
-	 *
 	 * @return
-	 * @author SHANHY
-	 * @date 2015年11月9日
 	 */
 	public Queue<E> getQueue() {
 		return queue;
@@ -61,10 +61,7 @@ public class LimitQueue<E> implements Queue<E> {
 
 	/**
 	 * 获取限制大小
-	 *
 	 * @return
-	 * @author SHANHY
-	 * @date 2015年11月9日
 	 */
 	public int getLimit() {
 		return limit;

+ 0 - 30
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/TestMain.java

@@ -1,30 +0,0 @@
-/**
- * <p>Title: liteFlow</p>
- * <p>Description: 轻量级的组件式流程框架</p>
- * <p>Copyright: Copyright (c) 2017</p>
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2017-7-27
- * @version 1.0
- */
-package com.thebeastshop.liteflow.test;
-
-import java.util.Arrays;
-
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.entity.data.Slot;
-
-/**
- * 这是编程式引用liteflow
- */
-public class TestMain {
-	public static void main(String[] args) throws Exception {
-		final FlowExecutor executor = new FlowExecutor();
-		executor.setRulePath(Arrays.asList(new String[]{"config/flow.xml"}));
-		executor.init();
-
-		Slot slot = executor.execute("chain1", "it's a request");
-		System.out.println(slot);
-	}
-
-}

+ 0 - 60
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/TestWithSpringMain.java

@@ -1,60 +0,0 @@
-package com.thebeastshop.liteflow.test;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import javax.annotation.Resource;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.entity.data.Slot;
-
-
-/**
- * 此示例演示了如何在spring中用liteflow
- * 如果是springboot请参考flowtest
- */
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "classpath:spring-test.xml" })
-public class TestWithSpringMain {
-
-	@Resource(name="flowExecutor")
-	private FlowExecutor flowExecutor;
-
-	@Test
-	public void test1() throws Exception {
-		Slot slot = flowExecutor.execute("chain1", "it's a request");
-		System.out.println(slot);
-		System.out.println("done!");
-		System.in.read();
-	}
-
-	@Test
-	public void test2() throws Exception {
-		try {
-			Slot slot = flowExecutor.execute("chain3", "it's a request");
-			System.out.println(slot);
-			System.in.read();
-		}catch(Exception e) {
-			e.printStackTrace();
-		}
-
-	}
-
-	@Test
-	public void test3() throws Exception {
-		try {
-			while(true) {
-				Slot slot = flowExecutor.execute("chain3", "it's a request");
-				Thread.sleep(2000);
-			}
-		}catch(Exception e) {
-			e.printStackTrace();
-		}
-
-	}
-}

+ 0 - 37
liteflow-core/src/test/resources/config/flow.xml

@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<flow>
-	<!-- 如果和spring集成,以下<nodes>配置可以不要 -->
-	<nodes>
-		<node id="a" class="com.thebeastshop.liteflow.test.component.AComponent"/>
-		<node id="b" class="com.thebeastshop.liteflow.test.component.BComponent"/>
-		<node id="c" class="com.thebeastshop.liteflow.test.component.CComponent"/>
-		<node id="d" class="com.thebeastshop.liteflow.test.component.DComponent"/>
-		<node id="e" class="com.thebeastshop.liteflow.test.component.EComponent"/>
-		<node id="f" class="com.thebeastshop.liteflow.test.component.FComponent"/>
-		<node id="g" class="com.thebeastshop.liteflow.test.component.GComponent"/>
-		<node id="cond" class="com.thebeastshop.liteflow.test.component.CondComponent"/>
-	</nodes>
-	
-	<chain name="chain1">
-		<then value="a,cond(b|d)"/> <!-- cond是条件节点,根据cond里的逻辑决定路由到b节点还是d节点,可以配置多个 -->
-		<then value="e,f,g"/>
-	</chain>
-	
-	<chain name="chain2">
-		<then value="a,c"/> <!-- then表示串行 -->
-		<when value="b,d"/> <!-- when表示串行 -->
-		<then value="e,f,g"/>
-	</chain>
-	
-	<chain name="chain3">
-		<then value="a,c,h,g"/>
-	</chain>
-	
-	<chain name="strategy1">
-		<then value="m(m1|m2|m3)"/>
-	</chain>
-	
-	<chain name="strategy2">
-		<then value="p(p1|p2)"/>
-	</chain>
-</flow>

+ 0 - 28
liteflow-core/src/test/resources/log4j.xml

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration>
-    <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
-        <layout class="org.apache.log4j.PatternLayout">
-            <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss,SSS} [%p] %m  >> %c:%L%n"/>
-        </layout>
-    </appender>
-    <appender name="fileout" class="org.apache.log4j.DailyRollingFileAppender">
-        <param name="File" value="./logs/commdata.log"/>
-        <layout class="org.apache.log4j.PatternLayout">
-            <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss,SSS} [%p] %m  >> %c:%L%n"/>
-        </layout>
-    </appender>
-    <appender name="asyncStdout" class="org.apache.log4j.AsyncAppender">
-    	<param name="BufferSize" value="8192"/>
-        <appender-ref ref="stdout"/>
-    </appender>
-    <appender name="asyncFileout" class="org.apache.log4j.AsyncAppender">
-    	<param name="BufferSize" value="8192"/>
-        <appender-ref ref="fileout"/>
-    </appender>
-    <root>
-        <priority value="info" />
-        <appender-ref ref="asyncStdout"/>
-        <appender-ref ref="asyncFileout"/>
-    </root>
-</log4j:configuration>

+ 0 - 40
liteflow-core/src/test/resources/spring-test.xml

@@ -1,40 +0,0 @@
-<?xml  version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
-	xsi:schemaLocation="http://www.springframework.org/schema/beans   
-        http://www.springframework.org/schema/beans/spring-beans.xsd  
-        http://www.springframework.org/schema/context   
-        http://www.springframework.org/schema/context/spring-context.xsd"
-	default-autowire="byName">
- 
- 	<context:component-scan base-package="com.thebeastshop.liteflow.test.component" />
- 	<bean class="com.thebeastshop.liteflow.spring.ComponentScaner"/>
- 	
- 	<!-- 本地方式配置 -->
- 	<bean id="flowExecutor" class="com.thebeastshop.liteflow.core.FlowExecutor">
-		<property name="rulePath">
-			<list>
-				<value>config/flow.xml</value>
-			</list>
-		</property>
-	</bean>
-	
-	<!-- 这种是zk方式配置 -->
-	<!-- <bean id="flowExecutor" class="com.thebeastshop.liteflow.core.FlowExecutor">
-		<property name="rulePath">
-			<list>
-				<value>123.206.92.144:2181,123.206.92.144:2182,123.206.92.144:2183</value>
-			</list>
-		</property>
-		<property name="zkNode" value="/lite-flow/customFlow"/>这个不配置就用默认的/lite-flow/flow节点
-	</bean> -->
-	
-	<!-- 这种是自定义Class方式配置 -->
-	<!-- <bean id="flowExecutor" class="com.thebeastshop.liteflow.core.FlowExecutor">
-		<property name="rulePath">
-			<list>
-				<value>com.thebeastshop.liteflow.test.TestCustomParser</value>
-			</list>
-		</property>
-	</bean> -->
-</beans>

+ 8 - 6
liteflow-spring-boot-starter/pom.xml

@@ -2,18 +2,20 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+    <artifactId>liteflow-spring-boot-starter</artifactId>
+    <description>liteflow springboot starter</description>
+
     <parent>
         <artifactId>liteflow</artifactId>
-        <groupId>com.thebeastshop</groupId>
-        <version>2.1.3</version>
+        <groupId>com.yomahub</groupId>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>liteflow-spring-boot-starter</artifactId>
 
     <dependencies>
         <dependency>
-            <groupId>com.thebeastshop</groupId>
+            <groupId>com.yomahub</groupId>
             <artifactId>liteflow-core</artifactId>
             <version>${project.parent.version}</version>
         </dependency>

+ 3 - 3
liteflow-spring-boot-starter/src/main/java/com/thebeastshop/liteflow/springboot/LiteflowAutoConfiguration.java → liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowAutoConfiguration.java

@@ -1,8 +1,8 @@
-package com.thebeastshop.liteflow.springboot;
+package com.yomahub.liteflow.springboot;
 
 import com.google.common.collect.Lists;
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.spring.ComponentScaner;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.spring.ComponentScaner;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;

+ 2 - 2
liteflow-spring-boot-starter/src/main/java/com/thebeastshop/liteflow/springboot/LiteflowExecutorInit.java → liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowExecutorInit.java

@@ -1,6 +1,6 @@
-package com.thebeastshop.liteflow.springboot;
+package com.yomahub.liteflow.springboot;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.FlowExecutor;
 import org.springframework.beans.factory.InitializingBean;
 import javax.annotation.Resource;
 

+ 1 - 1
liteflow-spring-boot-starter/src/main/java/com/thebeastshop/liteflow/springboot/LiteflowProperty.java → liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java

@@ -1,4 +1,4 @@
-package com.thebeastshop.liteflow.springboot;
+package com.yomahub.liteflow.springboot;
 
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;

+ 3 - 3
liteflow-spring-boot-starter/src/main/resources/META-INF/spring.factories

@@ -1,6 +1,6 @@
 org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-  com.thebeastshop.liteflow.springboot.LiteflowProperty,\
-  com.thebeastshop.liteflow.springboot.LiteflowAutoConfiguration,\
-  com.thebeastshop.liteflow.springboot.LiteflowExecutorInit
+  com.yomahub.liteflow.springboot.LiteflowProperty,\
+  com.yomahub.liteflow.springboot.LiteflowAutoConfiguration,\
+  com.yomahub.liteflow.springboot.LiteflowExecutorInit
 
 

+ 63 - 0
liteflow-test-spring/pom.xml

@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+    <artifactId>liteflow-test-spring</artifactId>
+
+    <parent>
+        <artifactId>liteflow</artifactId>
+        <groupId>com.yomahub</groupId>
+        <version>2.2.0-SNAPSHOT</version>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-beans</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-aop</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-expression</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>com.yomahub</groupId>
+            <artifactId>liteflow-core</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>1.2.3</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 22 - 0
liteflow-test-spring/src/main/java/com/yomahub/flowtest/Runner.java

@@ -0,0 +1,22 @@
+package com.yomahub.flowtest;
+
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.entity.data.Slot;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class Runner {
+
+    private static final Logger log = LoggerFactory.getLogger(Runner.class);
+    private static ClassPathXmlApplicationContext context;
+
+    public static void main(String[] args) throws Throwable {
+        context = new ClassPathXmlApplicationContext(new String[]{"/applicationContext.xml"});
+        context.start();
+        log.info("启动成功");
+        FlowExecutor flowExecutor = context.getBean(FlowExecutor.class);
+        Slot slot = flowExecutor.execute("chain3", "it's a request");
+        System.out.println(slot);
+    }
+}

+ 2 - 2
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/AComponent.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/AComponent.java

@@ -7,9 +7,9 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
 @Component("a")

+ 2 - 2
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/BComponent.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/BComponent.java

@@ -7,9 +7,9 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
 @Component("b")

+ 2 - 2
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/CComponent.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/CComponent.java

@@ -7,9 +7,9 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
 @Component("c")

+ 3 - 3
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/CondComponent.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/CondComponent.java

@@ -6,10 +6,10 @@
  * @email 47483522@qq.com
  * @Date 2017-11-28
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.core.NodeCondComponent;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeCondComponent;
 import org.springframework.stereotype.Component;
 
 @Component("cond")

+ 3 - 3
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/DComponent.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/DComponent.java

@@ -7,10 +7,10 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.entity.data.Slot;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.Slot;
 import org.springframework.stereotype.Component;
 
 @Component("d")

+ 2 - 2
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/EComponent.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/EComponent.java

@@ -7,9 +7,9 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
 @Component("e")

+ 2 - 2
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/FComponent.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/FComponent.java

@@ -7,9 +7,9 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
 @Component("f")

+ 2 - 2
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/GComponent.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/GComponent.java

@@ -7,9 +7,9 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
 @Component("g")

+ 4 - 4
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/HComponent.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/HComponent.java

@@ -7,11 +7,11 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.entity.data.DefaultSlot;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.DefaultSlot;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;

+ 3 - 3
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/M1Component.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/M1Component.java

@@ -7,10 +7,10 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;

+ 3 - 3
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/M2Component.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/M2Component.java

@@ -7,10 +7,10 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;

+ 4 - 4
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/M3Component.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/M3Component.java

@@ -7,11 +7,11 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.entity.data.DefaultSlot;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.DefaultSlot;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;

+ 4 - 4
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/MComponent.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/MComponent.java

@@ -7,11 +7,11 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.core.NodeCondComponent;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeCondComponent;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;

+ 3 - 3
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/P1Component.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/P1Component.java

@@ -7,10 +7,10 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;

+ 3 - 3
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/P2Component.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/P2Component.java

@@ -7,10 +7,10 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;

+ 4 - 4
liteflow-test/src/main/java/com/thebeastshop/flowtest/components/PComponent.java → liteflow-test-spring/src/main/java/com/yomahub/flowtest/components/PComponent.java

@@ -7,11 +7,11 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.flowtest.components;
+package com.yomahub.flowtest.components;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.core.NodeCondComponent;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeCondComponent;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;

+ 22 - 0
liteflow-test-spring/src/main/resources/applicationContext.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns="http://www.springframework.org/schema/beans"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
+       http://www.springframework.org/schema/context
+       http://www.springframework.org/schema/context/spring-context-4.0.xsd">
+
+	<context:component-scan base-package="com.yomahub.flowtest.components" />
+
+	<bean class="com.yomahub.liteflow.spring.ComponentScaner" depends-on="flowExecutor"/>
+
+	<bean id="flowExecutor" class="com.yomahub.liteflow.core.FlowExecutor">
+		<property name="rulePath">
+			<list>
+				<value>config/flow.xml</value>
+			</list>
+		</property>
+	</bean>
+
+</beans>

+ 8 - 8
liteflow-test/src/main/resources/config/flow.xml → liteflow-test-spring/src/main/resources/config/flow.xml

@@ -2,14 +2,14 @@
 <flow>
 	<!-- 如果和spring集成,以下<nodes>配置可以不要
 	<nodes>
-		<node id="a" class="com.thebeastshop.flowtest.components.AComponent"/>
-		<node id="b" class="com.thebeastshop.flowtest.components.BComponent"/>
-		<node id="c" class="com.thebeastshop.flowtest.components.CComponent"/>
-		<node id="d" class="com.thebeastshop.flowtest.components.DComponent"/>
-		<node id="e" class="com.thebeastshop.flowtest.components.EComponent"/>
-		<node id="f" class="com.thebeastshop.flowtest.components.FComponent"/>
-		<node id="g" class="com.thebeastshop.flowtest.components.GComponent"/>
-		<node id="cond" class="com.thebeastshop.liteflow.test.component.CondComponent"/>
+		<node id="a" class="com.yomahub.liteflow.test.component.AComponent"/>
+		<node id="b" class="com.yomahub.liteflow.test.component.BComponent"/>
+		<node id="c" class="com.yomahub.liteflow.test.component.CComponent"/>
+		<node id="d" class="com.yomahub.liteflow.test.component.DComponent"/>
+		<node id="e" class="com.yomahub.liteflow.test.component.EComponent"/>
+		<node id="f" class="com.yomahub.liteflow.test.component.FComponent"/>
+		<node id="g" class="com.yomahub.liteflow.test.component.GComponent"/>
+		<node id="cond" class="com.yomahub.liteflow.test.component.CondComponent"/>
 	</nodes>
 	-->
 

+ 47 - 0
liteflow-test-spring/src/main/resources/logback.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2010-2011 The myBatis Team
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+        http://www.apache.org/licenses/LICENSE-2.0
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<configuration debug="false">
+    <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
+    <property name="APP_NAME" value="test"/>
+    <property name="LOG_HOME" value="./logs" />
+    <!-- 控制台输出 -->
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+        </encoder>
+    </appender>
+    <!-- 按照每天生成日志文件 -->
+    <appender name="FILE"  class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>${LOG_HOME}/${APP_NAME}.log</File>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!--日志文件输出的文件名-->
+            <FileNamePattern>${LOG_HOME}/${APP_NAME}.log.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
+            <!--日志文件保留天数-->
+            <MaxHistory>30</MaxHistory>
+            <!--日志文件大小-->
+            <maxFileSize>1000MB</maxFileSize>
+        </rollingPolicy>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <!-- 日志输出级别 -->
+    <root level="INFO">
+        <appender-ref ref="STDOUT" />
+        <appender-ref ref="FILE" />
+    </root>
+</configuration>

+ 21 - 13
liteflow-test/pom.xml → liteflow-test-springboot/pom.xml

@@ -2,20 +2,28 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+    <artifactId>liteflow-test-springboot</artifactId>
+    <description>Demo project for Spring Boot</description>
+
     <parent>
-        <groupId>org.springframework.boot</groupId>
-        <artifactId>spring-boot-starter-parent</artifactId>
-        <version>2.0.5.RELEASE</version>
-        <relativePath/> <!-- lookup parent from repository -->
+        <artifactId>liteflow</artifactId>
+        <groupId>com.yomahub</groupId>
+        <version>2.2.0-SNAPSHOT</version>
     </parent>
-    <groupId>com.thebeastshop</groupId>
-    <artifactId>liteflow-test</artifactId>
-    <version>1.0.0</version>
-    <description>Demo project for Spring Boot</description>
 
-    <properties>
-        <java.version>1.8</java.version>
-    </properties>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <!-- Import dependency management from Spring Boot -->
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>2.0.5.RELEASE</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
 
     <dependencies>
         <dependency>
@@ -24,9 +32,9 @@
         </dependency>
 
         <dependency>
-            <groupId>com.thebeastshop</groupId>
+            <groupId>com.yomahub</groupId>
             <artifactId>liteflow-spring-boot-starter</artifactId>
-            <version>2.1.3</version>
+            <version>${project.parent.version}</version>
         </dependency>
 
         <dependency>

+ 1 - 1
liteflow-test/src/main/java/com/thebeastshop/flowtest/FlowtestApplication.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/FlowtestApplication.java

@@ -1,4 +1,4 @@
-package com.thebeastshop.flowtest;
+package com.yomahub.flowtest;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;

+ 4 - 4
liteflow-test/src/main/java/com/thebeastshop/flowtest/TestFlow.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/TestFlow.java

@@ -1,7 +1,7 @@
-package com.thebeastshop.flowtest;
+package com.yomahub.flowtest;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.entity.data.Slot;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.entity.data.Slot;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.stereotype.Component;
 
@@ -15,7 +15,7 @@ public class TestFlow implements CommandLineRunner {
 
     @Override
     public void run(String... args) throws Exception {
-        Slot slot = flowExecutor.execute("chain1", "it's a request");
+        Slot slot = flowExecutor.execute("chain3", "it's a request");
         System.out.println(slot);
     }
 }

+ 4 - 5
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/AComponent.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/AComponent.java

@@ -7,12 +7,11 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
-
 @Component("a")
 public class AComponent extends NodeComponent {
 
@@ -21,8 +20,8 @@ public class AComponent extends NodeComponent {
 		String str = this.getSlot().getRequestData();
 		System.out.println(str);
 		System.out.println("Acomponent executed!");
-		
+
 		this.getSlot().setOutput(this.getNodeId(), "A component output");
 	}
-	
+
 }

+ 4 - 5
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/BComponent.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/BComponent.java

@@ -7,12 +7,11 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
-
 @Component("b")
 public class BComponent extends NodeComponent {
 
@@ -25,7 +24,7 @@ public class BComponent extends NodeComponent {
 			e.printStackTrace();
 		}
 		System.out.println("Bcomponent executed!");
-		
+
 	}
-	
+
 }

+ 4 - 5
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/CComponent.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/CComponent.java

@@ -7,12 +7,11 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
-
 @Component("c")
 public class CComponent extends NodeComponent {
 
@@ -25,7 +24,7 @@ public class CComponent extends NodeComponent {
 			e.printStackTrace();
 		}
 		System.out.println("Ccomponent executed!");
-		
+
 	}
-	
+
 }

+ 3 - 4
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/CondComponent.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/CondComponent.java

@@ -6,13 +6,12 @@
  * @email 47483522@qq.com
  * @Date 2017-11-28
  */
-package com.thebeastshop.liteflow.test.component;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeCondComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.core.NodeCondComponent;
-
 @Component("cond")
 public class CondComponent extends NodeCondComponent {
 

+ 6 - 7
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/DComponent.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/DComponent.java

@@ -7,13 +7,12 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.Slot;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.entity.data.Slot;
-
 @Component("d")
 public class DComponent extends NodeComponent {
 
@@ -26,14 +25,14 @@ public class DComponent extends NodeComponent {
 				System.out.println(slot);
 			}
 			System.out.println("D:" + slot.getOutput("e"));
-			
+
 			String[] temp = new String[1400];
 			Thread.sleep(450L);
 		} catch (InterruptedException e) {
 			e.printStackTrace();
 		}
 		System.out.println("Dcomponent executed!");
-		
+
 	}
-	
+
 }

+ 4 - 5
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/EComponent.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/EComponent.java

@@ -7,12 +7,11 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
-
 @Component("e")
 public class EComponent extends NodeComponent {
 
@@ -26,7 +25,7 @@ public class EComponent extends NodeComponent {
 			e.printStackTrace();
 		}
 		System.out.println("Eomponent executed!");
-		
+
 	}
-	
+
 }

+ 4 - 5
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/FComponent.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/FComponent.java

@@ -7,12 +7,11 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
-
 @Component("f")
 public class FComponent extends NodeComponent {
 
@@ -25,7 +24,7 @@ public class FComponent extends NodeComponent {
 			e.printStackTrace();
 		}
 		System.out.println("Fcomponent executed!");
-		
+
 	}
-	
+
 }

+ 3 - 4
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/GComponent.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/GComponent.java

@@ -7,12 +7,11 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.NodeComponent;
-
 @Component("g")
 public class GComponent extends NodeComponent {
 
@@ -21,5 +20,5 @@ public class GComponent extends NodeComponent {
 		System.out.println("Gcomponent executed!");
 		this.getSlot().setResponseData("i am a response");
 	}
-	
+
 }

+ 5 - 8
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/HComponent.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/HComponent.java

@@ -7,15 +7,14 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
-
-import javax.annotation.Resource;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.DefaultSlot;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.entity.data.DefaultSlot;
+import javax.annotation.Resource;
 
 @Component("h")
 public class HComponent extends NodeComponent {
@@ -31,7 +30,5 @@ public class HComponent extends NodeComponent {
 		}catch (Exception e){
 			e.printStackTrace();
 		}
-
 	}
-
 }

+ 6 - 7
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/M1Component.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/M1Component.java

@@ -7,24 +7,23 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
-
-import javax.annotation.Resource;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
+import javax.annotation.Resource;
 
 @Component("m1")
 public class M1Component extends NodeComponent {
 
 	@Resource
 	private FlowExecutor flowExecutor;
-	
+
 	@Override
 	public void process() {
 		System.out.println("m1 component executed!");
 	}
-	
+
 }

+ 6 - 7
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/M2Component.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/M2Component.java

@@ -7,24 +7,23 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
-
-import javax.annotation.Resource;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
+import javax.annotation.Resource;
 
 @Component("m2")
 public class M2Component extends NodeComponent {
 
 	@Resource
 	private FlowExecutor flowExecutor;
-	
+
 	@Override
 	public void process() {
 		System.out.println("m2 component executed!");
 	}
-	
+
 }

+ 5 - 8
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/M3Component.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/M3Component.java

@@ -7,15 +7,14 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
-
-import javax.annotation.Resource;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.DefaultSlot;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.entity.data.DefaultSlot;
+import javax.annotation.Resource;
 
 @Component("m3")
 public class M3Component extends NodeComponent {
@@ -31,7 +30,5 @@ public class M3Component extends NodeComponent {
 		}catch (Exception e){
 			e.printStackTrace();
 		}
-
 	}
-
 }

+ 8 - 9
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/MComponent.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/MComponent.java

@@ -7,22 +7,21 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
-
-import javax.annotation.Resource;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeCondComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.core.NodeCondComponent;
+import javax.annotation.Resource;
 
 @Component("m")
 public class MComponent extends NodeCondComponent {
 
 	@Resource
 	private FlowExecutor flowExecutor;
-	
+
 	@Override
 	protected Class<? extends NodeComponent> processCond() throws Exception {
 		System.out.println("m conponent executed");
@@ -34,7 +33,7 @@ public class MComponent extends NodeCondComponent {
 		}else {
 			return M3Component.class;
 		}
-		
+
 	}
-	
+
 }

+ 6 - 7
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/P1Component.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/P1Component.java

@@ -7,24 +7,23 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
-
-import javax.annotation.Resource;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
+import javax.annotation.Resource;
 
 @Component("p1")
 public class P1Component extends NodeComponent {
 
 	@Resource
 	private FlowExecutor flowExecutor;
-	
+
 	@Override
 	public void process() {
 		System.out.println("p1 component executed!");
 	}
-	
+
 }

+ 6 - 7
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/P2Component.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/P2Component.java

@@ -7,24 +7,23 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
-
-import javax.annotation.Resource;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
+import javax.annotation.Resource;
 
 @Component("p2")
 public class P2Component extends NodeComponent {
 
 	@Resource
 	private FlowExecutor flowExecutor;
-	
+
 	@Override
 	public void process() {
 		System.out.println("p2 component executed!");
 	}
-	
+
 }

+ 8 - 9
liteflow-core/src/test/java/com/thebeastshop/liteflow/test/component/PComponent.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/components/PComponent.java

@@ -7,22 +7,21 @@
  * @Date 2017-8-1
  * @version 1.0
  */
-package com.thebeastshop.liteflow.test.component;
-
-import javax.annotation.Resource;
+package com.yomahub.flowtest.components;
 
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.core.NodeCondComponent;
 import org.springframework.stereotype.Component;
 
-import com.thebeastshop.liteflow.core.FlowExecutor;
-import com.thebeastshop.liteflow.core.NodeComponent;
-import com.thebeastshop.liteflow.core.NodeCondComponent;
+import javax.annotation.Resource;
 
 @Component("p")
 public class PComponent extends NodeCondComponent {
 
 	@Resource
 	private FlowExecutor flowExecutor;
-	
+
 	@Override
 	protected Class<? extends NodeComponent> processCond() throws Exception {
 		System.out.println("p conponent executed");
@@ -32,7 +31,7 @@ public class PComponent extends NodeCondComponent {
 		}else {
 			return P2Component.class;
 		}
-		
+
 	}
-	
+
 }

+ 1 - 1
liteflow-test/src/main/java/com/thebeastshop/flowtest/curator/CuratorTest.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/curator/CuratorTest.java

@@ -1,4 +1,4 @@
-package com.thebeastshop.flowtest.curator;
+package com.yomahub.flowtest.curator;
 
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.CuratorFrameworkFactory;

+ 1 - 1
liteflow-test/src/main/java/com/thebeastshop/flowtest/curator/CuratorTest2.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/curator/CuratorTest2.java

@@ -1,4 +1,4 @@
-package com.thebeastshop.flowtest.curator;
+package com.yomahub.flowtest.curator;
 
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.CuratorFrameworkFactory;

+ 1 - 1
liteflow-test/src/main/java/com/thebeastshop/flowtest/regex/RegexTest.java → liteflow-test-springboot/src/main/java/com/yomahub/flowtest/regex/RegexTest.java

@@ -1,4 +1,4 @@
-package com.thebeastshop.flowtest.regex;
+package com.yomahub.flowtest.regex;
 
 import java.util.ArrayList;
 import java.util.List;

+ 0 - 0
liteflow-test/src/main/resources/application.properties → liteflow-test-springboot/src/main/resources/application.properties


+ 38 - 0
liteflow-test-springboot/src/main/resources/config/flow.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<flow>
+	<!-- 如果和spring集成,以下<nodes>配置可以不要
+	<nodes>
+		<node id="a" class="com.yomahub.liteflow.test.component.AComponent"/>
+		<node id="b" class="com.yomahub.liteflow.test.component.BComponent"/>
+		<node id="c" class="com.yomahub.liteflow.test.component.CComponent"/>
+		<node id="d" class="com.yomahub.liteflow.test.component.DComponent"/>
+		<node id="e" class="com.yomahub.liteflow.test.component.EComponent"/>
+		<node id="f" class="com.yomahub.liteflow.test.component.FComponent"/>
+		<node id="g" class="com.yomahub.liteflow.test.component.GComponent"/>
+		<node id="cond" class="com.yomahub.liteflow.test.component.CondComponent"/>
+	</nodes>
+	-->
+
+	<chain name="chain1">
+		<then value="a,cond(b|d)"/> <!-- cond是条件节点,根据cond里的逻辑决定路由到b节点还是d节点,可以配置多个 -->
+		<then value="e,f,g"/>
+	</chain>
+
+	<chain name="chain2">
+		<then value="a,c"/> <!-- then表示串行 -->
+		<when value="b,d"/> <!-- when表示串行 -->
+		<then value="e,f,g"/>
+	</chain>
+
+	<chain name="chain3">
+		<then value="a,c,h,g"/>
+	</chain>
+
+	<chain name="strategy1">
+		<then value="m(m1|m2|m3)"/>
+	</chain>
+
+	<chain name="strategy2">
+		<then value="p(p1|p2)"/>
+	</chain>
+</flow>

+ 1 - 1
liteflow-test/src/test/java/com/thebeastshop/flowtest/FlowtestApplicationTests.java → liteflow-test-springboot/src/test/java/com/yomahub/flowtest/FlowtestApplicationTests.java

@@ -1,4 +1,4 @@
-package com.thebeastshop.flowtest;
+package com.yomahub.flowtest;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;

+ 90 - 15
pom.xml

@@ -1,11 +1,40 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<groupId>com.thebeastshop</groupId>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.yomahub</groupId>
     <artifactId>liteflow</artifactId>
     <packaging>pom</packaging>
-    <modelVersion>4.0.0</modelVersion>
-    <version>2.1.3</version>
+    <version>2.2.0-SNAPSHOT</version>
+	<description>a lightweight and practical micro-process framework</description>
+
+	<licenses>
+		<license>
+			<name>MIT License</name>
+			<url>https://opensource.org/licenses/MIT</url>
+			<distribution>repo</distribution>
+		</license>
+	</licenses>
+
+	<developers>
+		<developer>
+			<email>weenyc31@163.com</email>
+			<name>bryan.zhang</name>
+			<url>https://github.com/bryan31</url>
+			<id>bryan31</id>
+		</developer>
+	</developers>
+
+	<issueManagement>
+		<system>Github Issue</system>
+		<url>https://github.com/bryan31/liteflow/issues</url>
+	</issueManagement>
+
+	<scm>
+		<connection>scm:git@github.com:bryan31/liteflow.git</connection>
+		<developerConnection>scm:git@github.com:bryan31/liteflow.git</developerConnection>
+		<url>git@github.com:bryan31/liteflow.git</url>
+	</scm>
 
     <properties>
     	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -134,27 +163,73 @@
 					<skipTests>true</skipTests>
 				</configuration>
 			</plugin>
+			<plugin>
+				<artifactId>maven-source-plugin</artifactId>
+				<version>2.4</version>
+				<configuration>
+					<attach>true</attach>
+				</configuration>
+				<executions>
+					<execution>
+						<phase>package</phase>
+						<goals>
+							<goal>jar-no-fork</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-site-plugin</artifactId>
+				<version>3.7.1</version>
+			</plugin>
+			<!-- Javadoc -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-javadoc-plugin</artifactId>
+				<version>3.0.1</version>
+				<executions>
+					<execution>
+						<phase>package</phase>
+						<goals>
+							<goal>jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<!-- Gpg Signature -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-gpg-plugin</artifactId>
+				<version>1.6</version>
+				<executions>
+					<execution>
+						<id>sign-artifacts</id>
+						<phase>verify</phase>
+						<goals>
+							<goal>sign</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
         </plugins>
     </build>
 
     <modules>
         <module>liteflow-core</module>
-		<module>liteflow-test</module>
-		<module>liteflow-spring-boot-starter</module>
+        <module>liteflow-spring-boot-starter</module>
+		<module>liteflow-test-springboot</module>
+		<module>liteflow-test-spring</module>
 	</modules>
 
-	<!--
 	<distributionManagement>
-		<repository>
-			<id>nexus-releases</id>
-			<name>nexus-releases</name>
-			<url>http://118.178.236.200:8087/nexus/content/repositories/thirdparty</url>
-		</repository>
 		<snapshotRepository>
-			<id>nexus-snapshots</id>
-			<name>nexus-snapshots</name>
-			<url>http://118.178.236.200:8087/nexus/content/repositories/snapshots</url>
+			<id>sonatype</id>
+			<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
 		</snapshotRepository>
+		<repository>
+			<id>sonatype</id>
+			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+		</repository>
 	</distributionManagement>
-	-->
 </project>