bug #I4PA2A 在NodeComponent的isAccess中获取tag失败

This commit is contained in:
bryan31
2022-01-04 18:48:58 +08:00
parent 25730a27fc
commit 5693ca199d
7 changed files with 76 additions and 6 deletions

View File

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

View File

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

View File

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

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.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!");
}
}

View File

@@ -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"}
]
}
]
}

View File

@@ -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>