Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3577 from manan164/failure_workflow_input_fix
Browse files Browse the repository at this point in the history
Pass complete workflow as input to failure workflow.
  • Loading branch information
v1r3n authored Apr 19, 2023
2 parents 3981a15 + 0a180ac commit 351243e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ public WorkflowModel terminateWorkflow(
if (workflow.getFailedTaskId() != null) {
input.put("failureTaskId", workflow.getFailedTaskId());
}
input.put("failedWorkflow", workflow);

try {
String failureWFId = idGenerator.generate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,9 @@ public void testTerminateWorkflowWithFailureWorkflow() {
workflow.getWorkflowId(), startWorkflowInput.getWorkflowInput().get("workflowId"));
assertEquals(
failedTask.getTaskId(), startWorkflowInput.getWorkflowInput().get("failureTaskId"));
assertNotNull(
failedTask.getTaskId(),
startWorkflowInput.getWorkflowInput().get("failedWorkflow"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class FailureWorkflowSpec extends AbstractSpecification {
input['failureTaskId'] == workflowFailureTaskId
tasks.size() == 1
tasks[0].taskType == 'LAMBDA'
input['failedWorkflow'] != null
}
}
}
Expand Down Expand Up @@ -140,6 +141,7 @@ class FailureWorkflowSpec extends AbstractSpecification {
input['failureTaskId'] == workflowFailureTaskId
tasks.size() == 1
tasks[0].taskType == 'LAMBDA'
input['failedWorkflow'] != null
}
}
}
Expand Down

0 comments on commit 351243e

Please sign in to comment.