#feature #I581A1 @LiteflowRetry优化,只允许再Process方法上注解 优化Import包,优化部分单词拼写错误,修复初始化存在的可能bug,增加部分注释,@LiteflowComponent再cmpCofig中代替@Component
This commit is contained in:
parent
cbff63fc17
commit
e0374817e2
|
@ -1,7 +1,6 @@
|
|||
package com.yomahub.liteflow.annotation;
|
||||
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
@ -22,5 +21,5 @@ public @interface LiteflowMethod {
|
|||
* cmp定义
|
||||
*
|
||||
*/
|
||||
AnnotionNodeTypeEnum nodeType() default AnnotionNodeTypeEnum.COMMON;
|
||||
AnnotationNodeTypeEnum nodeType() default AnnotationNodeTypeEnum.COMMON;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
package com.yomahub.liteflow.core.proxy;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.*;
|
||||
import cn.hutool.core.lang.Tuple;
|
||||
import cn.hutool.core.util.ClassUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.annotation.LiteflowRetry;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.exception.ComponentMethodDefineErrorException;
|
||||
import com.yomahub.liteflow.exception.LiteFlowException;
|
||||
import com.yomahub.liteflow.util.LiteFlowProxyUtil;
|
||||
|
@ -20,7 +25,11 @@ import java.lang.annotation.Annotation;
|
|||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -60,40 +69,67 @@ public class ComponentProxy {
|
|||
));
|
||||
|
||||
return methodListMap.entrySet().stream().map(entry -> {
|
||||
// 获取当前节点的原有注解,如:LiteFlowRetry 之类的规则注解
|
||||
Annotation[] beanClassAnnotation = bean.getClass().getAnnotations();
|
||||
// 如果entry的key为空字符串,则是为了兼容老版本的写法,即:没有指定nodeId的情况
|
||||
// 判断是否是方法级创造节点
|
||||
boolean isMethodCreate = !StrUtil.isEmpty(entry.getKey());
|
||||
// 获取当前bean 真实的nodeId
|
||||
String activeNodeId = isMethodCreate ? entry.getKey() : nodeId;
|
||||
// 获取当前节点所有的@LiteflowRetry @LiteflowMethod注解对
|
||||
List<Tuple> tupleList = entry.getValue().stream().map(m ->
|
||||
new Tuple(m.getAnnotation(LiteflowRetry.class), m.getAnnotation(LiteflowMethod.class))
|
||||
).collect(Collectors.toList());
|
||||
// 获取当前节点的所有LiteFlowMethod注解
|
||||
List<LiteflowMethod> methodList = entry.getValue().stream()
|
||||
.map(m -> m.getAnnotation(LiteflowMethod.class))
|
||||
List<LiteflowMethod> methodList = tupleList.stream().map(tuple -> ((LiteflowMethod)tuple.get(1)))
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
// 一个节点只能有一个定义NodeCmp类
|
||||
List<? extends Class<? extends NodeComponent>> classes = methodList.stream().map(LiteflowMethod::nodeType).map(AnnotionNodeTypeEnum::getCmpClass).distinct().collect(Collectors.toList());
|
||||
// nodeType去重
|
||||
List<? extends Class<? extends NodeComponent>> classes = methodList.stream()
|
||||
.map(LiteflowMethod::nodeType)
|
||||
.map(AnnotationNodeTypeEnum::getCmpClass)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
// 相同nodeId里只能定义同一种的类型的NodeComponent
|
||||
boolean legal = classes.size() == 1;
|
||||
if (!legal){
|
||||
throw new LiteFlowException("The cmpClass of the same nodeId must be the same,you declared nodeId:" + activeNodeId + ",cmpClass:" + classes);
|
||||
}
|
||||
// 获取当前节点的所有LiteflowRetry注解
|
||||
List<LiteflowRetry> liteflowRetries = entry.getValue().stream()
|
||||
.map(m -> m.getAnnotation(LiteflowRetry.class))
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
// 一个nodeCmp只能有一个LiteflowRetry定义方法
|
||||
legal = liteflowRetries.size() <= 1;
|
||||
if (!legal){
|
||||
throw new LiteFlowException("the retry annotation must be declared in the one of declared methods ( PROCESS Method is better ),you declared "+ liteflowRetries.size()+" times.");
|
||||
// 当前节点实际LiteflowRetry注解
|
||||
AtomicReference<LiteflowRetry> liteflowRetryAtomicReference = new AtomicReference<>(null);
|
||||
// 相同nodeId只能有一个LiteflowRetry定义方法,且必须再Process方法上
|
||||
boolean illegal = tupleList.stream().anyMatch(
|
||||
tuple -> {
|
||||
LiteflowRetry liteflowRetry = tuple.get(0);
|
||||
LiteflowMethod liteflowMethod = tuple.get(1);
|
||||
boolean existRetry = liteflowRetry != null;
|
||||
boolean isProcess = liteflowMethod.value().equals(LiteFlowMethodEnum.PROCESS)
|
||||
|| liteflowMethod.value().equals(LiteFlowMethodEnum.PROCESS_IF)
|
||||
|| liteflowMethod.value().equals(LiteFlowMethodEnum.PROCESS_SWITCH);
|
||||
// 如果是再Process方法上的liteflowRetry注解,则默认为真实节点。
|
||||
if (isProcess && existRetry) {
|
||||
liteflowRetryAtomicReference.set(liteflowRetry);
|
||||
}
|
||||
// 如果存在existRetry注解,但是不是在Process方法上,则为非法
|
||||
return existRetry && !isProcess;
|
||||
}
|
||||
);
|
||||
if (illegal){
|
||||
throw new LiteFlowException("the retry annotation (@LiteflowRetry) must be declared on the PROCESS method");
|
||||
}
|
||||
Class<?> cmpClass;
|
||||
cmpClass = clazz;
|
||||
// 生成nodeCmp的类型,默认为全局定义的clazz
|
||||
Class<?> cmpClazz;
|
||||
cmpClazz = clazz;
|
||||
// 判断是否是方法声明的组件
|
||||
if (isMethodCreate){
|
||||
cmpClass = methodList.iterator().next().nodeType().getCmpClass();
|
||||
if (liteflowRetries.size() == 1){
|
||||
// 增加注解
|
||||
cmpClazz = methodList.iterator().next().nodeType().getCmpClass();
|
||||
LiteflowRetry liteflowRetry;
|
||||
if ((liteflowRetry = liteflowRetryAtomicReference.get()) != null){
|
||||
// 增加LiteFlowRetry注解到注解数组里
|
||||
List<Annotation> annotations = Arrays.stream(beanClassAnnotation)
|
||||
.filter(a -> !a.annotationType().equals(LiteflowRetry.class))
|
||||
.collect(Collectors.toList());
|
||||
annotations.add(liteflowRetries.get(0));
|
||||
annotations.add(liteflowRetry);
|
||||
beanClassAnnotation = new Annotation[annotations.size()];
|
||||
annotations.toArray(beanClassAnnotation);
|
||||
}
|
||||
|
@ -103,7 +139,7 @@ public class ComponentProxy {
|
|||
//这里package进行了重设,放到了被代理对象的所在目录
|
||||
//生成的对象也加了上被代理对象拥有的注解
|
||||
//被拦截的对象也根据被代理对象根据@LiteFlowMethod所标注的进行了动态判断
|
||||
Object instance = new ByteBuddy().subclass(cmpClass)
|
||||
Object instance = new ByteBuddy().subclass(cmpClazz)
|
||||
.name(StrUtil.format("{}.ByteBuddy${}${}",
|
||||
ClassUtil.getPackage(bean.getClass()),
|
||||
activeNodeId,
|
||||
|
@ -116,6 +152,7 @@ public class ComponentProxy {
|
|||
.getLoaded()
|
||||
.newInstance();
|
||||
NodeComponent nodeComponent = (NodeComponent) instance;
|
||||
// 重设nodeId
|
||||
nodeComponent.setNodeId(activeNodeId);
|
||||
return nodeComponent;
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -3,15 +3,14 @@ package com.yomahub.liteflow.enums;
|
|||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.core.NodeIfComponent;
|
||||
import com.yomahub.liteflow.core.NodeSwitchComponent;
|
||||
import jdk.nashorn.internal.objects.annotations.Getter;
|
||||
|
||||
/**
|
||||
* 注解节点类型枚举
|
||||
*
|
||||
* @author Sorghum
|
||||
* @date 2022/09/08
|
||||
* @since 2.9.0
|
||||
*/
|
||||
public enum AnnotionNodeTypeEnum {
|
||||
public enum AnnotationNodeTypeEnum {
|
||||
/**
|
||||
* 普通节点
|
||||
*/
|
||||
|
@ -33,7 +32,7 @@ public enum AnnotionNodeTypeEnum {
|
|||
*/
|
||||
final Class<? extends NodeComponent> cmpClass;
|
||||
|
||||
AnnotionNodeTypeEnum(String desc, Class<? extends NodeComponent> cmpClass) {
|
||||
AnnotationNodeTypeEnum(String desc, Class<? extends NodeComponent> cmpClass) {
|
||||
this.desc = desc;
|
||||
this.cmpClass = cmpClass;
|
||||
}
|
|
@ -14,12 +14,12 @@ import cn.hutool.core.map.MapUtil;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yomahub.liteflow.core.*;
|
||||
import com.yomahub.liteflow.exception.NullNodeTypeException;
|
||||
import com.yomahub.liteflow.flow.element.Chain;
|
||||
import com.yomahub.liteflow.flow.element.Node;
|
||||
import com.yomahub.liteflow.enums.FlowParserTypeEnum;
|
||||
import com.yomahub.liteflow.enums.NodeTypeEnum;
|
||||
import com.yomahub.liteflow.exception.ComponentCannotRegisterException;
|
||||
import com.yomahub.liteflow.exception.NullNodeTypeException;
|
||||
import com.yomahub.liteflow.flow.element.Chain;
|
||||
import com.yomahub.liteflow.flow.element.Node;
|
||||
import com.yomahub.liteflow.parser.LocalJsonFlowParser;
|
||||
import com.yomahub.liteflow.parser.LocalXmlFlowParser;
|
||||
import com.yomahub.liteflow.parser.LocalYmlFlowParser;
|
||||
|
@ -191,7 +191,9 @@ public class FlowBus {
|
|||
}
|
||||
}
|
||||
//进行初始化
|
||||
cmpInstances = cmpInstances.stream().map(cmpInstance -> ComponentInitializer.loadInstance().initComponent(cmpInstance, type, name, nodeId)).collect(Collectors.toList());
|
||||
cmpInstances = cmpInstances.stream()
|
||||
.map(
|
||||
cmpInstance -> ComponentInitializer.loadInstance().initComponent(cmpInstance, type, name, cmpInstance.getNodeId() == null ? nodeId : cmpInstance.getNodeId())).collect(Collectors.toList());
|
||||
|
||||
//初始化Node
|
||||
List<Node> nodes = cmpInstances.stream().map(Node::new).collect(Collectors.toList());
|
||||
|
@ -214,7 +216,6 @@ public class FlowBus {
|
|||
nodeMap.put(activeNodeId, node);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
String error = StrUtil.format("component[{}] register error", StrUtil.isEmpty(name)?nodeId:StrUtil.format("{}({})",nodeId,name));
|
||||
LOG.error(error);
|
||||
throw new ComponentCannotRegisterException(error);
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
package com.yomahub.liteflow.util;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
|
||||
import com.yomahub.liteflow.annotation.LiteflowIfCmpDefine;
|
||||
import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.core.NodeIfComponent;
|
||||
import com.yomahub.liteflow.core.NodeSwitchComponent;
|
||||
import com.yomahub.liteflow.core.proxy.ComponentProxy;
|
||||
import com.yomahub.liteflow.exception.ComponentProxyErrorException;
|
||||
import com.yomahub.liteflow.exception.LiteFlowException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class LiteFlowProxyUtil {
|
|||
}else{
|
||||
targetClass = clazz;
|
||||
}
|
||||
// 判断是否有方法标记了@LiteflowMethod标注
|
||||
// 判断是否有方法标记了@LiteflowMethod标注,有则为声明式组件
|
||||
return Arrays.stream(targetClass.getMethods()).anyMatch(
|
||||
method -> method.getAnnotation(LiteflowMethod.class) != null
|
||||
);
|
||||
|
@ -67,7 +67,10 @@ public class LiteFlowProxyUtil {
|
|||
return proxy.getProxyList();
|
||||
}
|
||||
return new ComponentProxy(nodeId, bean, NodeIfComponent.class).getProxyList();
|
||||
}catch (Exception e){
|
||||
}catch (LiteFlowException liteFlowException){
|
||||
throw liteFlowException;
|
||||
}
|
||||
catch (Exception e){
|
||||
String errMsg = StrUtil.format("Error while proxying bean[{}]",bean.getClass().getName());
|
||||
LOG.error(errMsg);
|
||||
throw new ComponentProxyErrorException(errMsg);
|
||||
|
|
|
@ -7,16 +7,16 @@
|
|||
*/
|
||||
package com.yomahub.liteflow.test.absoluteConfigPath.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component()
|
||||
@LiteflowComponent
|
||||
public class CmpMultiDefine{
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a",nodeType = AnnotionNodeTypeEnum.COMMON)
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a",nodeType = AnnotationNodeTypeEnum.COMMON)
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
System.out.println("ACmp executed!");
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.yomahub.liteflow.test.aop.aspect;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import com.yomahub.liteflow.slot.Slot;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.yomahub.liteflow.test.aop.cmp1;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class Cmp1Config {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.yomahub.liteflow.test.aop.cmp2;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class Cmp2Config {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "d")
|
||||
public void processD(NodeComponent bindCmp) {
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
package com.yomahub.liteflow.test.asyncNode.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.core.NodeSwitchComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import com.yomahub.liteflow.test.asyncNode.exception.TestException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
@ -72,7 +71,7 @@ public class CmpConfig {
|
|||
System.out.println("Dcomp executed!");
|
||||
}
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "e",nodeType = AnnotionNodeTypeEnum.SWITCH)
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "e",nodeType = AnnotationNodeTypeEnum.SWITCH)
|
||||
public String processSwitchE(NodeComponent bindCmp) throws Exception {
|
||||
System.out.println("Ecomp executed!");
|
||||
return "g";
|
||||
|
@ -131,7 +130,7 @@ public class CmpConfig {
|
|||
throw new TestException();
|
||||
}
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "j",nodeType = AnnotionNodeTypeEnum.SWITCH)
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "j",nodeType = AnnotationNodeTypeEnum.SWITCH)
|
||||
public String processSwitchJ(NodeComponent bindCmp) throws Exception {
|
||||
System.out.println("Jcomp executed!");
|
||||
return "chain3";
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.yomahub.liteflow.test.base.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "a")
|
||||
|
|
|
@ -4,10 +4,10 @@ import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
|
|||
import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
|
||||
import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
|
||||
import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.builder.entity.ExecutableEntity;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.enums.NodeTypeEnum;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.test.BaseTest;
|
||||
import com.yomahub.liteflow.test.builder.cmp1.*;
|
||||
import org.junit.Assert;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.yomahub.liteflow.test.builder;
|
||||
|
||||
import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
|
||||
import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
|
||||
import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
package com.yomahub.liteflow.test.builder.cmp1;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.yomahub.liteflow.test.cmpRetry.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.annotation.LiteflowRetry;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
@ -46,6 +46,20 @@ public class CmpConfig {
|
|||
throw new NullPointerException("demo null exception");
|
||||
}
|
||||
|
||||
@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class})
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "f")
|
||||
public void processF(NodeComponent bindCmp) {
|
||||
System.out.println("ECmp executed!");
|
||||
throw new NullPointerException("demo null exception");
|
||||
}
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.AFTER_PROCESS,nodeId = "f")
|
||||
public void after(NodeComponent bindCmp) {
|
||||
System.out.println("ECmp executed!");
|
||||
throw new NullPointerException("demo null exception");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.yomahub.liteflow.test.cmpStep.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
package com.yomahub.liteflow.test.complex.cmp1;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.core.NodeSwitchComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig1 {
|
||||
|
||||
|
||||
|
@ -41,7 +40,7 @@ public class CmpConfig1 {
|
|||
|
||||
}
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "G",nodeType = AnnotionNodeTypeEnum.SWITCH)
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "G",nodeType = AnnotationNodeTypeEnum.SWITCH)
|
||||
public String processSwitchG(NodeComponent bindCmp) throws Exception {
|
||||
return "t1";
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.yomahub.liteflow.test.complex.cmp2;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig2 {
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ public class CmpConfig2 {
|
|||
|
||||
}
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeType = AnnotionNodeTypeEnum.SWITCH,nodeId = "B")
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeType = AnnotationNodeTypeEnum.SWITCH,nodeId = "B")
|
||||
public String processSwitchB(NodeComponent bindCmp) {
|
||||
return "t3";
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class CmpConfig2 {
|
|||
|
||||
}
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeType = AnnotionNodeTypeEnum.SWITCH,nodeId = "G")
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeType = AnnotationNodeTypeEnum.SWITCH,nodeId = "G")
|
||||
public String processSwitchG(NodeComponent bindCmp) throws Exception {
|
||||
return "t2";
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package com.yomahub.liteflow.test.component.cmp1;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig1 {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
package com.yomahub.liteflow.test.component.cmp2;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class FCondCmp{
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "f",nodeType = AnnotionNodeTypeEnum.SWITCH)
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "f",nodeType = AnnotationNodeTypeEnum.SWITCH)
|
||||
public String processSwitchF(NodeComponent bindCmp) {
|
||||
Integer requestData = bindCmp.getRequestData();
|
||||
if (Objects.isNull(requestData)){
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.yomahub.liteflow.test.customMethodName.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.slot.Slot;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.yomahub.liteflow.test.customWhenThreadPool.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.yomahub.liteflow.test.event.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.yomahub.liteflow.test.exception;
|
||||
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.exception.*;
|
||||
import com.yomahub.liteflow.exception.ChainNotFoundException;
|
||||
import com.yomahub.liteflow.exception.LiteFlowException;
|
||||
import com.yomahub.liteflow.exception.NoSwitchTargetNodeException;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.test.BaseTest;
|
||||
import org.junit.Assert;
|
||||
|
@ -12,7 +14,6 @@ import org.springframework.boot.test.context.SpringBootTest;
|
|||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package com.yomahub.liteflow.test.exception.cmp;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.test.exception.CustomStatefulException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(CmpConfig.class);
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class CmpConfig {
|
|||
LOG.info("Dcomp executed!");
|
||||
}
|
||||
////////
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "e",nodeType = AnnotionNodeTypeEnum.SWITCH)
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "e",nodeType = AnnotationNodeTypeEnum.SWITCH)
|
||||
public String processSwitchE(NodeComponent bindCmp) throws Exception {
|
||||
return "a";
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.yomahub.liteflow.test.execute2Future.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.yomahub.liteflow.test.extend.cmp;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.yomahub.liteflow.test.getChainName.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
@ -55,7 +55,7 @@ public class CmpConfig {
|
|||
context.setData(bindCmp.getNodeId(), bindCmp.getCurrChainName());
|
||||
}
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "h",nodeType = AnnotionNodeTypeEnum.SWITCH)
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "h",nodeType = AnnotationNodeTypeEnum.SWITCH)
|
||||
public String processSwitchH(NodeComponent bindCmp) throws Exception {
|
||||
DefaultContext context = bindCmp.getFirstContextBean();
|
||||
context.setData(bindCmp.getNodeId(), bindCmp.getCurrChainName());
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.yomahub.liteflow.test.ifelse.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
@ -33,7 +33,7 @@ public class CmpConfig {
|
|||
|
||||
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_IF,nodeId = "x1",nodeType = AnnotionNodeTypeEnum.IF)
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_IF,nodeId = "x1",nodeType = AnnotationNodeTypeEnum.IF)
|
||||
public boolean processIfX1(NodeComponent bindCmp) throws Exception {
|
||||
return Boolean.parseBoolean(bindCmp.getTag());
|
||||
}
|
||||
|
|
|
@ -1,18 +1,6 @@
|
|||
package com.yomahub.liteflow.test.lazy;
|
||||
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.test.BaseTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
//spring的延迟加载在el表达形式模式下不起作用
|
||||
/*@RunWith(SpringRunner.class)
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.yomahub.liteflow.test.monitor.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package com.yomahub.liteflow.test.multiContext.cmp;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.test.multiContext.CheckContext;
|
||||
import com.yomahub.liteflow.test.multiContext.OrderContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.yomahub.liteflow.test.multipleType.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package com.yomahub.liteflow.test.nodeExecutor;
|
||||
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.slot.DataBus;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import com.yomahub.liteflow.slot.Slot;
|
||||
import com.yomahub.liteflow.flow.executor.NodeExecutor;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
|
||||
/**
|
||||
* 自定义默认的节点执行器
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package com.yomahub.liteflow.test.nodeExecutor;
|
||||
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.slot.DataBus;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import com.yomahub.liteflow.slot.Slot;
|
||||
import com.yomahub.liteflow.flow.executor.NodeExecutor;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
|
||||
/**
|
||||
* 自定义节点执行器
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package com.yomahub.liteflow.test.nodeExecutor;
|
||||
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.slot.DataBus;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import com.yomahub.liteflow.slot.Slot;
|
||||
import com.yomahub.liteflow.flow.executor.NodeExecutor;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.yomahub.liteflow.test.nodeExecutor.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.annotation.LiteflowRetry;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
|
@ -7,9 +8,8 @@ import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
|||
import com.yomahub.liteflow.flow.executor.NodeExecutor;
|
||||
import com.yomahub.liteflow.test.nodeExecutor.CustomerNodeExecutor;
|
||||
import com.yomahub.liteflow.test.nodeExecutor.CustomerNodeExecutorAndCustomRetry;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package com.yomahub.liteflow.test.parsecustom.cmp;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.exception.FlowSystemException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
@ -39,7 +39,7 @@ public class CmpConfig {
|
|||
}
|
||||
|
||||
///////////////////
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "e",nodeType = AnnotionNodeTypeEnum.SWITCH)
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "e",nodeType = AnnotationNodeTypeEnum.SWITCH)
|
||||
public String processSwitchE(NodeComponent bindCmp) throws Exception {
|
||||
return "g";
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.yomahub.liteflow.test.parser.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
//////////////////
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
@ -32,7 +32,7 @@ public class CmpConfig {
|
|||
}
|
||||
|
||||
//////////////////
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "e",nodeType = AnnotionNodeTypeEnum.SWITCH)
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "e",nodeType = AnnotationNodeTypeEnum.SWITCH)
|
||||
public String processSwitchE(NodeComponent bindCmp) throws Exception {
|
||||
return "g";
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package com.yomahub.liteflow.test.preAndFinally.cmp;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import com.yomahub.liteflow.slot.Slot;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.yomahub.liteflow.test.privateDelivery.cmp;
|
||||
|
||||
import cn.hutool.core.collection.ConcurrentHashSet;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
|
|
@ -2,9 +2,9 @@ package com.yomahub.liteflow.test.refreshRule;
|
|||
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.enums.FlowParserTypeEnum;
|
||||
import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.test.BaseTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package com.yomahub.liteflow.test.refreshRule.cmp;
|
||||
|
||||
import cn.hutool.core.collection.ConcurrentHashSet;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.yomahub.liteflow.test.reload.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.yomahub.liteflow.test.requestId.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.yomahub.liteflow.test.subflow;
|
||||
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.exception.MultipleParsersException;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.property.LiteflowConfig;
|
||||
import com.yomahub.liteflow.test.BaseTest;
|
||||
import org.junit.Assert;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.yomahub.liteflow.test.subflow.cmp1;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig1 {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
package com.yomahub.liteflow.test.subflow.cmp2;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowELDeclSpringbootTest.RUN_TIME_SLOT;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig2 {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package com.yomahub.liteflow.test.tag.cmp;
|
||||
|
||||
import cn.hutool.core.collection.ConcurrentHashSet;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.AnnotionNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.AnnotationNodeTypeEnum;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
@ -39,7 +39,7 @@ public class CmpConfig {
|
|||
|
||||
}
|
||||
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "c",nodeType = AnnotionNodeTypeEnum.SWITCH)
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH,nodeId = "c",nodeType = AnnotationNodeTypeEnum.SWITCH)
|
||||
public String processSwitchC(NodeComponent bindCmp) {
|
||||
if(bindCmp.getTag().equals("2")){
|
||||
return "e";
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.yomahub.liteflow.test.useTTLInWhen.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import com.yomahub.liteflow.test.useTTLInWhen.TestTL;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.yomahub.liteflow.test.whenTimeOut;
|
||||
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.exception.WhenTimeoutException;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.test.BaseTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package com.yomahub.liteflow.test.whenTimeOut.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
import com.yomahub.liteflow.test.useTTLInWhen.TestTL;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.yomahub.liteflow.test.zookeeper.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@LiteflowComponent
|
||||
public class CmpConfig {
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS,nodeId = "a")
|
||||
public void processA(NodeComponent bindCmp) {
|
||||
|
|
Loading…
Reference in New Issue