From 308a6717944560f32deb3724faadbf347b38e21d Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Mon, 6 Mar 2023 17:33:12 +0800 Subject: [PATCH] =?UTF-8?q?bug=20#I6JF0K=20=E8=BF=AD=E4=BB=A3&=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E7=BB=84=E4=BB=B6=E5=9C=A8SWITCH=E8=AF=AD=E5=A2=83?= =?UTF-8?q?=E4=B8=AD=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96=E8=BF=AD=E4=BB=A3?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E5=92=8C=E4=B8=8B=E6=A0=87=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flow/element/condition/LoopCondition.java | 16 ++++++++++++---- .../flow/element/condition/ThenCondition.java | 8 ++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/LoopCondition.java b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/LoopCondition.java index 36bcad2b6..ab4ee0304 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/LoopCondition.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/LoopCondition.java @@ -32,9 +32,13 @@ public abstract class LoopCondition extends Condition { ((Condition) executableItem).getExecutableList().forEach(executable -> setLoopIndex(executable, index)); setLoopIndex(((IfCondition) executableItem).getTrueCaseExecutableItem(), index); setLoopIndex(((IfCondition) executableItem).getFalseCaseExecutableItem(), index); - }else if(executableItem instanceof SwitchCondition){ + }else if(executableItem instanceof SwitchCondition) { ((Condition) executableItem).getExecutableList().forEach(executable -> setLoopIndex(executable, index)); - ((SwitchCondition)executableItem).getTargetList().forEach(executable -> setLoopIndex(executable, index)); + ((SwitchCondition) executableItem).getTargetList().forEach(executable -> setLoopIndex(executable, index)); + }else if(executableItem instanceof ThenCondition) { + ((Condition)executableItem).getExecutableList().forEach(executable -> setLoopIndex(executable, index)); + ((ThenCondition) executableItem).getPreConditionList().forEach(executable -> setLoopIndex(executable, index)); + ((ThenCondition) executableItem).getFinallyConditionList().forEach(executable -> setLoopIndex(executable, index)); }else if(executableItem instanceof Condition){ ((Condition)executableItem).getExecutableList().forEach(executable -> setLoopIndex(executable, index)); }else if(executableItem instanceof Node){ @@ -49,9 +53,13 @@ public abstract class LoopCondition extends Condition { ((Condition) executableItem).getExecutableList().forEach(executable -> setCurrLoopObject(executable, obj)); setCurrLoopObject(((IfCondition) executableItem).getTrueCaseExecutableItem(), obj); setCurrLoopObject(((IfCondition) executableItem).getFalseCaseExecutableItem(), obj); - }else if(executableItem instanceof SwitchCondition){ + }else if(executableItem instanceof SwitchCondition) { ((Condition) executableItem).getExecutableList().forEach(executable -> setCurrLoopObject(executable, obj)); - ((SwitchCondition)executableItem).getTargetList().forEach(executable -> setCurrLoopObject(executable, obj)); + ((SwitchCondition) executableItem).getTargetList().forEach(executable -> setCurrLoopObject(executable, obj)); + }else if(executableItem instanceof ThenCondition) { + ((Condition)executableItem).getExecutableList().forEach(executable -> setCurrLoopObject(executable, obj)); + ((ThenCondition) executableItem).getPreConditionList().forEach(executable -> setCurrLoopObject(executable, obj)); + ((ThenCondition) executableItem).getFinallyConditionList().forEach(executable -> setCurrLoopObject(executable, obj)); }else if(executableItem instanceof Condition){ ((Condition)executableItem).getExecutableList().forEach(executable -> setCurrLoopObject(executable, obj)); }else if(executableItem instanceof Node){ diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/ThenCondition.java b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/ThenCondition.java index f3dfa5c1c..8e59c4218 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/ThenCondition.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/ThenCondition.java @@ -81,4 +81,12 @@ public class ThenCondition extends Condition { super.addExecutable(executable); } } + + public List getPreConditionList() { + return preConditionList; + } + + public List getFinallyConditionList() { + return finallyConditionList; + } }