bug #IA5PAK ELBus串行编排不支持对每个节点进行超时配置

This commit is contained in:
everywhere.z
2024-07-01 15:38:33 +08:00
parent 9e3cbe6238
commit 3f808dee0c
15 changed files with 23 additions and 40 deletions

View File

@@ -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();

View File

@@ -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();

View File

@@ -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必须定义在完整的语义之后");
}
}
}
}

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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));
}
}