use of org.wso2.carbon.bpmn.rest.model.history.HistoricDetailPaginateList in project carbon-business-process by wso2.
the class BaseHistoricDetailService method getQueryResponse.
protected DataResponse getQueryResponse(HistoricDetailQueryRequest queryRequest, Map<String, String> allRequestParams, UriInfo uriInfo) {
HistoryService historyService = BPMNOSGIService.getHistoryService();
HistoricDetailQuery query = historyService.createHistoricDetailQuery();
// Populate query based on request
if (queryRequest.getProcessInstanceId() != null) {
query.processInstanceId(queryRequest.getProcessInstanceId());
}
if (queryRequest.getExecutionId() != null) {
query.executionId(queryRequest.getExecutionId());
}
if (queryRequest.getActivityInstanceId() != null) {
query.activityInstanceId(queryRequest.getActivityInstanceId());
}
if (queryRequest.getTaskId() != null) {
query.taskId(queryRequest.getTaskId());
}
if (queryRequest.getSelectOnlyFormProperties() != null) {
if (queryRequest.getSelectOnlyFormProperties()) {
query.formProperties();
}
}
if (queryRequest.getSelectOnlyVariableUpdates() != null) {
if (queryRequest.getSelectOnlyVariableUpdates()) {
query.variableUpdates();
}
}
return new HistoricDetailPaginateList(new RestResponseFactory(), uriInfo).paginateList(allRequestParams, queryRequest, query, "processInstanceId", allowedSortProperties);
}
Aggregations