mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-06-10 03:07:32 +08:00
bug #IA5PAK ELBus串行编排不支持对每个节点进行超时配置
This commit is contained in:
@@ -46,8 +46,6 @@ public class AndELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
// 根据depth是否为null,决定输出是否格式化
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -47,8 +47,6 @@ public class CatchELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -162,9 +162,7 @@ public abstract class ELWrapper {
|
||||
* @return {@link String}
|
||||
*/
|
||||
public String toEL(){
|
||||
StringBuilder paramContext = new StringBuilder();
|
||||
String elContext = toEL(null, paramContext);
|
||||
return paramContext.append(elContext).append(";").toString();
|
||||
return toEL(false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,15 +232,4 @@ public abstract class ELWrapper {
|
||||
elContext.append(StrUtil.repeat(ELBus.TAB, depth));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查子表达式是否有最长等待秒数定义
|
||||
*/
|
||||
protected void checkMaxWaitSeconds(){
|
||||
for(ELWrapper sonElWrapper : this.getElWrapperList()){
|
||||
if(sonElWrapper != null && sonElWrapper.getMaxWaitSeconds() != null){
|
||||
throw new IllegalArgumentException("maxWaitSeconds必须定义在完整的语义之后!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,8 +45,6 @@ public class FinallyELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -221,8 +221,6 @@ public class IfELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -62,8 +62,6 @@ public abstract class LoopELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -38,8 +38,6 @@ public class NotELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -46,8 +46,6 @@ public class OrELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -78,8 +78,6 @@ public class ParELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -38,8 +38,6 @@ public class PreELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -82,8 +82,6 @@ public class SerELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -58,8 +58,6 @@ public class SwitchELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -84,8 +84,6 @@ public class ThenELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -77,8 +77,6 @@ public class WhenELWrapper extends ELWrapper {
|
||||
|
||||
@Override
|
||||
protected String toEL(Integer depth, StringBuilder paramContext) {
|
||||
checkMaxWaitSeconds();
|
||||
|
||||
Integer sonDepth = depth == null ? null : depth + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.yomahub.liteflow.test.builder;
|
||||
|
||||
import com.yomahub.liteflow.builder.el.ELBus;
|
||||
import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder;
|
||||
import com.yomahub.liteflow.builder.el.NodeELWrapper;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest(classes = MaxWaitSecondBuilderTest.class)
|
||||
@EnableAutoConfiguration
|
||||
public class MaxWaitSecondBuilderTest {
|
||||
|
||||
@Test
|
||||
public void testMaxWaitSecond1(){
|
||||
NodeELWrapper nodeA = ELBus.node("a").maxWaitSeconds(4);
|
||||
NodeELWrapper nodeB = ELBus.node("b").maxWaitSeconds(4);
|
||||
System.out.println(ELBus.when(nodeA, nodeB).toEL(true));
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user