mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 20:22:07 +08:00
feature #I7I3LL 完善代码及注释
This commit is contained in:
@@ -21,6 +21,12 @@ import javax.annotation.Resource;
|
||||
|
||||
import static com.yomahub.liteflow.test.maxWaitSeconds.cmp.DCmp.CONTENT_KEY;
|
||||
|
||||
/**
|
||||
* Spring 环境下超时控制测试
|
||||
*
|
||||
* @author DaleLee
|
||||
* @since 2.11.0
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@ContextConfiguration("classpath:/maxWaitSeconds/application.xml")
|
||||
public class MaxWaitSecondsELSpringTest extends BaseTest {
|
||||
|
||||
@@ -3,11 +3,23 @@ package com.yomahub.liteflow.test.maxWaitSeconds.cmp;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeWhileComponent;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@LiteflowComponent("w")
|
||||
public class WCmp extends NodeWhileComponent {
|
||||
private int count = 0;
|
||||
|
||||
// 执行过的 chain
|
||||
Set<String> executedChain = new HashSet<>();
|
||||
|
||||
@Override
|
||||
public boolean processWhile() throws Exception {
|
||||
// 判断是否切换了 chain
|
||||
if (!executedChain.contains(this.getCurrChainId())) {
|
||||
count = 0;
|
||||
executedChain.add(this.getCurrChainId());
|
||||
}
|
||||
count++;
|
||||
return count <= 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user