use of org.camunda.bpm.engine.runtime.ActivityInstance in project camunda-bpm-platform by camunda.
the class RuntimeServiceTest method testGetInvalidTransitionInstancesForActivity.
@Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/RuntimeServiceTest.testGetTransitionInstancesForActivity.bpmn20.xml")
@Test
public void testGetInvalidTransitionInstancesForActivity() {
ProcessInstance instance = runtimeService.startProcessInstanceByKey("miSubprocess");
ActivityInstance tree = runtimeService.getActivityInstance(instance.getId());
try {
tree.getTransitionInstances(null);
fail("exception expected");
} catch (NullValueException e) {
// happy path
}
}
use of org.camunda.bpm.engine.runtime.ActivityInstance in project camunda-bpm-platform by camunda.
the class RuntimeServiceTest method testTransitionInstanceActivityTypePropertyAfterStartEvent.
@Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/RuntimeServiceTest.testTransitionInstanceActivityNamePropertyAfterStartEvent.bpmn20.xml")
@Test
public void testTransitionInstanceActivityTypePropertyAfterStartEvent() {
// given
String processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();
// when
ActivityInstance tree = runtimeService.getActivityInstance(processInstanceId);
// then
TransitionInstance[] instances = tree.getTransitionInstances("start");
TransitionInstance task = instances[0];
assertNotNull(task);
assertNotNull(task.getActivityType());
assertEquals("startEvent", task.getActivityType());
}
use of org.camunda.bpm.engine.runtime.ActivityInstance in project camunda-bpm-platform by camunda.
the class RuntimeServiceTest method testActivityInstanceTreeForNestedAsyncBeforeTask.
@Deployment
@Test
public void testActivityInstanceTreeForNestedAsyncBeforeTask() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess");
ActivityInstance tree = runtimeService.getActivityInstance(processInstance.getId());
assertThat(tree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).beginScope("subProcess").transition("theTask").done());
TransitionInstance asyncBeforeTransitionInstance = tree.getChildActivityInstances()[0].getChildTransitionInstances()[0];
String asyncExecutionId = managementService.createJobQuery().singleResult().getExecutionId();
assertEquals(asyncExecutionId, asyncBeforeTransitionInstance.getExecutionId());
}
use of org.camunda.bpm.engine.runtime.ActivityInstance 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.ActivityInstance 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());
}
Aggregations