mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-15 04:22:09 +08:00
bug #I4PA2A 在NodeComponent的isAccess中获取tag失败
This commit is contained in:
@@ -56,4 +56,12 @@ public class NodeTagSpringbootJsonTest extends BaseTest {
|
||||
Assert.assertEquals(3, testSet.size());
|
||||
}
|
||||
}
|
||||
|
||||
//测试tag是否能在isAccess中起效
|
||||
@Test
|
||||
public void testTag4() throws Exception{
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("g", response.getSlot().printStep());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,4 +56,12 @@ public class NodeTagSpringbootXmlTest extends BaseTest {
|
||||
Assert.assertEquals(3, testSet.size());
|
||||
}
|
||||
}
|
||||
|
||||
//测试tag是否能在isAccess中起效
|
||||
@Test
|
||||
public void testTag4() throws Exception{
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("g", response.getSlot().printStep());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* <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;
|
||||
|
||||
@LiteflowComponent("f")
|
||||
public class FCmp extends NodeComponent {
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
System.out.println("FCmp executed!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccess() {
|
||||
return Boolean.parseBoolean(this.getTag());
|
||||
}
|
||||
}
|
||||
@@ -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.tag.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
|
||||
@LiteflowComponent("g")
|
||||
public class GCmp extends NodeComponent {
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
System.out.println("GCmp executed!");
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,12 @@
|
||||
{"type": "then", "value": "b1"},
|
||||
{"type": "when", "value": "b[1],b[2],b[3]"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "chain4",
|
||||
"condition": [
|
||||
{"type": "then", "value": "f[false],g"}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,4 +12,8 @@
|
||||
<then value="b1"/>
|
||||
<when value="b[1],b[2],b[3]"/>
|
||||
</chain>
|
||||
|
||||
<chain name="chain4">
|
||||
<then value="f[false],g"/>
|
||||
</chain>
|
||||
</flow>
|
||||
Reference in New Issue
Block a user