From fd307de555fffbf860c0ba27b5a47ac3fcbf67cd Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Thu, 2 Feb 2023 16:57:08 +0800 Subject: [PATCH] =?UTF-8?q?bug=20#I6CJI9=20=E4=BF=AE=E5=A4=8D=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E7=BB=84=E4=BB=B6=E4=B8=ADIF=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=8D=E4=BA=86index=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../liteflow/flow/element/condition/LoopCondition.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 6e2cc3cc3..327a786d3 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 @@ -26,6 +26,10 @@ public abstract class LoopCondition extends Condition { protected void setLoopIndex(Executable executableItem, int index){ if (executableItem instanceof Chain){ ((Chain)executableItem).getConditionList().forEach(condition -> setLoopIndex(condition, index)); + }else if(executableItem instanceof IfCondition){ + ((Condition)executableItem).getExecutableList().forEach(executable -> setLoopIndex(executable, index)); + setLoopIndex(((IfCondition)executableItem).getTrueCaseExecutableItem(), index); + setLoopIndex(((IfCondition)executableItem).getFalseCaseExecutableItem(), index); }else if(executableItem instanceof Condition){ ((Condition)executableItem).getExecutableList().forEach(executable -> setLoopIndex(executable, index)); }else if(executableItem instanceof Node){ @@ -36,6 +40,10 @@ public abstract class LoopCondition extends Condition { protected void setCurrLoopObject(Executable executableItem, Object obj){ if (executableItem instanceof Chain){ ((Chain)executableItem).getConditionList().forEach(condition -> setCurrLoopObject(condition, obj)); + }else if(executableItem instanceof IfCondition){ + ((Condition)executableItem).getExecutableList().forEach(executable -> setCurrLoopObject(executable, obj)); + setCurrLoopObject(((IfCondition)executableItem).getTrueCaseExecutableItem(), obj); + setCurrLoopObject(((IfCondition)executableItem).getFalseCaseExecutableItem(), obj); }else if(executableItem instanceof Condition){ ((Condition)executableItem).getExecutableList().forEach(executable -> setCurrLoopObject(executable, obj)); }else if(executableItem instanceof Node){