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

Commit

Permalink
during updateTask only the workflow is loaded, not all the tasks inside
Browse files Browse the repository at this point in the history
  • Loading branch information
aravindanr committed Jul 20, 2022
1 parent 2c16fa8 commit a7c30b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ public void updateTask(TaskResult taskResult) {
}

String workflowId = taskResult.getWorkflowInstanceId();
WorkflowModel workflowInstance = executionDAOFacade.getWorkflowModel(workflowId, true);
WorkflowModel workflowInstance = executionDAOFacade.getWorkflowModel(workflowId, false);

// FIXME Backwards compatibility for legacy workflows already running.
// This code will be removed in a future version.
Expand Down Expand Up @@ -1168,7 +1168,7 @@ public void updateTask(TaskResult taskResult) {
break;
}

// Throw an ApplicationException if below operations fail to avoid workflow inconsistencies.
// Throw a TransientException if below operations fail to avoid workflow inconsistencies.
try {
executionDAOFacade.updateTask(task);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2382,8 +2382,8 @@ public void testUpdateTaskWithCallbackAfterSeconds() {
simpleTask.setTaskId("simple-task-id");
simpleTask.setStatus(TaskModel.Status.IN_PROGRESS);

workflow.getTasks().addAll(Arrays.asList(simpleTask));
when(executionDAOFacade.getWorkflowModel(workflowId, true)).thenReturn(workflow);
workflow.getTasks().add(simpleTask);
when(executionDAOFacade.getWorkflowModel(workflowId, false)).thenReturn(workflow);
when(executionDAOFacade.getTaskModel(simpleTask.getTaskId())).thenReturn(simpleTask);

TaskResult taskResult = new TaskResult();
Expand Down Expand Up @@ -2424,8 +2424,8 @@ public void testUpdateTaskWithOutCallbackAfterSeconds() {
simpleTask.setTaskId("simple-task-id");
simpleTask.setStatus(TaskModel.Status.IN_PROGRESS);

workflow.getTasks().addAll(Arrays.asList(simpleTask));
when(executionDAOFacade.getWorkflowModel(workflowId, true)).thenReturn(workflow);
workflow.getTasks().add(simpleTask);
when(executionDAOFacade.getWorkflowModel(workflowId, false)).thenReturn(workflow);
when(executionDAOFacade.getTaskModel(simpleTask.getTaskId())).thenReturn(simpleTask);

TaskResult taskResult = new TaskResult();
Expand Down

0 comments on commit a7c30b1

Please sign in to comment.