Skip to content

Commit

Permalink
Merge pull request #11 from axonivy-market/TE-584-handle-task-inside-…
Browse files Browse the repository at this point in the history
…sub-process

TE-584: Handle task from sub process
  • Loading branch information
trungmaihova authored May 27, 2024
2 parents af3c90f + ab4f113 commit 86067b6
Show file tree
Hide file tree
Showing 12 changed files with 607 additions and 68 deletions.
125 changes: 122 additions & 3 deletions process-analyzer-test/processes/FlowSubprocess.p.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "Task A"
"name" : "Task A",
"code" : [
"import java.util.concurrent.TimeUnit;",
"import com.axonivy.utils.process.analyzer.APAConfig;",
"import com.axonivy.utils.process.analyzer.test.UseCase;",
"",
"APAConfig.setEstimate(5,TimeUnit.HOURS,UseCase.BIGPROJECT);"
]
}
},
"visual" : {
Expand Down Expand Up @@ -122,7 +129,14 @@
"name" : "Task B",
"config" : {
"task" : {
"name" : "Task B"
"name" : "Task B",
"code" : [
"import java.util.concurrent.TimeUnit;",
"import com.axonivy.utils.process.analyzer.APAConfig;",
"import com.axonivy.utils.process.analyzer.test.UseCase;",
"",
"APAConfig.setEstimate(4,TimeUnit.HOURS,UseCase.BIGPROJECT);"
]
}
},
"visual" : {
Expand All @@ -149,7 +163,7 @@
"findTasksOnPath( start.ivp ) => TaskA, TaskB"
],
"visual" : {
"at" : { "x" : 376, "y" : 343 },
"at" : { "x" : 824, "y" : 167 },
"size" : { "width" : 476, "height" : 97 }
}
}, {
Expand Down Expand Up @@ -198,5 +212,110 @@
"visual" : {
"at" : { "x" : 488, "y" : 192 }
}
}, {
"id" : "f10",
"type" : "RequestStart",
"name" : "start3",
"config" : {
"signature" : "start3"
},
"visual" : {
"at" : { "x" : 96, "y" : 312 }
},
"connect" : [
{ "id" : "f11", "to" : "S30" }
]
}, {
"id" : "S30",
"type" : "EmbeddedProcess",
"name" : "Sub Process A",
"elements" : [ {
"id" : "S30-g0",
"type" : "EmbeddedStart",
"visual" : {
"at" : { "x" : 64, "y" : 256 }
},
"parentConnector" : "f11",
"connect" : [
{ "id" : "S30-f0", "to" : "S30-f1" }
]
}, {
"id" : "S30-g1",
"type" : "EmbeddedEnd",
"visual" : {
"at" : { "x" : 496, "y" : 256 }
},
"parentConnector" : "f13"
}, {
"id" : "S30-f1",
"type" : "SubProcessCall",
"name" : "CallSubProcess A",
"config" : {
"processCall" : "FlowSubProcessCall:call()",
"call" : {
"map" : { },
"code" : [
"import com.axonivy.utils.process.analyzer.test.UseCase;",
"import java.util.concurrent.TimeUnit;",
"import com.axonivy.utils.process.analyzer.APAConfig;",
"",
"APAConfig.handleAsTask();",
"APAConfig.setTaskName(\"CallSubProcess A\");",
"APAConfig.setEstimate(10,TimeUnit.DAYS,UseCase.BIGPROJECT);",
"APAConfig.setEstimate(5,TimeUnit.DAYS,UseCase.SMALLPROJECT);"
]
}
},
"visual" : {
"at" : { "x" : 208, "y" : 256 }
},
"connect" : [
{ "id" : "S30-f2", "to" : "S30-f3" }
]
}, {
"id" : "S30-f3",
"type" : "UserTask",
"name" : "TaskC",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskC"
}
},
"visual" : {
"at" : { "x" : 368, "y" : 256 }
},
"connect" : [
{ "id" : "S30-f4", "to" : "S30-g1" }
]
} ],
"visual" : {
"at" : { "x" : 288, "y" : 312 }
},
"connect" : [
{ "id" : "f13", "to" : "f12" }
]
}, {
"id" : "f12",
"type" : "UserTask",
"name" : "TaskB",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskB"
}
},
"visual" : {
"at" : { "x" : 480, "y" : 312 }
},
"connect" : [
{ "id" : "f15", "to" : "f14" }
]
}, {
"id" : "f14",
"type" : "TaskEnd",
"visual" : {
"at" : { "x" : 672, "y" : 312 }
}
} ]
}
206 changes: 206 additions & 0 deletions process-analyzer-test/processes/ParallelTasksExample.p.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,212 @@
"connect" : [
{ "id" : "f24", "to" : "f4", "var" : "in2" }
]
}, {
"id" : "f34",
"type" : "RequestStart",
"name" : "start5",
"config" : {
"signature" : "start5"
},
"visual" : {
"at" : { "x" : 56, "y" : 744 }
},
"connect" : [
{ "id" : "f93", "to" : "f91" }
]
}, {
"id" : "f91",
"type" : "UserTask",
"name" : "TaskA5",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskA5"
}
},
"visual" : {
"at" : { "x" : 216, "y" : 744 }
},
"connect" : [
{ "id" : "f98", "to" : "f94", "var" : "in1" }
]
}, {
"id" : "f94",
"type" : "TaskSwitchGateway",
"config" : {
"tasks" : [ {
"id" : "TaskA",
"responsible" : {
"activator" : "SYSTEM"
}
}, {
"id" : "TaskB",
"responsible" : {
"activator" : "SYSTEM"
}
}, {
"id" : "TaskC",
"responsible" : {
"activator" : "SYSTEM"
}
} ]
},
"visual" : {
"at" : { "x" : 352, "y" : 744 }
},
"connect" : [
{ "id" : "f25", "to" : "f102", "via" : [ { "x" : 352, "y" : 624 } ], "condition" : "ivp==\"TaskA.ivp\"" },
{ "id" : "f26", "to" : "f103", "via" : [ { "x" : 352, "y" : 864 } ], "condition" : "ivp==\"TaskB.ivp\"" },
{ "id" : "f27", "to" : "f100", "condition" : "ivp==\"TaskC.ivp\"" }
]
}, {
"id" : "f100",
"type" : "UserTask",
"name" : "TaskC5",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskC5"
}
},
"visual" : {
"at" : { "x" : 448, "y" : 744 }
},
"connect" : [
{ "id" : "f107", "to" : "f106", "var" : "in1" }
]
}, {
"id" : "f102",
"type" : "UserTask",
"name" : "TaskB5",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskB5"
}
},
"visual" : {
"at" : { "x" : 560, "y" : 624 }
},
"connect" : [
{ "id" : "f111", "to" : "f110" }
]
}, {
"id" : "f103",
"type" : "UserTask",
"name" : "TaskD5",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskD5"
}
},
"visual" : {
"at" : { "x" : 560, "y" : 864 }
},
"connect" : [
{ "id" : "f116", "to" : "f114", "via" : [ { "x" : 840, "y" : 864 } ], "var" : "in2" }
]
}, {
"id" : "f110",
"type" : "UserTask",
"name" : "TaskE5",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskE5"
}
},
"visual" : {
"at" : { "x" : 712, "y" : 624 }
},
"connect" : [
{ "id" : "f117", "to" : "f114", "via" : [ { "x" : 840, "y" : 624 } ], "var" : "in3" }
]
}, {
"id" : "f112",
"type" : "UserTask",
"name" : "TaskF5",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskF5"
}
},
"visual" : {
"at" : { "x" : 712, "y" : 744 }
},
"connect" : [
{ "id" : "f115", "to" : "f114", "var" : "in1" }
]
}, {
"id" : "f114",
"type" : "TaskSwitchGateway",
"config" : {
"tasks" : [ {
"id" : "TaskA",
"responsible" : {
"activator" : "SYSTEM"
}
} ]
},
"visual" : {
"at" : { "x" : 840, "y" : 744 }
},
"connect" : [
{ "id" : "f119", "to" : "f118", "condition" : "ivp==\"TaskA.ivp\"" }
]
}, {
"id" : "f118",
"type" : "UserTask",
"name" : "TaskG5",
"config" : {
"dialog" : "com.axonivy.utils.process.analyzer.test.Dummy:start()",
"task" : {
"name" : "TaskG5"
}
},
"visual" : {
"at" : { "x" : 968, "y" : 744 }
},
"connect" : [
{ "id" : "f121", "to" : "f120" }
]
}, {
"id" : "f120",
"type" : "TaskEnd",
"visual" : {
"at" : { "x" : 1128, "y" : 744 }
}
}, {
"id" : "f106",
"type" : "TaskSwitchGateway",
"config" : {
"tasks" : [ {
"id" : "TaskA",
"responsible" : {
"activator" : "SYSTEM"
}
}, {
"id" : "TaskB",
"responsible" : {
"activator" : "SYSTEM"
}
}, {
"id" : "TaskC",
"responsible" : {
"activator" : "SYSTEM"
}
} ]
},
"visual" : {
"at" : { "x" : 560, "y" : 744 }
},
"connect" : [
{ "id" : "f108", "to" : "f102", "condition" : "ivp==\"TaskA.ivp\"" },
{ "id" : "f109", "to" : "f103", "condition" : "ivp==\"TaskB.ivp\"" },
{ "id" : "f113", "to" : "f112", "condition" : "ivp==\"TaskC.ivp\"" }
]
} ],
"layout" : {
"colors" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void shouldFindTasksOnPathByCaseAtTaskBAndTaskC(BpmClient bpmClient) throws Exce
DetectedTask taskD = (DetectedTask) findByElementName(detectedTasks, "Task D");

assertTrue(Duration.ZERO.compareTo(taskC.getTimeUntilStart()) >= 0);
assertEquals(taskC.getTimeUntilEnd(), taskD.getTimeUntilStart());
assertEquals(taskC.getTimeUntilEnd().plus(taskD.getEstimatedDuration()), taskD.getTimeUntilEnd());
//Delay of previous task is not impact next task
assertEquals(Duration.ZERO, taskD.getTimeUntilStart());
}
}
Loading

0 comments on commit 86067b6

Please sign in to comment.