})
public void testOrderProcessWithCallActivity() {
if(processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.FULL)) {
// After the process has started, the 'verify credit history' task should be active
ProcessInstance pi = runtimeService.startProcessInstanceByKey("orderProcess");
TaskQuery taskQuery = taskService.createTaskQuery();
Task verifyCreditTask = taskQuery.singleResult();
assertEquals("Verify credit history", verifyCreditTask.getName());
// Verify with Query API
ProcessInstance subProcessInstance = runtimeService.createProcessInstanceQuery().superProcessInstanceId(pi.getId()).singleResult();
assertNotNull(subProcessInstance);
assertEquals(pi.getId(), runtimeService.createProcessInstanceQuery().subProcessInstanceId(subProcessInstance.getId()).singleResult().getId());
// Completing the task with approval, will end the subprocess and continue the original process
taskService.complete(verifyCreditTask.getId(), CollectionUtil.singletonMap("creditApproved", true));
Task prepareAndShipTask = taskQuery.singleResult();
assertEquals("Prepare and Ship", prepareAndShipTask.getName());
}
}