Skip to content

Commit

Permalink
conductor-oss-fixDynamicForkIssue: Fix groovy testcase failure
Browse files Browse the repository at this point in the history
  • Loading branch information
saksham2105 committed Dec 22, 2023
1 parent 2a55004 commit 3896ef2
Showing 1 changed file with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,23 @@ public List<TaskModel> getMappedTasks(TaskMapperContext taskMapperContext)
}

for (TaskModel forkedTask : forkedTasks) {
Map<String, Object> forkedTaskInput =
tasksInput.get(forkedTask.getReferenceTaskName());
if (forkedTask.getInputData() == null) {
forkedTask.setInputData(new HashMap<>());
try {
Map<String, Object> forkedTaskInput =
tasksInput.get(forkedTask.getReferenceTaskName());
if (forkedTask.getInputData() == null) {
forkedTask.setInputData(new HashMap<>());
}
if (forkedTaskInput == null) {
forkedTaskInput = new HashMap<>();
}
forkedTask.getInputData().putAll(forkedTaskInput);
} catch (Exception e) {
String reason =
String.format(
"Tasks could not be dynamically forked due to invalid input: %s",
e.getMessage());
throw new TerminateWorkflowException(reason);
}
if (forkedTaskInput == null) {
forkedTaskInput = new HashMap<>();
}
forkedTask.getInputData().putAll(forkedTaskInput);
}
mappedTasks.addAll(forkedTasks);
// Get the last of the dynamic tasks so that the join can be performed once this
Expand Down

0 comments on commit 3896ef2

Please sign in to comment.