enhancement #I5ULVA 修正不规范的问题,chain的name和id混用,不太严谨

This commit is contained in:
everywhere.z
2022-11-28 13:28:36 +08:00
parent dc58c3c826
commit 29704ccb66
7 changed files with 9 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ public class FinallyCondition extends Condition {
@Override
public void execute(Integer slotIndex) throws Exception {
for(Executable executableItem : this.getExecutableList()){
executableItem.setCurrChainName(this.getCurrChainName());
executableItem.setCurrChainId(this.getCurrChainId());
executableItem.execute(slotIndex);
}
}

View File

@@ -29,7 +29,7 @@ public class ForCondition extends LoopCondition{
}
//执行forCount组件
forNode.setCurrChainName(this.getCurrChainName());
forNode.setCurrChainId(this.getCurrChainId());
forNode.execute(slotIndex);
//这里可能会有spring代理过的bean所以拿到user原始的class

View File

@@ -28,7 +28,7 @@ public class IfCondition extends Condition {
public void execute(Integer slotIndex) throws Exception {
if (ListUtil.toList(NodeTypeEnum.IF, NodeTypeEnum.IF_SCRIPT).contains(getIfNode().getType())){
//先执行IF节点
this.getIfNode().setCurrChainName(this.getCurrChainName());
this.getIfNode().setCurrChainId(this.getCurrChainId());
this.getIfNode().execute(slotIndex);
Slot slot = DataBus.getSlot(slotIndex);
@@ -63,7 +63,7 @@ public class IfCondition extends Condition {
}
//执行falseCaseExecutableItem
falseCaseExecutableItem.setCurrChainName(this.getCurrChainName());
falseCaseExecutableItem.setCurrChainId(this.getCurrChainId());
falseCaseExecutableItem.execute(slotIndex);
}
}

View File

@@ -20,7 +20,7 @@ public class PreCondition extends Condition {
@Override
public void execute(Integer slotIndex) throws Exception {
for(Executable executableItem : this.getExecutableList()){
executableItem.setCurrChainName(this.getCurrChainName());
executableItem.setCurrChainId(this.getCurrChainId());
executableItem.execute(slotIndex);
}
}

View File

@@ -27,7 +27,7 @@ public class ThenCondition extends Condition {
if (executableItem instanceof PreCondition || executableItem instanceof FinallyCondition){
continue;
}
executableItem.setCurrChainName(this.getCurrChainName());
executableItem.setCurrChainId(this.getCurrChainId());
executableItem.execute(slotIndex);
}
}

View File

@@ -65,7 +65,7 @@ public class WhenCondition extends Condition {
private void executeAsyncCondition(Integer slotIndex) throws Exception{
Slot slot = DataBus.getSlot(slotIndex);
String currChainName = this.getCurrChainName();
String currChainName = this.getCurrChainId();
//此方法其实只会初始化一次Executor不会每次都会初始化。Executor是唯一的
ExecutorService parallelExecutor = ExecutorHelper.loadInstance().buildWhenExecutor(this.getThreadExecutorClass());
@@ -93,7 +93,7 @@ public class WhenCondition extends Condition {
return false;
}
}).map(executable -> CompletableFutureTimeout.completeOnTimeout(
WhenFutureObj.timeOut(executable.getExecuteName()),
WhenFutureObj.timeOut(executable.getExecuteId()),
CompletableFuture.supplyAsync(new ParallelSupplier(executable, currChainName, slotIndex), parallelExecutor),
liteflowConfig.getWhenMaxWaitSeconds(),
TimeUnit.SECONDS

View File

@@ -36,7 +36,7 @@ public class WhileCondition extends LoopCondition{
executableItem.execute(slotIndex);
//如果break组件不为空则去执行
if (ObjectUtil.isNotNull(breakNode)){
breakNode.setCurrChainName(this.getCurrChainName());
breakNode.setCurrChainId(this.getCurrChainId());
breakNode.execute(slotIndex);
Class<?> originalBreakClass = LiteFlowProxyUtil.getUserClass(this.breakNode.getInstance().getClass());
boolean isBreak = slot.getBreakResult(originalBreakClass.getName());