Search in sources :

Example 1 with FilterDto

use of org.camunda.bpm.engine.rest.dto.runtime.FilterDto in project camunda-bpm-platform by camunda.

the class FilterResourceImpl method getFilter.

public FilterDto getFilter(Boolean itemCount) {
    Filter filter = getDbFilter();
    FilterDto dto = FilterDto.fromFilter(filter);
    if (itemCount != null && itemCount) {
        dto.setItemCount(filterService.count(filter.getId()));
    }
    return dto;
}
Also used : Filter(org.camunda.bpm.engine.filter.Filter) FilterDto(org.camunda.bpm.engine.rest.dto.runtime.FilterDto)

Example 2 with FilterDto

use of org.camunda.bpm.engine.rest.dto.runtime.FilterDto in project camunda-bpm-platform by camunda.

the class FilterRestServiceImpl method getFilters.

public List<FilterDto> getFilters(UriInfo uriInfo, Boolean itemCount, Integer firstResult, Integer maxResults) {
    FilterService filterService = getProcessEngine().getFilterService();
    FilterQuery query = getQueryFromQueryParameters(uriInfo.getQueryParameters());
    List<Filter> matchingFilters = executeFilterQuery(query, firstResult, maxResults);
    List<FilterDto> filters = new ArrayList<FilterDto>();
    for (Filter filter : matchingFilters) {
        FilterDto dto = FilterDto.fromFilter(filter);
        if (itemCount != null && itemCount) {
            dto.setItemCount(filterService.count(filter.getId()));
        }
        filters.add(dto);
    }
    return filters;
}
Also used : Filter(org.camunda.bpm.engine.filter.Filter) FilterService(org.camunda.bpm.engine.FilterService) ArrayList(java.util.ArrayList) FilterQuery(org.camunda.bpm.engine.filter.FilterQuery) FilterDto(org.camunda.bpm.engine.rest.dto.runtime.FilterDto)

Aggregations

Filter (org.camunda.bpm.engine.filter.Filter)2 FilterDto (org.camunda.bpm.engine.rest.dto.runtime.FilterDto)2 ArrayList (java.util.ArrayList)1 FilterService (org.camunda.bpm.engine.FilterService)1 FilterQuery (org.camunda.bpm.engine.filter.FilterQuery)1