use of org.camunda.bpm.engine.test.util.ExecutionTree in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationEventSubProcessTest method testStartBeforeStartEventInsideNonInterruptingEventSubProcess.
@Deployment(resources = NON_INTERRUPTING_EVENT_SUBPROCESS)
public void testStartBeforeStartEventInsideNonInterruptingEventSubProcess() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
String processInstanceId = processInstance.getId();
runtimeService.createProcessInstanceModification(processInstanceId).startBeforeActivity("eventProcessStart").execute();
ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstanceId);
assertNotNull(updatedTree);
assertEquals(processInstanceId, updatedTree.getProcessInstanceId());
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).activity("task1").beginScope("eventSubProcess").activity("eventSubProcessTask").endScope().done());
ExecutionTree executionTree = ExecutionTree.forExecution(processInstanceId, processEngine);
assertThat(executionTree).matches(describeExecutionTree(null).scope().child("task1").concurrent().noScope().up().child(null).concurrent().noScope().child("eventSubProcessTask").scope().done());
completeTasksInOrder("task1", "task2", "eventSubProcessTask");
assertProcessEnded(processInstanceId);
}
use of org.camunda.bpm.engine.test.util.ExecutionTree in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationEventSubProcessTest method testStartBeforeNonInterruptingEventSubProcess.
@Deployment(resources = NON_INTERRUPTING_EVENT_SUBPROCESS)
public void testStartBeforeNonInterruptingEventSubProcess() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
String processInstanceId = processInstance.getId();
runtimeService.createProcessInstanceModification(processInstanceId).startBeforeActivity("eventSubProcess").execute();
ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstanceId);
assertNotNull(updatedTree);
assertEquals(processInstanceId, updatedTree.getProcessInstanceId());
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).activity("task1").beginScope("eventSubProcess").activity("eventSubProcessTask").endScope().done());
ExecutionTree executionTree = ExecutionTree.forExecution(processInstanceId, processEngine);
assertThat(executionTree).matches(describeExecutionTree(null).scope().child("task1").concurrent().noScope().up().child(null).concurrent().noScope().child("eventSubProcessTask").scope().done());
completeTasksInOrder("task1", "eventSubProcessTask", "task2");
assertProcessEnded(processInstanceId);
}
use of org.camunda.bpm.engine.test.util.ExecutionTree in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationEventSubProcessTest method testStartBeforeEventSubProcessInsideSubProcess.
@Deployment(resources = INTERRUPTING_EVENT_SUBPROCESS_INSIDE_SUBPROCESS)
public void testStartBeforeEventSubProcessInsideSubProcess() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
String processInstanceId = processInstance.getId();
runtimeService.createProcessInstanceModification(processInstanceId).startBeforeActivity("eventSubProcess").execute();
ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstanceId);
assertNotNull(updatedTree);
assertEquals(processInstanceId, updatedTree.getProcessInstanceId());
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).activity("task1").beginScope("subProcess").beginScope("eventSubProcess").activity("eventSubProcessTask").done());
ExecutionTree executionTree = ExecutionTree.forExecution(processInstanceId, processEngine);
assertThat(executionTree).matches(describeExecutionTree(null).scope().child("task1").concurrent().noScope().up().child(null).concurrent().noScope().child(null).scope().child("eventSubProcessTask").scope().done());
completeTasksInOrder("task1", "eventSubProcessTask", "task2");
assertProcessEnded(processInstanceId);
}
use of org.camunda.bpm.engine.test.util.ExecutionTree in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationEventSubProcessTest method testStartBeforeTaskInsideEventSubProcessInsideSubProcess.
@Deployment(resources = INTERRUPTING_EVENT_SUBPROCESS_INSIDE_SUBPROCESS)
public void testStartBeforeTaskInsideEventSubProcessInsideSubProcess() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
String processInstanceId = processInstance.getId();
runtimeService.createProcessInstanceModification(processInstanceId).startBeforeActivity("eventSubProcessTask").execute();
ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstanceId);
assertNotNull(updatedTree);
assertEquals(processInstanceId, updatedTree.getProcessInstanceId());
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).activity("task1").beginScope("subProcess").beginScope("eventSubProcess").activity("eventSubProcessTask").done());
ExecutionTree executionTree = ExecutionTree.forExecution(processInstanceId, processEngine);
assertThat(executionTree).matches(describeExecutionTree(null).scope().child("task1").concurrent().noScope().up().child(null).concurrent().noScope().child(null).scope().child("eventSubProcessTask").scope().done());
completeTasksInOrder("task1", "eventSubProcessTask", "task2");
assertProcessEnded(processInstanceId);
}
use of org.camunda.bpm.engine.test.util.ExecutionTree in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationEventSubProcessTest method testStartBeforeTaskInsideNonInterruptingEventSubProcess.
@Deployment(resources = NON_INTERRUPTING_EVENT_SUBPROCESS)
public void testStartBeforeTaskInsideNonInterruptingEventSubProcess() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
String processInstanceId = processInstance.getId();
runtimeService.createProcessInstanceModification(processInstanceId).startBeforeActivity("eventSubProcessTask").execute();
ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstanceId);
assertNotNull(updatedTree);
assertEquals(processInstanceId, updatedTree.getProcessInstanceId());
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).activity("task1").beginScope("eventSubProcess").activity("eventSubProcessTask").endScope().done());
ExecutionTree executionTree = ExecutionTree.forExecution(processInstanceId, processEngine);
assertThat(executionTree).matches(describeExecutionTree(null).scope().child("task1").concurrent().noScope().up().child(null).concurrent().noScope().child("eventSubProcessTask").scope().done());
completeTasksInOrder("task1", "eventSubProcessTask", "task2");
assertProcessEnded(processInstanceId);
}
Aggregations