use of org.camunda.bpm.engine.rest.dto.history.HistoricTaskInstanceReportQueryDto in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceRestServiceImpl method getHistoricTaskInstanceReport.
@Override
public Response getHistoricTaskInstanceReport(UriInfo uriInfo) {
HistoricTaskInstanceReportQueryDto queryDto = new HistoricTaskInstanceReportQueryDto(objectMapper, uriInfo.getQueryParameters());
Response response;
if (AbstractReportDto.REPORT_TYPE_DURATION.equals(queryDto.getReportType())) {
List<? extends ReportResult> reportResults = queryDto.executeReport(processEngine);
response = Response.ok(generateDurationDto(reportResults)).build();
} else if (AbstractReportDto.REPORT_TYPE_COUNT.equals(queryDto.getReportType())) {
List<HistoricTaskInstanceReportResult> reportResults = queryDto.executeCompletedReport(processEngine);
response = Response.ok(generateCountDto(reportResults)).build();
} else {
throw new InvalidRequestException(Response.Status.BAD_REQUEST, "Parameter reportType is not set.");
}
return response;
}
Aggregations