Search in sources :

Example 1 with HistoricDetailPaginateList

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);
}
Also used : HistoricDetailPaginateList(org.wso2.carbon.bpmn.rest.model.history.HistoricDetailPaginateList) RestResponseFactory(org.wso2.carbon.bpmn.rest.common.RestResponseFactory) HistoryService(org.activiti.engine.HistoryService) HistoricDetailQuery(org.activiti.engine.history.HistoricDetailQuery)

Aggregations

HistoryService (org.activiti.engine.HistoryService)1 HistoricDetailQuery (org.activiti.engine.history.HistoricDetailQuery)1 RestResponseFactory (org.wso2.carbon.bpmn.rest.common.RestResponseFactory)1 HistoricDetailPaginateList (org.wso2.carbon.bpmn.rest.model.history.HistoricDetailPaginateList)1