Skip to content

Commit

Permalink
TE-587: Handle more case for parallel tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
trungmaihova committed May 28, 2024
1 parent 7d53d5f commit 70a265e
Show file tree
Hide file tree
Showing 5 changed files with 315 additions and 69 deletions.
168 changes: 168 additions & 0 deletions process-analyzer-test/processes/FlowParallelInOrder.p.json
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,174 @@
"connect" : [
{ "id" : "f97", "to" : "f33", "var" : "in2" }
]
}, {
"id" : "f34",
"type" : "RequestStart",
"name" : "start5",
"config" : {
"signature" : "start5"
},
"visual" : {
"at" : { "x" : 224, "y" : 1376 }
},
"connect" : [
{ "id" : "f93", "to" : "f91", "var" : "in1" }
]
}, {
"id" : "f91",
"type" : "TaskSwitchGateway",
"name" : "split1",
"config" : {
"tasks" : [ {
"id" : "TaskA",
"responsible" : {
"activator" : "SYSTEM"
}
}, {
"id" : "TaskB",
"responsible" : {
"activator" : "SYSTEM"
}
} ]
},
"visual" : {
"at" : { "x" : 328, "y" : 1376 },
"labelOffset" : { "x" : -40, "y" : -24 }
},
"connect" : [
{ "id" : "f98", "to" : "f94", "via" : [ { "x" : 328, "y" : 1296 } ], "condition" : "ivp==\"TaskA.ivp\"" },
{ "id" : "f101", "to" : "f100", "via" : [ { "x" : 328, "y" : 1456 } ], "condition" : "ivp==\"TaskB.ivp\"" }
]
}, {
"id" : "f94",
"type" : "UserTask",
"name" : "TaskA5",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskA5"
}
},
"visual" : {
"at" : { "x" : 440, "y" : 1296 }
},
"connect" : [
{ "id" : "f103", "to" : "f102", "var" : "in1" }
]
}, {
"id" : "f100",
"type" : "UserTask",
"name" : "TaskB5",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskB5"
}
},
"visual" : {
"at" : { "x" : 448, "y" : 1456 }
},
"connect" : [
{ "id" : "f111", "to" : "f108", "via" : [ { "x" : 792, "y" : 1456 } ], "var" : "in3" }
]
}, {
"id" : "f102",
"type" : "TaskSwitchGateway",
"name" : "split2",
"config" : {
"tasks" : [ {
"id" : "TaskA",
"responsible" : {
"activator" : "SYSTEM"
}
}, {
"id" : "TaskB",
"responsible" : {
"activator" : "SYSTEM"
}
} ]
},
"visual" : {
"at" : { "x" : 552, "y" : 1296 },
"labelOffset" : { "x" : -8, "y" : -16 }
},
"connect" : [
{ "id" : "f105", "to" : "f104", "via" : [ { "x" : 552, "y" : 1248 } ], "condition" : "ivp==\"TaskA.ivp\"" },
{ "id" : "f107", "to" : "f106", "via" : [ { "x" : 552, "y" : 1336 } ], "condition" : "ivp==\"TaskB.ivp\"" }
]
}, {
"id" : "f104",
"type" : "UserTask",
"name" : "TaskC5",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskC5"
}
},
"visual" : {
"at" : { "x" : 656, "y" : 1248 }
},
"connect" : [
{ "id" : "f109", "to" : "f108", "via" : [ { "x" : 792, "y" : 1248 } ], "var" : "in1" }
]
}, {
"id" : "f106",
"type" : "UserTask",
"name" : "TaskD5",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskD5"
}
},
"visual" : {
"at" : { "x" : 656, "y" : 1336 }
},
"connect" : [
{ "id" : "f110", "to" : "f108", "var" : "in2" }
]
}, {
"id" : "f108",
"type" : "TaskSwitchGateway",
"name" : "join",
"config" : {
"tasks" : [ {
"id" : "TaskA",
"responsible" : {
"activator" : "SYSTEM"
}
} ]
},
"visual" : {
"at" : { "x" : 792, "y" : 1336 },
"labelOffset" : { "x" : 48, "y" : -8 }
},
"connect" : [
{ "id" : "f113", "to" : "f112", "condition" : "ivp==\"TaskA.ivp\"" }
]
}, {
"id" : "f112",
"type" : "UserTask",
"name" : "TaskE5",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskE5"
}
},
"visual" : {
"at" : { "x" : 912, "y" : 1336 }
},
"connect" : [
{ "id" : "f115", "to" : "f114" }
]
}, {
"id" : "f114",
"type" : "TaskEnd",
"visual" : {
"at" : { "x" : 1048, "y" : 1344 }
}
} ],
"layout" : {
"colors" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,15 @@ void shouldFindTasksOnPathAtTaskG2AndTaskI2() throws Exception {
var taskNames = getTaskNames(detectedTasks);
assertArrayEquals(expected, taskNames);
}

@Test
void shouldFindAllTasksAtStart5() throws Exception {
var start5 = ProcessGraphHelper.findByElementName(process, "start5");

var detectedTasks = processAnalyzer.findAllTasks(start5, null);
var expected = Arrays.array("TaskA5", "TaskC5", "TaskD5", "TaskB5", "TaskE5");

var taskNames = getTaskNames(detectedTasks);
assertArrayEquals(expected, taskNames);
}
}
Loading

0 comments on commit 70a265e

Please sign in to comment.