use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByInvalidIncidentMessageLike.
public void testQueryByInvalidIncidentMessageLike() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
verifyQueryResults(query.incidentMessageLike("invalid"), 0);
try {
query.incidentMessageLike(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 testQueryByIncidentMessage.
@org.camunda.bpm.engine.test.Deployment(resources = { "org/camunda/bpm/engine/test/api/repository/failingProcessCreateOneIncident.bpmn20.xml" })
public void testQueryByIncidentMessage() {
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().incidentMessage(incident.getIncidentMessage());
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByIncidentMessageLike.
@org.camunda.bpm.engine.test.Deployment(resources = { "org/camunda/bpm/engine/test/api/repository/failingProcessCreateOneIncident.bpmn20.xml" })
public void testQueryByIncidentMessageLike() {
assertEquals(1, repositoryService.createProcessDefinitionQuery().processDefinitionKey("failingProcess").count());
runtimeService.startProcessInstanceByKey("failingProcess");
executeAvailableJobs();
List<Incident> incidentList = runtimeService.createIncidentQuery().list();
assertEquals(1, incidentList.size());
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().incidentMessageLike("%expected%");
verifyQueryResults(query, 1);
query = repositoryService.createProcessDefinitionQuery().incidentMessageLike("%\\_expected%");
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByInvalidDeploymentId.
public void testQueryByInvalidDeploymentId() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().deploymentId("invalid");
verifyQueryResults(query, 0);
try {
repositoryService.createProcessDefinitionQuery().deploymentId(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 testQueryByKeyLike.
public void testQueryByKeyLike() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionKeyLike("%o%");
verifyQueryResults(query, 3);
query = query.processDefinitionKeyLike("%z\\_%");
verifyQueryResults(query, 1);
}
Aggregations