use of org.activiti.engine.repository.DeploymentQuery in project Activiti by Activiti.
the class DeploymentQueryTest method testQueryByNameLike.
public void testQueryByNameLike() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentNameLike("%activiti%");
assertEquals(2, query.list().size());
assertEquals(2, query.count());
try {
query.singleResult();
fail();
} catch (ActivitiException e) {
}
}
use of org.activiti.engine.repository.DeploymentQuery in project Activiti by Activiti.
the class DeploymentQueryTest method testQueryByInvalidName.
public void testQueryByInvalidName() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentName("invalid");
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
repositoryService.createDeploymentQuery().deploymentName(null);
fail();
} catch (ActivitiIllegalArgumentException e) {
}
}
use of org.activiti.engine.repository.DeploymentQuery in project Activiti by Activiti.
the class DeploymentQueryTest method testQueryByInvalidProcessDefinitionKeyLike.
public void testQueryByInvalidProcessDefinitionKeyLike() {
DeploymentQuery query = repositoryService.createDeploymentQuery().processDefinitionKeyLike("invalid");
assertEquals(0, query.list().size());
assertEquals(0, query.count());
}
use of org.activiti.engine.repository.DeploymentQuery in project Activiti by Activiti.
the class DeploymentQueryTest method testQueryByProcessDefinitionKey.
public void testQueryByProcessDefinitionKey() {
DeploymentQuery query = repositoryService.createDeploymentQuery().processDefinitionKey("one");
assertEquals(1, query.list().size());
assertEquals(1, query.count());
assertNotNull(query.singleResult());
}
use of org.activiti.engine.repository.DeploymentQuery in project Activiti by Activiti.
the class DeploymentCollectionResource method getDeployments.
@RequestMapping(value = "/repository/deployments", method = RequestMethod.GET, produces = "application/json")
public DataResponse getDeployments(@RequestParam Map<String, String> allRequestParams, HttpServletRequest request) {
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
// Apply filters
if (allRequestParams.containsKey("name")) {
deploymentQuery.deploymentName(allRequestParams.get("name"));
}
if (allRequestParams.containsKey("nameLike")) {
deploymentQuery.deploymentNameLike(allRequestParams.get("nameLike"));
}
if (allRequestParams.containsKey("category")) {
deploymentQuery.deploymentCategory(allRequestParams.get("category"));
}
if (allRequestParams.containsKey("categoryNotEquals")) {
deploymentQuery.deploymentCategoryNotEquals(allRequestParams.get("categoryNotEquals"));
}
if (allRequestParams.containsKey("tenantId")) {
deploymentQuery.deploymentTenantId(allRequestParams.get("tenantId"));
}
if (allRequestParams.containsKey("tenantIdLike")) {
deploymentQuery.deploymentTenantIdLike(allRequestParams.get("tenantIdLike"));
}
if (allRequestParams.containsKey("withoutTenantId")) {
Boolean withoutTenantId = Boolean.valueOf(allRequestParams.get("withoutTenantId"));
if (withoutTenantId) {
deploymentQuery.deploymentWithoutTenantId();
}
}
DataResponse response = new DeploymentsPaginateList(restResponseFactory).paginateList(allRequestParams, deploymentQuery, "id", allowedSortProperties);
return response;
}
Aggregations