use of org.camunda.bpm.engine.runtime.ActivityInstance in project camunda-bpm-platform by camunda.
the class RuntimeServiceTest method testTransitionInstanceActivityTypePropertyAfterTask.
@Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/RuntimeServiceTest.testTransitionInstanceActivityNamePropertyAfterTask.bpmn20.xml")
@Test
public void testTransitionInstanceActivityTypePropertyAfterTask() {
// given
String processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();
// when
ActivityInstance tree = runtimeService.getActivityInstance(processInstanceId);
// then
TransitionInstance[] instances = tree.getTransitionInstances("firstServiceTask");
TransitionInstance task = instances[0];
assertNotNull(task);
assertNotNull(task.getActivityType());
assertEquals("serviceTask", task.getActivityType());
instances = tree.getTransitionInstances("secondServiceTask");
task = instances[0];
assertNotNull(task);
assertNotNull(task.getActivityType());
assertEquals("serviceTask", task.getActivityType());
}
use of org.camunda.bpm.engine.runtime.ActivityInstance in project camunda-bpm-platform by camunda.
the class ProcessInstantiationAtActivitiesTest method testSingleActivityInstantiationById.
@Deployment(resources = EXCLUSIVE_GATEWAY_PROCESS)
public void testSingleActivityInstantiationById() {
// given
String processDefinitionId = repositoryService.createProcessDefinitionQuery().singleResult().getId();
// when
ProcessInstance instance = runtimeService.createProcessInstanceById(processDefinitionId).startBeforeActivity("task1").execute();
// then
assertNotNull(instance);
ActivityInstance updatedTree = runtimeService.getActivityInstance(instance.getId());
assertNotNull(updatedTree);
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(instance.getProcessDefinitionId()).activity("task1").done());
// and it is possible to end the process
completeTasksInOrder("task1");
assertProcessEnded(instance.getId());
}
use of org.camunda.bpm.engine.runtime.ActivityInstance in project camunda-bpm-platform by camunda.
the class ProcessInstantiationAtActivitiesTest method testSkipListenerInvocation.
@Deployment(resources = LISTENERS_PROCESS)
public void testSkipListenerInvocation() {
RecorderExecutionListener.clear();
// when
ProcessInstance instance = runtimeService.createProcessInstanceByKey("listenerProcess").startBeforeActivity("innerTask").execute(true, true);
// then
ActivityInstance updatedTree = runtimeService.getActivityInstance(instance.getId());
assertNotNull(updatedTree);
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(instance.getProcessDefinitionId()).beginScope("subProcess").activity("innerTask").done());
List<RecordedEvent> events = RecorderExecutionListener.getRecordedEvents();
assertEquals(0, events.size());
}
use of org.camunda.bpm.engine.runtime.ActivityInstance in project camunda-bpm-platform by camunda.
the class ProcessInstantiationAtActivitiesTest method testSingleActivityInstantiation.
@Deployment(resources = EXCLUSIVE_GATEWAY_PROCESS)
public void testSingleActivityInstantiation() {
// when
ProcessInstance instance = runtimeService.createProcessInstanceByKey("exclusiveGateway").startBeforeActivity("task1").execute();
// then
assertNotNull(instance);
ActivityInstance updatedTree = runtimeService.getActivityInstance(instance.getId());
assertNotNull(updatedTree);
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(instance.getProcessDefinitionId()).activity("task1").done());
// and it is possible to end the process
completeTasksInOrder("task1");
assertProcessEnded(instance.getId());
}
use of org.camunda.bpm.engine.runtime.ActivityInstance in project camunda-bpm-platform by camunda.
the class ProcessInstantiationAtActivitiesTest method testNestedActivitiesInstantiation.
@Deployment(resources = SUBPROCESS_PROCESS)
public void testNestedActivitiesInstantiation() {
// when
ProcessInstance instance = runtimeService.createProcessInstanceByKey("subprocess").startBeforeActivity("innerTask").startBeforeActivity("outerTask").startBeforeActivity("innerTask").execute();
// then
assertNotNull(instance);
ActivityInstance updatedTree = runtimeService.getActivityInstance(instance.getId());
assertNotNull(updatedTree);
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(instance.getProcessDefinitionId()).activity("outerTask").beginScope("subProcess").activity("innerTask").activity("innerTask").done());
// and it is possible to end the process
completeTasksInOrder("innerTask", "innerTask", "outerTask", "innerTask");
assertProcessEnded(instance.getId());
}
Aggregations