mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-20 07:08:14 +08:00
bug #I5WSG9 2.9.0版本tag在WHEN下不生效
This commit is contained in:
@@ -160,7 +160,10 @@ public class Node implements Executable,Cloneable{
|
||||
//详情见这个issue:https://gitee.com/dromara/liteFlow/issues/I4XRBA
|
||||
@Override
|
||||
public boolean isAccess(Integer slotIndex) throws Exception {
|
||||
//把线程属性赋值给组件对象
|
||||
instance.setSlotIndex(slotIndex);
|
||||
instance.setTag(tag);
|
||||
instance.setCmpData(cmpData);
|
||||
return instance.isAccess();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ public class WhenCondition extends Condition {
|
||||
private boolean errorResume = false;
|
||||
|
||||
//只在when类型下有效,用于不同node进行同组合并,相同的组会进行合并,不同的组不会进行合并
|
||||
//此属性已弃用
|
||||
private String group = LocalDefaultFlowConstant.DEFAULT;
|
||||
|
||||
//只在when类型下有效,为true的话说明在多个并行节点下,任意一个成功,整个when就成功
|
||||
|
||||
@@ -66,4 +66,13 @@ public class NodeTagELSpringbootXmlTest extends BaseTest {
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("g", response.getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试tag是否能在WHEN中起效果
|
||||
@Test
|
||||
public void testTag5() throws Exception{
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("chain5", "arg");
|
||||
DefaultContext context = response.getFirstContextBean();
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("1",context.getData("test"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* <p>Title: liteflow</p>
|
||||
* <p>Description: 轻量级的组件式流程框架</p>
|
||||
* @author Bryan.Zhang
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.tag.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
|
||||
@LiteflowComponent("h")
|
||||
public class HCmp extends NodeComponent {
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccess() {
|
||||
DefaultContext context = this.getFirstContextBean();
|
||||
context.setData("test",this.getTag());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -15,4 +15,8 @@
|
||||
<chain name="chain4">
|
||||
THEN(f.tag("false"), g);
|
||||
</chain>
|
||||
|
||||
<chain name="chain5">
|
||||
WHEN(h.tag("1"));
|
||||
</chain>
|
||||
</flow>
|
||||
Reference in New Issue
Block a user