diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/aop/ICmpAroundAspect.java b/liteflow-core/src/main/java/com/yomahub/liteflow/aop/ICmpAroundAspect.java
index 7a2421d17..410a959c4 100644
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/aop/ICmpAroundAspect.java
+++ b/liteflow-core/src/main/java/com/yomahub/liteflow/aop/ICmpAroundAspect.java
@@ -16,7 +16,7 @@ import com.yomahub.liteflow.entity.data.Slot;
*/
public interface ICmpAroundAspect {
- void beforeProcess(Slot slot);
+ void beforeProcess(String nodeId, Slot slot);
- void afterProcess(Slot slot);
+ void afterProcess(String nodeId, Slot slot);
}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java b/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java
index 6818e5b78..418d4fc69 100644
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java
+++ b/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java
@@ -1,7 +1,6 @@
/**
*
Title: liteflow
* Description: 轻量级的组件式流程框架
- *
* @author Bryan.Zhang
* @email weenyc31@163.com
* @Date 2020/4/1
@@ -199,6 +198,13 @@ public class FlowExecutor {
return execute(chainId, param, DefaultSlot.class, null, false);
}
+ public LiteflowResponse execute(String chainId, Object param, Class extends Slot> slotClazz) throws Exception {
+ return execute(chainId, param, slotClazz,null,false);
+ }
+
+ public LiteflowResponse execute(String chainId, Object param, Class extends Slot> slotClazz, Integer slotIndex,
+ boolean isInnerChain) throws Exception {
+ Slot slot = null;
public LiteflowResponse execute(String chainId, Object param, Class extends Slot> slotClazz) throws Exception {
return execute(chainId, param, slotClazz, null, false);
}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java b/liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java
index 927e4a17a..1f2f06074 100644
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java
+++ b/liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java
@@ -34,13 +34,17 @@ public abstract class NodeComponent {
private static final Logger LOG = LoggerFactory.getLogger(NodeComponent.class);
- private TransmittableThreadLocal slotIndexTL = new TransmittableThreadLocal();
+ private TransmittableThreadLocal slotIndexTL = new TransmittableThreadLocal<>();
@Autowired(required = false)
private MonitorBus monitorBus;
private String nodeId;
+ //这是自己的实例,取代this
+ //为何要设置这个,用this不行么,因为如果有aop去切的话,this在spring的aop里是切不到的。self对象有可能是代理过的对象
+ private NodeComponent self;
+
//是否结束整个流程,这个只对串行流程有效,并行流程无效
private TransmittableThreadLocal isEndTL = new TransmittableThreadLocal<>();
@@ -53,14 +57,14 @@ public abstract class NodeComponent {
// process前置处理
if (ObjectUtil.isNotNull(ComponentScaner.cmpAroundAspect)) {
- ComponentScaner.cmpAroundAspect.beforeProcess(slot);
+ ComponentScaner.cmpAroundAspect.beforeProcess(this.getNodeId(), slot);
}
- process();
+ self.process();
// process后置处理
if (ObjectUtil.isNotNull(ComponentScaner.cmpAroundAspect)) {
- ComponentScaner.cmpAroundAspect.afterProcess(slot);
+ ComponentScaner.cmpAroundAspect.afterProcess(this.getNodeId(), slot);
}
stopWatch.stop();
@@ -154,4 +158,12 @@ public abstract class NodeComponent {
public void setNodeId(String nodeId) {
this.nodeId = nodeId;
}
+
+ public NodeComponent getSelf() {
+ return self;
+ }
+
+ public void setSelf(NodeComponent self) {
+ this.self = self;
+ }
}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java
index 4ce599809..e98efc9bf 100644
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java
+++ b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java
@@ -14,6 +14,7 @@ import cn.hutool.core.map.MapUtil;
import com.yomahub.liteflow.entity.flow.Chain;
import com.yomahub.liteflow.entity.flow.Node;
+import com.yomahub.liteflow.util.SpringAware;
/**
* 流程元数据类
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/spring/ComponentScaner.java b/liteflow-core/src/main/java/com/yomahub/liteflow/spring/ComponentScaner.java
index 2eafea230..136b3aea4 100644
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/spring/ComponentScaner.java
+++ b/liteflow-core/src/main/java/com/yomahub/liteflow/spring/ComponentScaner.java
@@ -14,6 +14,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor;
import org.springframework.core.Ordered;
import org.springframework.core.PriorityOrdered;
@@ -25,7 +26,7 @@ import com.yomahub.liteflow.util.LOGOPrinter;
* 组件扫描类,只要是NodeComponent的实现类,都可以被这个扫描器扫到
* @author Bryan.Zhang
*/
-public class ComponentScaner implements BeanPostProcessor, PriorityOrdered {
+public class ComponentScaner implements InstantiationAwareBeanPostProcessor {
private static final Logger LOG = LoggerFactory.getLogger(ComponentScaner.class);
@@ -39,19 +40,20 @@ public class ComponentScaner implements BeanPostProcessor, PriorityOrdered {
}
@Override
- public int getOrder() {
- return Ordered.LOWEST_PRECEDENCE;
+ public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
+ return bean;
}
@SuppressWarnings("rawtypes")
@Override
- public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
+ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
Class clazz = bean.getClass();
// 组件的扫描发现,扫到之后缓存到类属性map中
if (NodeComponent.class.isAssignableFrom(clazz)) {
LOG.info("component[{}] has been found", beanName);
NodeComponent nodeComponent = (NodeComponent) bean;
nodeComponent.setNodeId(beanName);
+ nodeComponent.setSelf(nodeComponent);
nodeComponentMap.put(beanName, nodeComponent);
}
@@ -63,9 +65,4 @@ public class ComponentScaner implements BeanPostProcessor, PriorityOrdered {
return bean;
}
-
- @Override
- public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
- return bean;
- }
}
diff --git a/liteflow-spring-boot-starter/pom.xml b/liteflow-spring-boot-starter/pom.xml
index 57b54e9c5..8430bb604 100644
--- a/liteflow-spring-boot-starter/pom.xml
+++ b/liteflow-spring-boot-starter/pom.xml
@@ -22,12 +22,12 @@
org.springframework.boot
spring-boot-autoconfigure
- 2.0.5.RELEASE
+ ${springboot.version}
org.springframework.boot
spring-boot-configuration-processor
- 2.0.5.RELEASE
+ ${springboot.version}
@@ -36,6 +36,7 @@
org.springframework.boot
spring-boot-maven-plugin
+ ${springboot.version}
org.apache.maven.plugins
diff --git a/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowComponentScannerAutoConfiguration.java b/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowComponentScannerAutoConfiguration.java
index efeb21516..a415dbf8c 100644
--- a/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowComponentScannerAutoConfiguration.java
+++ b/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowComponentScannerAutoConfiguration.java
@@ -3,12 +3,14 @@ package com.yomahub.liteflow.springboot;
import com.yomahub.liteflow.spring.ComponentScaner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
/**
* 组件扫描器自动装配类
* @author Bryan.Zhang
*/
@Configuration
+@EnableAspectJAutoProxy(exposeProxy = true)
public class LiteflowComponentScannerAutoConfiguration {
@Bean
diff --git a/liteflow-spring-boot-starter/src/main/resources/META-INF/liteflow-default.properties b/liteflow-spring-boot-starter/src/main/resources/META-INF/liteflow-default.properties
index 60ac4ce71..832357d8e 100644
--- a/liteflow-spring-boot-starter/src/main/resources/META-INF/liteflow-default.properties
+++ b/liteflow-spring-boot-starter/src/main/resources/META-INF/liteflow-default.properties
@@ -1,6 +1,6 @@
liteflow.rule-source=config/flow.xml
liteflow.slot-size=1024
-liteflow.when-max-wait-second=15
+liteflow.when-max-wait-seconds=15
liteflow.when-max-workers=4
liteflow.when-queue-limit=512
liteflow.monitor.enable-log=false
diff --git a/liteflow-test-spring/pom.xml b/liteflow-test-spring/pom.xml
index 1e6b94083..ab7150a40 100644
--- a/liteflow-test-spring/pom.xml
+++ b/liteflow-test-spring/pom.xml
@@ -53,7 +53,14 @@
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.18.1
+
+
+ org.apache.maven.plugins
maven-deploy-plugin
+ 2.8.2
true
diff --git a/liteflow-test-springboot/pom.xml b/liteflow-test-springboot/pom.xml
index 389664a49..207a2a203 100644
--- a/liteflow-test-springboot/pom.xml
+++ b/liteflow-test-springboot/pom.xml
@@ -18,7 +18,7 @@
org.springframework.boot
spring-boot-dependencies
- 2.0.5.RELEASE
+ ${springboot.version}
pom
import
diff --git a/liteflow-test-springboot/src/main/java/com/yomahub/flowtest/aspect/ComponentAspect.java b/liteflow-test-springboot/src/main/java/com/yomahub/flowtest/aspect/ComponentAspect.java
index aba478de7..48898ec45 100644
--- a/liteflow-test-springboot/src/main/java/com/yomahub/flowtest/aspect/ComponentAspect.java
+++ b/liteflow-test-springboot/src/main/java/com/yomahub/flowtest/aspect/ComponentAspect.java
@@ -7,12 +7,12 @@ import org.springframework.stereotype.Component;
@Component
public class ComponentAspect implements ICmpAroundAspect {
@Override
- public void beforeProcess(Slot slot) {
+ public void beforeProcess(String nodeId, Slot slot) {
System.out.println("before process");
}
@Override
- public void afterProcess(Slot slot) {
+ public void afterProcess(String nodeId, Slot slot) {
System.out.println("after process");
}
}
diff --git a/liteflow-test/pom.xml b/liteflow-test/pom.xml
new file mode 100644
index 000000000..89c137087
--- /dev/null
+++ b/liteflow-test/pom.xml
@@ -0,0 +1,76 @@
+
+
+
+ liteflow
+ com.yomahub
+ 2.5.0-SNAPSHOT
+
+ 4.0.0
+
+ liteflow-test
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-dependencies
+ ${springboot.version}
+ pom
+ import
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+
+
+
+ com.yomahub
+ liteflow-spring-boot-starter
+ ${project.parent.version}
+
+
+
+ org.aspectj
+ aspectjweaver
+ 1.8.13
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+ true
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ ${springboot.version}
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ 2.8.2
+
+ true
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/LFCustomAOPTest.java b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/LFCustomAOPTest.java
new file mode 100644
index 000000000..b6b67f2cc
--- /dev/null
+++ b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/LFCustomAOPTest.java
@@ -0,0 +1,56 @@
+package com.yomahub.liteflow.test.aop;
+
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.LiteflowResponse;
+import com.yomahub.liteflow.entity.data.Slot;
+import com.yomahub.liteflow.test.aop.aspect.CustomAspect;
+import com.yomahub.liteflow.test.aop.cmp1.ACmp;
+import com.yomahub.liteflow.util.SpringAware;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Import;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+
+/**
+ * 切面场景单元测试
+ * @author Bryan.Zhang
+ */
+@RunWith(SpringRunner.class)
+@ActiveProfiles("aop")
+@SpringBootTest(classes = LFCustomAOPTest.class)
+@EnableAutoConfiguration
+@Import(CustomAspect.class)
+@ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"})
+public class LFCustomAOPTest {
+
+ @Resource
+ private FlowExecutor flowExecutor;
+
+ //测试自定义AOP,串行场景
+ @Test
+ public void testCustomAopS() throws Exception{
+ LiteflowResponse response= flowExecutor.execute("chain1", "it's a request");
+ Assert.assertTrue(response.isSuccess());
+ Assert.assertEquals("before_after", response.getData().getData("a"));
+ Assert.assertEquals("before_after", response.getData().getData("b"));
+ Assert.assertEquals("before_after", response.getData().getData("c"));
+ }
+
+ //测试自定义AOP,并行场景
+ @Test
+ public void testCustomAopP() throws Exception{
+ LiteflowResponse response= flowExecutor.execute("chain2", "it's a request");
+ Assert.assertTrue(response.isSuccess());
+ Assert.assertEquals("before_after", response.getData().getData("a"));
+ Assert.assertEquals("before_after", response.getData().getData("b"));
+ Assert.assertEquals("before_after", response.getData().getData("c"));
+ }
+}
diff --git a/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/LFGlobalAOPTest.java b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/LFGlobalAOPTest.java
new file mode 100644
index 000000000..d060bfc00
--- /dev/null
+++ b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/LFGlobalAOPTest.java
@@ -0,0 +1,57 @@
+package com.yomahub.liteflow.test.aop;
+
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.entity.data.LiteflowResponse;
+import com.yomahub.liteflow.entity.data.Slot;
+import com.yomahub.liteflow.test.aop.aspect.CmpAspect;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Import;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+
+/**
+ * 切面场景单元测试
+ * @author Bryan.Zhang
+ */
+@RunWith(SpringRunner.class)
+@ActiveProfiles("aop")
+@SpringBootTest(classes = LFGlobalAOPTest.class)
+@EnableAutoConfiguration
+@Import(CmpAspect.class)
+@ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"})
+public class LFGlobalAOPTest {
+
+ @Resource
+ private FlowExecutor flowExecutor;
+
+ //测试全局AOP,串行场景
+ @Test
+ public void testGlobalAopS() throws Exception{
+ LiteflowResponse response= flowExecutor.execute("chain1", "it's a request");
+ Assert.assertTrue(response.isSuccess());
+ Assert.assertEquals("before_after", response.getData().getData("a"));
+ Assert.assertEquals("before_after", response.getData().getData("b"));
+ Assert.assertEquals("before_after", response.getData().getData("c"));
+ Assert.assertEquals("before_after", response.getData().getData("d"));
+ Assert.assertEquals("before_after", response.getData().getData("e"));
+ }
+
+ //测试全局AOP,并行场景
+ @Test
+ public void testGlobalAopP() throws Exception{
+ LiteflowResponse response= flowExecutor.execute("chain2", "it's a request");
+ Assert.assertTrue(response.isSuccess());
+ Assert.assertEquals("before_after", response.getData().getData("a"));
+ Assert.assertEquals("before_after", response.getData().getData("b"));
+ Assert.assertEquals("before_after", response.getData().getData("c"));
+ Assert.assertEquals("before_after", response.getData().getData("d"));
+ Assert.assertEquals("before_after", response.getData().getData("e"));
+ }
+}
diff --git a/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java
new file mode 100644
index 000000000..028d5801b
--- /dev/null
+++ b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java
@@ -0,0 +1,18 @@
+package com.yomahub.liteflow.test.aop.aspect;
+
+import cn.hutool.core.util.StrUtil;
+import com.yomahub.liteflow.aop.ICmpAroundAspect;
+import com.yomahub.liteflow.entity.data.Slot;
+import org.springframework.stereotype.Component;
+
+public class CmpAspect implements ICmpAroundAspect {
+ @Override
+ public void beforeProcess(String nodeId, Slot slot) {
+ slot.setData(nodeId, "before");
+ }
+
+ @Override
+ public void afterProcess(String nodeId, Slot slot) {
+ slot.setData(nodeId, StrUtil.format("{}_{}", slot.getData(nodeId), "after"));
+ }
+}
diff --git a/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java
new file mode 100644
index 000000000..7277a8ac5
--- /dev/null
+++ b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java
@@ -0,0 +1,27 @@
+package com.yomahub.liteflow.test.aop.aspect;
+
+import cn.hutool.core.util.StrUtil;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.Slot;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+
+@Aspect
+public class CustomAspect {
+
+ @Pointcut("execution(* com.yomahub.liteflow.test.aop.cmp1.*.process())")
+ public void cut() {
+ }
+
+ @Around("cut()")
+ public Object around(ProceedingJoinPoint jp) throws Throwable {
+ NodeComponent cmp = (NodeComponent) jp.getThis();
+ Slot slot = cmp.getSlot();
+ slot.setData(cmp.getNodeId(), "before");
+ Object returnObj = jp.proceed();
+ slot.setData(cmp.getNodeId(), StrUtil.format("{}_{}", slot.getData(cmp.getNodeId()), "after"));
+ return returnObj;
+ }
+}
diff --git a/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java
new file mode 100644
index 000000000..7fd947163
--- /dev/null
+++ b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.aop.cmp1;
+
+import com.yomahub.liteflow.core.NodeComponent;
+import org.springframework.stereotype.Component;
+
+@Component("a")
+public class ACmp extends NodeComponent {
+
+ @Override
+ public void process() {
+ System.out.println("Acomp executed!");
+ }
+
+}
diff --git a/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java
new file mode 100644
index 000000000..d99d2a1e6
--- /dev/null
+++ b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.aop.cmp1;
+
+import com.yomahub.liteflow.core.NodeComponent;
+import org.springframework.stereotype.Component;
+
+@Component("b")
+public class BCmp extends NodeComponent {
+
+ @Override
+ public void process() {
+ System.out.println("Bcomp executed!");
+ }
+
+}
diff --git a/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java
new file mode 100644
index 000000000..7a2181438
--- /dev/null
+++ b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.aop.cmp1;
+
+import com.yomahub.liteflow.core.NodeComponent;
+import org.springframework.stereotype.Component;
+
+@Component("c")
+public class CCmp extends NodeComponent {
+
+ @Override
+ public void process() {
+ System.out.println("Ccomp executed!");
+ }
+
+}
diff --git a/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java
new file mode 100644
index 000000000..eb8ae7648
--- /dev/null
+++ b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.aop.cmp2;
+
+import com.yomahub.liteflow.core.NodeComponent;
+import org.springframework.stereotype.Component;
+
+@Component("d")
+public class DCmp extends NodeComponent {
+
+ @Override
+ public void process() {
+ System.out.println("Dcomp executed!");
+ }
+
+}
diff --git a/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java
new file mode 100644
index 000000000..ce0319d44
--- /dev/null
+++ b/liteflow-test/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.aop.cmp2;
+
+import com.yomahub.liteflow.core.NodeComponent;
+import org.springframework.stereotype.Component;
+
+@Component("e")
+public class ECmp extends NodeComponent {
+
+ @Override
+ public void process() {
+ System.out.println("Ecomp executed!");
+ }
+
+}
diff --git a/liteflow-test/src/test/resources/aop/flow.xml b/liteflow-test/src/test/resources/aop/flow.xml
new file mode 100644
index 000000000..fcbc8b715
--- /dev/null
+++ b/liteflow-test/src/test/resources/aop/flow.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-test/src/test/resources/application-aop.properties b/liteflow-test/src/test/resources/application-aop.properties
new file mode 100644
index 000000000..f9075d1c6
--- /dev/null
+++ b/liteflow-test/src/test/resources/application-aop.properties
@@ -0,0 +1 @@
+liteflow.rule-source=aop/flow.xml
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 5046a8e76..79c64827f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,6 +41,7 @@
UTF-8
1.8
+ 2.0.5.RELEASE
5.0.9.RELEASE
1.7.21
1.2.17
@@ -216,6 +217,7 @@
liteflow-core
liteflow-spring-boot-starter
+ liteflow-test
liteflow-test-springboot
liteflow-test-spring