private void verifyStringParameterQueryInvocations() { Map<String, String> stringQueryParameters = getCompleteStringQueryParameters(); verify(mockedQuery).processInstanceId(stringQueryParameters.get("processInstanceId")); verify(mockedQuery).processInstanceBusinessKey(stringQueryParameters.get("processInstanceBusinessKey")); verify(mockedQuery).processInstanceBusinessKeyLike(stringQueryParameters.get("processInstanceBusinessKeyLike")); verify(mockedQuery).processDefinitionId(stringQueryParameters.get("processDefinitionId")); verify(mockedQuery).processDefinitionKey(stringQueryParameters.get("processDefinitionKey")); verify(mockedQuery).processDefinitionName(stringQueryParameters.get("processDefinitionName")); verify(mockedQuery).processDefinitionNameLike(stringQueryParameters.get("processDefinitionNameLike")); verify(mockedQuery).startedBy(stringQueryParameters.get("startedBy")); verify(mockedQuery).superProcessInstanceId(stringQueryParameters.get("superProcessInstanceId")); verify(mockedQuery).subProcessInstanceId(stringQueryParameters.get("subProcessInstanceId")); verify(mockedQuery).superCaseInstanceId(stringQueryParameters.get("superCaseInstanceId")); verify(mockedQuery).subCaseInstanceId(stringQueryParameters.get("subCaseInstanceId")); verify(mockedQuery).caseInstanceId(stringQueryParameters.get("caseInstanceId")); verify(mockedQuery).incidentType(stringQueryParameters.get("incidentType")); verify(mockedQuery).list(); }
public void testQueryByRootProcessInstancesAndSuperProcess() { // when try { historyService.createHistoricProcessInstanceQuery() .rootProcessInstances() .superProcessInstanceId("processInstanceId"); fail("expected exception"); } catch (BadUserRequestException e) { // then assertTrue(e.getMessage().contains("Invalid query usage: cannot set both rootProcessInstances and superProcessInstanceId")); } // when try { historyService.createHistoricProcessInstanceQuery() .superProcessInstanceId("processInstanceId") .rootProcessInstances(); fail("expected exception"); } catch (BadUserRequestException e) { // then assertTrue(e.getMessage().contains("Invalid query usage: cannot set both rootProcessInstances and superProcessInstanceId")); } }
query.superProcessInstanceId(superProcessInstanceId);
query.superProcessInstanceId(superProcessInstanceId);
@Deployment(resources = {"org/camunda/bpm/engine/test/api/history/orderProcess.bpmn20.xml", "org/camunda/bpm/engine/test/api/history/checkCreditProcess.bpmn20.xml"}) public void testOrderProcessWithCallActivity() { // 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(); // 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()); // verify HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().superProcessInstanceId(pi.getId()).singleResult(); assertNotNull(historicProcessInstance); assertTrue(historicProcessInstance.getProcessDefinitionId().contains("checkCreditProcess")); }
HistoricProcessInstance hpi = historyService.createHistoricProcessInstanceQuery().superProcessInstanceId(processInstance.getId()).singleResult(); assertEquals(businessKey, hpi.getBusinessKey()); HistoricProcessInstance hpi = historyService.createHistoricProcessInstanceQuery().superProcessInstanceId(processInstance.getId()).finished().singleResult(); assertEquals(businessKey, hpi.getBusinessKey());
public void testQueryByRootProcessInstancesAndSuperProcess() { // when try { historyService.createHistoricProcessInstanceQuery() .rootProcessInstances() .superProcessInstanceId("processInstanceId"); fail("expected exception"); } catch (BadUserRequestException e) { // then assertTrue(e.getMessage().contains("Invalid query usage: cannot set both rootProcessInstances and superProcessInstanceId")); } // when try { historyService.createHistoricProcessInstanceQuery() .superProcessInstanceId("processInstanceId") .rootProcessInstances(); fail("expected exception"); } catch (BadUserRequestException e) { // then assertTrue(e.getMessage().contains("Invalid query usage: cannot set both rootProcessInstances and superProcessInstanceId")); } }
query.superProcessInstanceId(superProcessInstanceId);
@Deployment(resources = {"org/camunda/bpm/engine/test/api/history/orderProcess.bpmn20.xml", "org/camunda/bpm/engine/test/api/history/checkCreditProcess.bpmn20.xml"}) public void testOrderProcessWithCallActivity() { // 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(); // 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()); // verify HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().superProcessInstanceId(pi.getId()).singleResult(); assertNotNull(historicProcessInstance); assertTrue(historicProcessInstance.getProcessDefinitionId().contains("checkCreditProcess")); }
HistoricProcessInstance hpi = historyService.createHistoricProcessInstanceQuery().superProcessInstanceId(processInstance.getId()).singleResult(); assertEquals(businessKey, hpi.getBusinessKey()); HistoricProcessInstance hpi = historyService.createHistoricProcessInstanceQuery().superProcessInstanceId(processInstance.getId()).finished().singleResult(); assertEquals(businessKey, hpi.getBusinessKey());