use of org.activiti.engine.repository.ProcessDefinitionQuery in project Activiti by Activiti.
the class ProcessDefinitionQueryTest method testQueryByKeyAndVersion.
public void testQueryByKeyAndVersion() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("one").processDefinitionVersion(1);
verifyQueryResults(query, 1);
query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("one").processDefinitionVersion(2);
verifyQueryResults(query, 1);
query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("one").processDefinitionVersion(3);
verifyQueryResults(query, 0);
}
use of org.activiti.engine.repository.ProcessDefinitionQuery in project Activiti by Activiti.
the class ProcessDefinitionQueryTest method testQueryByKeyLike.
public void testQueryByKeyLike() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionKeyLike("%o%");
verifyQueryResults(query, 3);
}
use of org.activiti.engine.repository.ProcessDefinitionQuery in project Activiti by Activiti.
the class ProcessDefinitionQueryTest method testQueryByKey.
public void testQueryByKey() {
// process one
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("one");
verifyQueryResults(query, 2);
// process two
query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("two");
verifyQueryResults(query, 1);
}
use of org.activiti.engine.repository.ProcessDefinitionQuery in project Activiti by Activiti.
the class ProcessDefinitionQueryEscapeClauseTest method testQueryByNameLike.
public void testQueryByNameLike() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionNameLike("%\\%%");
assertEquals("One%", query.singleResult().getName());
assertEquals(1, query.list().size());
assertEquals(1, query.count());
query = repositoryService.createProcessDefinitionQuery().processDefinitionNameLike("%\\_%");
assertEquals("Two_", query.singleResult().getName());
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}
use of org.activiti.engine.repository.ProcessDefinitionQuery in project Activiti by Activiti.
the class ProcessDefinitionQueryEscapeClauseTest method testQueryByTenantIdLike.
public void testQueryByTenantIdLike() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionTenantIdLike("%\\%%");
assertEquals("One%", query.singleResult().getTenantId());
assertEquals(1, query.list().size());
assertEquals(1, query.count());
query = repositoryService.createProcessDefinitionQuery().processDefinitionTenantIdLike("%\\_%");
assertEquals("Two_", query.singleResult().getTenantId());
assertEquals(1, query.list().size());
assertEquals(1, query.count());
query = repositoryService.createProcessDefinitionQuery().latestVersion().processDefinitionTenantIdLike("%\\%%");
assertEquals("One%", query.singleResult().getTenantId());
assertEquals(1, query.list().size());
assertEquals(1, query.count());
query = repositoryService.createProcessDefinitionQuery().latestVersion().processDefinitionTenantIdLike("%\\_%");
assertEquals("Two_", query.singleResult().getTenantId());
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}
Aggregations