提交 0aef5c1c 编写于 作者: J Joram Barrez

Fix nested subprocesses tests

上级 2bc90b79
......@@ -56,20 +56,6 @@ public class EndExecutionOperation extends AbstractOperation {
if (executionEntity.getCurrentFlowElement() instanceof EndEvent) {
EndEvent endEvent = (EndEvent) executionEntity.getCurrentFlowElement();
subProcess = endEvent.getSubProcess();
// TODO: discuss why this is needed. Is it needed in each case?
if (parentExecution.getParentId() != null
&& !parentExecution.getParentId().equals(parentExecution.getProcessInstanceId())) {
deleteExecution(commandContext, parentExecution);
parentExecution = executionEntityManager.get(parentExecution.getParentId());
if (subProcess != null && subProcess.getLoopCharacteristics() != null && subProcess.getBehavior() instanceof MultiInstanceActivityBehavior) {
MultiInstanceActivityBehavior multiInstanceBehavior = (MultiInstanceActivityBehavior) subProcess.getBehavior();
parentExecution.setCurrentFlowElement(subProcess);
multiInstanceBehavior.leave(parentExecution);
return;
}
}
}
if (subProcess != null) {
......
......@@ -62,19 +62,17 @@ public class SubProcessTest extends PluggableActivitiTestCase {
Date startTime = new Date();
// After staring the process, the task in the subprocess should be
// active
// After staring the process, the task in the subprocess should be active
ProcessInstance pi = runtimeService.startProcessInstanceByKey("simpleSubProcess");
Task subProcessTask = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult();
assertEquals("Task in subprocess", subProcessTask.getName());
// Setting the clock forward 2 hours 1 second (timer fires in 2 hours)
// and fire up the job executor
// Setting the clock forward 2 hours 1 second (timer fires in 2 hours) and fire up the job executor
processEngineConfiguration.getClock().setCurrentTime(new Date(startTime.getTime() + (2 * 60 * 60 * 1000) + 1000));
waitForJobExecutorToProcessAllJobs(5000L, 50L);
assertEquals(1, managementService.createJobQuery().executable().count());
waitForJobExecutorToProcessAllJobs(5000L, 500L);
// The subprocess should be left, and the escalated task should be
// active
// The subprocess should be left, and the escalated task should be active
Task escalationTask = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult();
assertEquals("Fix escalated problem", escalationTask.getName());
}
......@@ -282,8 +280,7 @@ public class SubProcessTest extends PluggableActivitiTestCase {
assertEquals("Task in subprocess A", taskA.getName());
assertEquals("Task in subprocess B", taskB.getName());
// Completing both tasks should active the tasks outside the
// subprocesses
// Completing both tasks should active the tasks outside the subprocesses
taskService.complete(taskA.getId());
taskService.complete(taskB.getId());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册