Skip to content

Commit

Permalink
chore(core): eval value property once for flowable task Switch
Browse files Browse the repository at this point in the history
  • Loading branch information
fhussonnois committed Feb 28, 2025
1 parent fa07cbd commit bfd82e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/io/kestra/plugin/core/flow/Switch.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List<String>

@Override
public List<ResolvedTask> childTasks(RunContext runContext, TaskRun parentTaskRun) throws IllegalVariableEvaluationException {
return cases
.entrySet()
final String value = rendererValue(runContext);
return cases.entrySet()
.stream()
.filter(throwPredicate(entry -> entry.getKey().equals(rendererValue(runContext))))
.filter(throwPredicate(entry -> entry.getKey().equals(value)))
.map(Map.Entry::getValue)
.map(tasks -> FlowableUtils.resolveTasks(tasks, parentTaskRun))
.findFirst()
Expand Down

0 comments on commit bfd82e0

Please sign in to comment.