Search in sources :

Example 1 with DeploymentQueryDto

use of org.camunda.bpm.engine.rest.dto.repository.DeploymentQueryDto in project camunda-bpm-platform by camunda.

the class DeploymentRestServiceImpl method getDeployments.

public List<DeploymentDto> getDeployments(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
    DeploymentQueryDto queryDto = new DeploymentQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
    ProcessEngine engine = getProcessEngine();
    DeploymentQuery query = queryDto.toQuery(engine);
    List<Deployment> matchingDeployments;
    if (firstResult != null || maxResults != null) {
        matchingDeployments = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        matchingDeployments = query.list();
    }
    List<DeploymentDto> deployments = new ArrayList<DeploymentDto>();
    for (Deployment deployment : matchingDeployments) {
        DeploymentDto def = DeploymentDto.fromDeployment(deployment);
        deployments.add(def);
    }
    return deployments;
}
Also used : DeploymentQueryDto(org.camunda.bpm.engine.rest.dto.repository.DeploymentQueryDto) DeploymentDto(org.camunda.bpm.engine.rest.dto.repository.DeploymentDto) ArrayList(java.util.ArrayList) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Example 2 with DeploymentQueryDto

use of org.camunda.bpm.engine.rest.dto.repository.DeploymentQueryDto in project camunda-bpm-platform by camunda.

the class DeploymentRestServiceImpl method getDeploymentsCount.

public CountResultDto getDeploymentsCount(UriInfo uriInfo) {
    DeploymentQueryDto queryDto = new DeploymentQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
    ProcessEngine engine = getProcessEngine();
    DeploymentQuery query = queryDto.toQuery(engine);
    long count = query.count();
    CountResultDto result = new CountResultDto();
    result.setCount(count);
    return result;
}
Also used : DeploymentQueryDto(org.camunda.bpm.engine.rest.dto.repository.DeploymentQueryDto) CountResultDto(org.camunda.bpm.engine.rest.dto.CountResultDto) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Aggregations

ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 DeploymentQueryDto (org.camunda.bpm.engine.rest.dto.repository.DeploymentQueryDto)2 ArrayList (java.util.ArrayList)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 DeploymentDto (org.camunda.bpm.engine.rest.dto.repository.DeploymentDto)1