use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByLatestAndNameLike.
public void testQueryByLatestAndNameLike() {
String firstDeployment = repositoryService.createDeployment().addClasspathResource("org/camunda/bpm/engine/test/api/repository/first-process.bpmn20.xml").deploy().getId();
String secondDeployment = repositoryService.createDeployment().addClasspathResource("org/camunda/bpm/engine/test/api/repository/second-process.bpmn20.xml").deploy().getId();
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
query.processDefinitionNameLike("%Test Process").latestVersion();
verifyQueryResults(query, 1);
ProcessDefinition result = query.singleResult();
assertEquals("Second Test Process", result.getName());
assertEquals(2, result.getVersion());
query.processDefinitionNameLike("%Test%").latestVersion();
verifyQueryResults(query, 1);
result = query.singleResult();
assertEquals("Second Test Process", result.getName());
assertEquals(2, result.getVersion());
query.processDefinitionNameLike("Second%").latestVersion();
result = query.singleResult();
assertEquals("Second Test Process", result.getName());
assertEquals(2, result.getVersion());
repositoryService.deleteDeployment(firstDeployment, true);
repositoryService.deleteDeployment(secondDeployment, true);
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByInvalidIncidentType.
public void testQueryByInvalidIncidentType() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
verifyQueryResults(query.incidentType("invalid"), 0);
try {
query.incidentType(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 testQueryByResourceNameLike.
public void testQueryByResourceNameLike() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionResourceNameLike("%ee\\_%");
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByInvalidResourceNameLike.
public void testQueryByInvalidResourceNameLike() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionResourceNameLike("%invalid%");
verifyQueryResults(query, 0);
try {
repositoryService.createProcessDefinitionQuery().processDefinitionResourceNameLike(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 testQueryByCategoryLike.
public void testQueryByCategoryLike() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionCategoryLike("%Example%");
verifyQueryResults(query, 3);
query = repositoryService.createProcessDefinitionQuery().processDefinitionCategoryLike("%amples2");
verifyQueryResults(query, 1);
query = repositoryService.createProcessDefinitionQuery().processDefinitionCategoryLike("%z\\_%");
verifyQueryResults(query, 1);
}
Aggregations