bug #I4HQAA setIsEnd目前受isContinue的判断影响,还是会继续

This commit is contained in:
bryan31
2021-11-10 17:16:00 +08:00
parent ecfebfdc19
commit 30b28729e0
6 changed files with 66 additions and 7 deletions

View File

@@ -72,7 +72,7 @@ public class FlowExecutorTest extends BaseTest {
//setIsEnd方法的功能点测试
@Test
public void testSetIsEnd() throws Exception {
public void testSetIsEnd1() throws Exception {
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain5", 10);
Assert.assertTrue(response.isSuccess());
Assert.assertEquals("e",response.getSlot().printStep());
@@ -85,4 +85,12 @@ public class FlowExecutorTest extends BaseTest {
Assert.assertTrue(response.isSuccess());
}
//测试setIsEnd如果为truecontinueError也为true那不应该continue了
@Test
public void testSetIsEnd2() throws Exception {
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain7", 10);
Assert.assertTrue(response.isSuccess());
Assert.assertEquals("g",response.getSlot().printStep());
}
}

View File

@@ -0,0 +1,26 @@
/**
* <p>Title: liteflow</p>
* <p>Description: 轻量级的组件式流程框架</p>
* @author Bryan.Zhang
* @email weenyc31@163.com
* @Date 2020/4/1
*/
package com.yomahub.liteflow.test.component.cmp1;
import com.yomahub.liteflow.core.NodeComponent;
import org.springframework.stereotype.Component;
@Component("g")
public class GCmp extends NodeComponent {
@Override
public void process() {
System.out.println("GCmp executed!");
this.setIsEnd(true);
}
@Override
public boolean isContinueOnError() {
return true;
}
}

View File

@@ -0,0 +1,20 @@
/**
* <p>Title: liteflow</p>
* <p>Description: 轻量级的组件式流程框架</p>
* @author Bryan.Zhang
* @email weenyc31@163.com
* @Date 2020/4/1
*/
package com.yomahub.liteflow.test.component.cmp1;
import com.yomahub.liteflow.core.NodeComponent;
import org.springframework.stereotype.Component;
@Component("h")
public class HCmp extends NodeComponent {
@Override
public void process() {
System.out.println("HCmp executed!");
}
}

View File

@@ -1,2 +1 @@
liteflow.rule-source=component/flow.xml
liteflow.retry_count=3
liteflow.rule-source=component/flow.xml

View File

@@ -23,4 +23,8 @@
<chain name="chain6">
<then value="f(d | c | b)" />
</chain>
<chain name="chain7">
<then value="g,h"/>
</chain>
</flow>