use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByIncidentId.
@org.camunda.bpm.engine.test.Deployment(resources = { "org/camunda/bpm/engine/test/api/repository/failingProcessCreateOneIncident.bpmn20.xml" })
public void testQueryByIncidentId() {
assertEquals(1, repositoryService.createProcessDefinitionQuery().processDefinitionKey("failingProcess").count());
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("failingProcess");
executeAvailableJobs();
List<Incident> incidentList = runtimeService.createIncidentQuery().list();
assertEquals(1, incidentList.size());
Incident incident = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId()).singleResult();
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().incidentId(incident.getId());
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByIncidentType.
@org.camunda.bpm.engine.test.Deployment(resources = { "org/camunda/bpm/engine/test/api/repository/failingProcessCreateOneIncident.bpmn20.xml" })
public void testQueryByIncidentType() {
assertEquals(1, repositoryService.createProcessDefinitionQuery().processDefinitionKey("failingProcess").count());
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("failingProcess");
executeAvailableJobs();
List<Incident> incidentList = runtimeService.createIncidentQuery().list();
assertEquals(1, incidentList.size());
Incident incident = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId()).singleResult();
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().incidentType(incident.getIncidentType());
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByInvalidIncidentId.
public void testQueryByInvalidIncidentId() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
verifyQueryResults(query.incidentId("invalid"), 0);
try {
query.incidentId(null);
fail();
} catch (ProcessEngineException e) {
// Expected Exception
}
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByLatest.
public void testQueryByLatest() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().latestVersion();
verifyQueryResults(query, 3);
query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("one").latestVersion();
verifyQueryResults(query, 1);
query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("two").latestVersion();
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByDeploymentId.
public void testQueryByDeploymentId() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().deploymentId(deploymentOneId);
verifyQueryResults(query, 2);
}
Aggregations