Search in sources :

Example 1 with TASK_ATTR_OWNER

use of org.jbpm.casemgmt.api.AdvanceCaseRuntimeDataService.TASK_ATTR_OWNER in project droolsjbpm-integration by kiegroup.

the class CaseManagementRuntimeDataServiceBase method queryCasesByVariables.

public CaseInstanceCustomVarsList queryCasesByVariables(String payload, String payloadType, QueryContext queryContext) {
    SearchQueryFilterSpec filter = new SearchQueryFilterSpec();
    if (payload != null) {
        filter = marshallerHelper.unmarshal(payload, payloadType, SearchQueryFilterSpec.class);
    }
    List<String> params = filter.getAttributesQueryParams().stream().map(e -> e.getColumn()).collect(toList());
    params.removeAll(asList(TASK_ATTR_NAME, TASK_ATTR_OWNER, TASK_ATTR_STATUS));
    if (params.size() == filter.getAttributesQueryParams().size() && filter.getTaskVariablesQueryParams().isEmpty()) {
        return convertToCaseInstanceCustomVarsList(advanceCaseRuntimeDataService.queryCaseByVariables(convertToServiceApiQueryParam(filter.getAttributesQueryParams()), convertToServiceApiQueryParam(filter.getCaseVariablesQueryParams()), queryContext));
    } else {
        return convertToCaseInstanceCustomVarsList(advanceCaseRuntimeDataService.queryCaseByVariablesAndTask(convertToServiceApiQueryParam(filter.getAttributesQueryParams()), convertToServiceApiQueryParam(filter.getTaskVariablesQueryParams()), convertToServiceApiQueryParam(filter.getCaseVariablesQueryParams()), filter.getOwners(), queryContext));
    }
}
Also used : CaseDefinitionList(org.kie.server.api.model.cases.CaseDefinitionList) TaskSummary(org.kie.api.task.model.TaskSummary) CaseInstanceCustomVarsList(org.kie.server.api.model.cases.CaseInstanceCustomVarsList) CaseUserTaskWithVariablesList(org.kie.server.api.model.cases.CaseUserTaskWithVariablesList) CaseDefinition(org.jbpm.casemgmt.api.model.CaseDefinition) ProcessInstance(org.kie.server.api.model.instance.ProcessInstance) KieServerConstants(org.kie.server.api.KieServerConstants) CaseStage(org.kie.server.api.model.cases.CaseStage) ProcessInstanceList(org.kie.server.api.model.instance.ProcessInstanceList) MarshallerHelper(org.kie.server.services.impl.marshal.MarshallerHelper) CaseFileDataItemList(org.kie.server.api.model.cases.CaseFileDataItemList) ConvertUtils.convertToServiceApiQueryParam(org.kie.server.services.casemgmt.ConvertUtils.convertToServiceApiQueryParam) CaseInstance(org.kie.server.api.model.cases.CaseInstance) ArrayList(java.util.ArrayList) CaseRuntimeDataService(org.jbpm.casemgmt.api.CaseRuntimeDataService) TASK_ATTR_OWNER(org.jbpm.casemgmt.api.AdvanceCaseRuntimeDataService.TASK_ATTR_OWNER) CaseInstanceList(org.kie.server.api.model.cases.CaseInstanceList) CaseStageInstance(org.jbpm.casemgmt.api.model.instance.CaseStageInstance) TaskSummaryList(org.kie.server.api.model.instance.TaskSummaryList) Arrays.asList(java.util.Arrays.asList) ProcessInstanceDesc(org.jbpm.services.api.model.ProcessInstanceDesc) ProcessDefinitionList(org.kie.server.api.model.definition.ProcessDefinitionList) CaseStageList(org.kie.server.api.model.cases.CaseStageList) NodeInstanceList(org.kie.server.api.model.instance.NodeInstanceList) CaseMilestoneInstance(org.jbpm.casemgmt.api.model.instance.CaseMilestoneInstance) TASK_ATTR_NAME(org.jbpm.casemgmt.api.AdvanceCaseRuntimeDataService.TASK_ATTR_NAME) IdentityProvider(org.kie.internal.identity.IdentityProvider) CaseMilestone(org.kie.server.api.model.cases.CaseMilestone) ConvertUtils.convertToCaseInstanceCustomVarsList(org.kie.server.services.casemgmt.ConvertUtils.convertToCaseInstanceCustomVarsList) CaseMilestoneList(org.kie.server.api.model.cases.CaseMilestoneList) NodeInstance(org.kie.server.api.model.instance.NodeInstance) TASK_ATTR_STATUS(org.jbpm.casemgmt.api.AdvanceCaseRuntimeDataService.TASK_ATTR_STATUS) Collection(java.util.Collection) QueryContext(org.kie.api.runtime.query.QueryContext) SearchQueryFilterSpec(org.kie.server.api.model.definition.SearchQueryFilterSpec) AdvanceCaseRuntimeDataService(org.jbpm.casemgmt.api.AdvanceCaseRuntimeDataService) KieServerRegistry(org.kie.server.services.api.KieServerRegistry) NodeInstanceDesc(org.jbpm.services.api.model.NodeInstanceDesc) CaseFileItem(org.jbpm.casemgmt.api.model.CaseFileItem) List(java.util.List) CaseAdHocFragmentList(org.kie.server.api.model.cases.CaseAdHocFragmentList) Collectors.toList(java.util.stream.Collectors.toList) CaseAdHocFragment(org.kie.server.api.model.cases.CaseAdHocFragment) CaseStatus(org.jbpm.casemgmt.api.model.CaseStatus) AdHocFragment(org.jbpm.casemgmt.api.model.AdHocFragment) Status(org.kie.api.task.model.Status) ContainerLocatorProvider(org.kie.server.services.impl.locator.ContainerLocatorProvider) SearchQueryFilterSpec(org.kie.server.api.model.definition.SearchQueryFilterSpec)

Aggregations

ArrayList (java.util.ArrayList)1 Arrays.asList (java.util.Arrays.asList)1 Collection (java.util.Collection)1 List (java.util.List)1 Collectors.toList (java.util.stream.Collectors.toList)1 AdvanceCaseRuntimeDataService (org.jbpm.casemgmt.api.AdvanceCaseRuntimeDataService)1 TASK_ATTR_NAME (org.jbpm.casemgmt.api.AdvanceCaseRuntimeDataService.TASK_ATTR_NAME)1 TASK_ATTR_OWNER (org.jbpm.casemgmt.api.AdvanceCaseRuntimeDataService.TASK_ATTR_OWNER)1 TASK_ATTR_STATUS (org.jbpm.casemgmt.api.AdvanceCaseRuntimeDataService.TASK_ATTR_STATUS)1 CaseRuntimeDataService (org.jbpm.casemgmt.api.CaseRuntimeDataService)1 AdHocFragment (org.jbpm.casemgmt.api.model.AdHocFragment)1 CaseDefinition (org.jbpm.casemgmt.api.model.CaseDefinition)1 CaseFileItem (org.jbpm.casemgmt.api.model.CaseFileItem)1 CaseStatus (org.jbpm.casemgmt.api.model.CaseStatus)1 CaseMilestoneInstance (org.jbpm.casemgmt.api.model.instance.CaseMilestoneInstance)1 CaseStageInstance (org.jbpm.casemgmt.api.model.instance.CaseStageInstance)1 NodeInstanceDesc (org.jbpm.services.api.model.NodeInstanceDesc)1 ProcessInstanceDesc (org.jbpm.services.api.model.ProcessInstanceDesc)1 QueryContext (org.kie.api.runtime.query.QueryContext)1 Status (org.kie.api.task.model.Status)1