Search in sources :

Example 1 with DeploymentDto

use of org.camunda.bpm.engine.rest.dto.repository.DeploymentDto 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)

Aggregations

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