use of org.camunda.bpm.engine.test.util.ExecutionTree in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationBoundaryEventTest method testTask2AndStartBeforeTaskAfterBoundaryEventInsideSubProcess.
@Deployment(resources = INTERRUPTING_BOUNDARY_EVENT_INSIDE_SUBPROCESS)
public void testTask2AndStartBeforeTaskAfterBoundaryEventInsideSubProcess() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
String processInstanceId = processInstance.getId();
String taskId = taskService.createTaskQuery().singleResult().getId();
taskService.complete(taskId);
runtimeService.createProcessInstanceModification(processInstanceId).startBeforeActivity("innerTaskAfterBoundaryEvent").execute();
ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstanceId);
assertNotNull(updatedTree);
assertEquals(processInstanceId, updatedTree.getProcessInstanceId());
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).beginScope("subProcess").activity("innerTask2").activity("innerTaskAfterBoundaryEvent").done());
ExecutionTree executionTree = ExecutionTree.forExecution(processInstanceId, processEngine);
assertThat(executionTree).matches(describeExecutionTree(null).scope().child(null).scope().child("innerTaskAfterBoundaryEvent").concurrent().noScope().up().child("innerTask2").concurrent().noScope().done());
completeTasksInOrder("innerTask2", "innerTaskAfterBoundaryEvent");
assertProcessEnded(processInstanceId);
}
use of org.camunda.bpm.engine.test.util.ExecutionTree in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationBoundaryEventTest method testTask2AndStartBeforeNonInterruptingBoundaryEvent.
@Deployment(resources = NON_INTERRUPTING_BOUNDARY_EVENT)
public void testTask2AndStartBeforeNonInterruptingBoundaryEvent() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
String processInstanceId = processInstance.getId();
String taskId = taskService.createTaskQuery().singleResult().getId();
taskService.complete(taskId);
runtimeService.createProcessInstanceModification(processInstanceId).startBeforeActivity("boundaryEvent").execute();
ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstanceId);
assertNotNull(updatedTree);
assertEquals(processInstanceId, updatedTree.getProcessInstanceId());
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).activity("task2").activity("taskAfterBoundaryEvent").done());
ExecutionTree executionTree = ExecutionTree.forExecution(processInstanceId, processEngine);
assertThat(executionTree).matches(describeExecutionTree(null).scope().child("taskAfterBoundaryEvent").concurrent().noScope().up().child("task2").concurrent().noScope().done());
completeTasksInOrder("task2", "taskAfterBoundaryEvent");
assertProcessEnded(processInstanceId);
}
use of org.camunda.bpm.engine.test.util.ExecutionTree in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationBoundaryEventTest method testTask2AndStartBeforeTaskAfterNonInterruptingBoundaryEvent.
@Deployment(resources = NON_INTERRUPTING_BOUNDARY_EVENT)
public void testTask2AndStartBeforeTaskAfterNonInterruptingBoundaryEvent() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
String processInstanceId = processInstance.getId();
String taskId = taskService.createTaskQuery().singleResult().getId();
taskService.complete(taskId);
runtimeService.createProcessInstanceModification(processInstanceId).startBeforeActivity("taskAfterBoundaryEvent").execute();
ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstanceId);
assertNotNull(updatedTree);
assertEquals(processInstanceId, updatedTree.getProcessInstanceId());
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).activity("task2").activity("taskAfterBoundaryEvent").done());
ExecutionTree executionTree = ExecutionTree.forExecution(processInstanceId, processEngine);
assertThat(executionTree).matches(describeExecutionTree(null).scope().child("taskAfterBoundaryEvent").concurrent().noScope().up().child("task2").concurrent().noScope().done());
completeTasksInOrder("task2", "taskAfterBoundaryEvent");
assertProcessEnded(processInstanceId);
}
use of org.camunda.bpm.engine.test.util.ExecutionTree in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationBoundaryEventTest method testStartBeforeInterruptingBoundaryEventInsideSubProcess.
@Deployment(resources = INTERRUPTING_BOUNDARY_EVENT_WITH_PARALLEL_GATEWAY_INSIDE_SUB_PROCESS)
public void testStartBeforeInterruptingBoundaryEventInsideSubProcess() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
String processInstanceId = processInstance.getId();
runtimeService.createProcessInstanceModification(processInstanceId).startBeforeActivity("boundaryEvent").execute();
ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstanceId);
assertNotNull(updatedTree);
assertEquals(processInstanceId, updatedTree.getProcessInstanceId());
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).beginScope("subProcess").activity("task1").activity("taskAfterBoundaryEvent").endScope().done());
ExecutionTree executionTree = ExecutionTree.forExecution(processInstanceId, processEngine);
assertThat(executionTree).matches(describeExecutionTree(null).scope().child(null).scope().child("task1").concurrent().noScope().up().child("taskAfterBoundaryEvent").concurrent().noScope().done());
completeTasksInOrder("task1", "taskAfterBoundaryEvent");
assertProcessEnded(processInstanceId);
}
use of org.camunda.bpm.engine.test.util.ExecutionTree in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationBoundaryEventTest method testStartBeforeNonInterruptingBoundaryEventInsideSubProcess.
@Deployment(resources = NON_INTERRUPTING_BOUNDARY_EVENT_WITH_PARALLEL_GATEWAY_INSIDE_SUB_PROCESS)
public void testStartBeforeNonInterruptingBoundaryEventInsideSubProcess() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
String processInstanceId = processInstance.getId();
runtimeService.createProcessInstanceModification(processInstanceId).startBeforeActivity("boundaryEvent").execute();
ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstanceId);
assertNotNull(updatedTree);
assertEquals(processInstanceId, updatedTree.getProcessInstanceId());
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).beginScope("subProcess").activity("task1").activity("task2").activity("taskAfterBoundaryEvent").endScope().done());
ExecutionTree executionTree = ExecutionTree.forExecution(processInstanceId, processEngine);
assertThat(executionTree).matches(describeExecutionTree(null).scope().child(null).scope().child("task1").concurrent().noScope().up().child(null).concurrent().noScope().child("task2").scope().up().up().child("taskAfterBoundaryEvent").concurrent().noScope().done());
completeTasksInOrder("task1", "task2", "taskAfterBoundaryEvent");
assertProcessEnded(processInstanceId);
}
Aggregations