Skip to content

Commit 534bf57

Browse files
committed
1344 - Fix branch logic
1 parent 0dfe5d5 commit 534bf57

File tree

2 files changed

+13
-2
lines changed
  • server/libs
    • atlas/atlas-configuration/atlas-configuration-api/src/main/java/com/bytechef/atlas/configuration/domain
    • modules/task-dispatchers/branch/src/main/java/com/bytechef/task/dispatcher/branch/completion

2 files changed

+13
-2
lines changed

server/libs/atlas/atlas-configuration/atlas-configuration-api/src/main/java/com/bytechef/atlas/configuration/domain/Workflow.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,17 @@ private static List<WorkflowTask> getTasks(List<WorkflowTask> workflowTasks, Str
419419
.toList();
420420

421421
returnedWorkflowTasks.addAll(getTasks(curWorkflowTasks, lastWorkflowNodeName));
422+
} else if (firstItem instanceof Map<?, ?> map &&
423+
map.containsKey(WorkflowConstants.TASKS)) {
424+
425+
for (Object curItem : curList) {
426+
Map<String, ?> curMap = (Map<String, ?>) curItem;
427+
428+
List<WorkflowTask> curWorkflowTasks = MapUtils.getList(
429+
curMap, WorkflowConstants.TASKS, WorkflowTask.class, List.of());
430+
431+
returnedWorkflowTasks.addAll(getTasks(curWorkflowTasks, lastWorkflowNodeName));
432+
}
422433
}
423434
}
424435
} else if (entry.getValue() instanceof Map<?, ?> curMap) {

server/libs/modules/task-dispatchers/branch/src/main/java/com/bytechef/task/dispatcher/branch/completion/BranchTaskCompletionHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ public void handle(TaskExecution taskExecution) {
131131
subTaskExecution = taskExecutionService.create(subTaskExecution);
132132

133133
contextService.push(
134-
Validate.notNull(taskExecution.getId(), "id"), Classname.TASK_EXECUTION,
134+
Validate.notNull(subTaskExecution.getId(), "id"), Classname.TASK_EXECUTION,
135135
taskFileStorage.storeContextValue(
136-
Validate.notNull(taskExecution.getId(), "id"), Classname.TASK_EXECUTION, context));
136+
Validate.notNull(subTaskExecution.getId(), "id"), Classname.TASK_EXECUTION, context));
137137

138138
taskDispatcher.dispatch(subTaskExecution);
139139
}

0 commit comments

Comments
 (0)