mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-15 04:22:09 +08:00
enhancement #I5ULVA 修正不规范的问题,chain的name和id混用,不太严谨
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user