use of org.camunda.bpm.engine.runtime.TransitionInstance in project camunda-bpm-platform by camunda.
the class RuntimeServiceTest method testActivityInstanceTreeForAsyncAfterEndEvent.
@Deployment
@Test
public void testActivityInstanceTreeForAsyncAfterEndEvent() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("asyncEndEventProcess");
ActivityInstance tree = runtimeService.getActivityInstance(processInstance.getId());
assertThat(tree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).transition("theEnd").done());
TransitionInstance asyncAfterTransitionInstance = tree.getChildTransitionInstances()[0];
assertEquals(processInstance.getId(), asyncAfterTransitionInstance.getExecutionId());
}
use of org.camunda.bpm.engine.runtime.TransitionInstance in project camunda-bpm-platform by camunda.
the class RuntimeServiceTest method testActivityInstanceTreeForAsyncBeforeTask.
@Deployment
@Test
public void testActivityInstanceTreeForAsyncBeforeTask() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess");
ActivityInstance tree = runtimeService.getActivityInstance(processInstance.getId());
assertThat(tree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).transition("theTask").done());
TransitionInstance asyncBeforeTransitionInstance = tree.getChildTransitionInstances()[0];
assertEquals(processInstance.getId(), asyncBeforeTransitionInstance.getExecutionId());
}
use of org.camunda.bpm.engine.runtime.TransitionInstance in project camunda-bpm-platform by camunda.
the class RuntimeServiceTest method testActivityInstanceTreeForAsyncAfterTask.
@Deployment
@Test
public void testActivityInstanceTreeForAsyncAfterTask() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess");
Task task = taskService.createTaskQuery().singleResult();
taskService.complete(task.getId());
ActivityInstance tree = runtimeService.getActivityInstance(processInstance.getId());
assertThat(tree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).transition("theTask").done());
TransitionInstance asyncAfterTransitionInstance = tree.getChildTransitionInstances()[0];
assertEquals(processInstance.getId(), asyncAfterTransitionInstance.getExecutionId());
}
use of org.camunda.bpm.engine.runtime.TransitionInstance in project camunda-bpm-platform by camunda.
the class RuntimeServiceTest method testActivityInstanceTreeForAsyncBeforeStartEvent.
@Deployment
@Test
public void testActivityInstanceTreeForAsyncBeforeStartEvent() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess");
ActivityInstance tree = runtimeService.getActivityInstance(processInstance.getId());
assertThat(tree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).transition("theStart").done());
TransitionInstance asyncBeforeTransitionInstance = tree.getChildTransitionInstances()[0];
assertEquals(processInstance.getId(), asyncBeforeTransitionInstance.getExecutionId());
}
use of org.camunda.bpm.engine.runtime.TransitionInstance in project camunda-bpm-platform by camunda.
the class RuntimeServiceTest method testGetTransitionInstancesForNonExistingActivity.
@Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/RuntimeServiceTest.testGetTransitionInstancesForActivity.bpmn20.xml")
@Test
public void testGetTransitionInstancesForNonExistingActivity() {
ProcessInstance instance = runtimeService.startProcessInstanceByKey("miSubprocess");
ActivityInstance tree = runtimeService.getActivityInstance(instance.getId());
TransitionInstance[] instances = tree.getTransitionInstances("aNonExistingActivityId");
assertNotNull(instances);
assertEquals(0, instances.length);
}
Aggregations