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

Commit

Permalink
Tasks are ordered using TaskModel.getSeq()
Browse files Browse the repository at this point in the history
  • Loading branch information
aravindanr committed Mar 9, 2022
1 parent a4d3cd4 commit 02a3b4b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,7 @@ public WorkflowModel getWorkflow(String workflowId, boolean includeTasks) {
if (workflow != null) {
if (includeTasks) {
List<TaskModel> tasks = getTasksForWorkflow(workflowId);
tasks.sort(
Comparator.comparingLong(TaskModel::getScheduledTime)
.thenComparingInt(TaskModel::getSeq));
tasks.sort(Comparator.comparingInt(TaskModel::getSeq));
workflow.setTasks(tasks);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,7 @@ public WorkflowModel getWorkflow(String workflowId, boolean includeTasks) {
if (workflow != null) {
if (includeTasks) {
List<TaskModel> tasks = getTasksForWorkflow(workflowId);
tasks.sort(
Comparator.comparingLong(TaskModel::getScheduledTime)
.thenComparingInt(TaskModel::getSeq));
tasks.sort(Comparator.comparingInt(TaskModel::getSeq));
workflow.setTasks(tasks);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,7 @@ public WorkflowModel getWorkflow(String workflowId, boolean includeTasks) {
"getWorkflow", json.length(), "n/a", workflow.getWorkflowName());
if (includeTasks) {
List<TaskModel> tasks = getTasksForWorkflow(workflowId);
tasks.sort(
Comparator.comparingLong(TaskModel::getScheduledTime)
.thenComparingInt(TaskModel::getSeq));
tasks.sort(Comparator.comparingInt(TaskModel::getSeq));
workflow.setTasks(tasks);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ class WorkflowAndTaskConfigurationSpec extends AbstractSpecification {
}

def "Test wait time out task based simple workflow"() {
when: "Start a workflow based on a task that has a registered wiat time out"
when: "Start a workflow based on a task that has a registered wait time out"
def workflowInstanceId = workflowExecutor.startWorkflow(WAIT_TIME_OUT_WORKFLOW, 1,
'', [:], null, null, null)

Expand Down

0 comments on commit 02a3b4b

Please sign in to comment.