feature #I7I3LL 完善代码及注释

This commit is contained in:
Dale Lee
2023-07-08 23:18:01 +08:00
parent 5e095553cf
commit 605aab0694
13 changed files with 95 additions and 19 deletions

View File

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

View File

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