Search in sources :

Example 1 with HistoricVariableInstancePaginateList

use of org.wso2.carbon.bpmn.rest.model.history.HistoricVariableInstancePaginateList in project carbon-business-process by wso2.

the class BaseHistoricVariableInstanceService method getQueryResponse.

protected DataResponse getQueryResponse(HistoricVariableInstanceQueryRequest queryRequest, Map<String, String> allRequestParams) {
    HistoryService historyService = BPMNOSGIService.getHistoryService();
    HistoricVariableInstanceQuery query = historyService.createHistoricVariableInstanceQuery();
    // Populate query based on request
    if (queryRequest.getExcludeTaskVariables() != null) {
        if (queryRequest.getExcludeTaskVariables()) {
            query.excludeTaskVariables();
        }
    }
    if (queryRequest.getTaskId() != null) {
        query.taskId(queryRequest.getTaskId());
    }
    if (queryRequest.getExecutionId() != null) {
        query.executionId(queryRequest.getExecutionId());
    }
    if (queryRequest.getProcessInstanceId() != null) {
        query.processInstanceId(queryRequest.getProcessInstanceId());
    }
    if (queryRequest.getVariableName() != null) {
        query.variableName(queryRequest.getVariableName());
    }
    if (queryRequest.getVariableNameLike() != null) {
        query.variableNameLike(queryRequest.getVariableNameLike());
    }
    if (queryRequest.getVariables() != null) {
        addVariables(query, queryRequest.getVariables());
    }
    return new HistoricVariableInstancePaginateList(new RestResponseFactory(), uriInfo).paginateList(allRequestParams, query, "variableName", allowedSortProperties);
}
Also used : RestResponseFactory(org.wso2.carbon.bpmn.rest.common.RestResponseFactory) HistoricVariableInstanceQuery(org.activiti.engine.history.HistoricVariableInstanceQuery) HistoryService(org.activiti.engine.HistoryService) HistoricVariableInstancePaginateList(org.wso2.carbon.bpmn.rest.model.history.HistoricVariableInstancePaginateList)

Aggregations

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