@Override public CountResultDto queryTasksCount(TaskQueryDto queryDto) { ProcessEngine engine = getProcessEngine(); queryDto.setObjectMapper(getObjectMapper()); TaskQuery query = queryDto.toQuery(engine); long count = query.count(); CountResultDto result = new CountResultDto(); result.setCount(count); return result; }
public HalTaskList getHalTasks(UriInfo uriInfo, Integer firstResult, Integer maxResults) { TaskQueryDto queryDto = new TaskQueryDto(getObjectMapper(), uriInfo.getQueryParameters()); ProcessEngine engine = getProcessEngine(); TaskQuery query = queryDto.toQuery(engine); // get list of tasks List<Task> matchingTasks = executeTaskQuery(firstResult, maxResults, query); // get total count long count = query.count(); return HalTaskList.generate(matchingTasks, count, engine); }
@Override public List<TaskDto> queryTasks(TaskQueryDto queryDto, Integer firstResult, Integer maxResults) { ProcessEngine engine = getProcessEngine(); queryDto.setObjectMapper(getObjectMapper()); TaskQuery query = queryDto.toQuery(engine); List<Task> matchingTasks = executeTaskQuery(firstResult, maxResults, query); List<TaskDto> tasks = new ArrayList<TaskDto>(); for (Task task : matchingTasks) { TaskDto returnTask = TaskDto.fromEntity(task); tasks.add(returnTask); } return tasks; }