Search in sources :

Example 1 with TASK_ATTR_NAME

use of org.jbpm.services.api.AdvanceRuntimeDataService.TASK_ATTR_NAME in project droolsjbpm-integration by kiegroup.

the class RuntimeDataServiceBase method queryProcessesByVariables.

public ProcessInstanceCustomVarsList queryProcessesByVariables(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 convertToProcessInstanceCustomVarsList(advanceRuntimeDataService.queryProcessByVariables(convertToServiceApiQueryParam(filter.getAttributesQueryParams()), convertToServiceApiQueryParam(filter.getProcessVariablesQueryParams()), queryContext));
    }
    return convertToProcessInstanceCustomVarsList(advanceRuntimeDataService.queryProcessByVariablesAndTask(convertToServiceApiQueryParam(filter.getAttributesQueryParams()), convertToServiceApiQueryParam(filter.getProcessVariablesQueryParams()), convertToServiceApiQueryParam(filter.getTaskVariablesQueryParams()), getOwnersQueryParam(filter), queryContext));
}
Also used : ConvertUtils.buildQueryFilter(org.kie.server.services.jbpm.ConvertUtils.buildQueryFilter) TaskSummary(org.kie.api.task.model.TaskSummary) Arrays(java.util.Arrays) KieServerConstants(org.kie.server.api.KieServerConstants) ProcessDefinition(org.jbpm.services.api.model.ProcessDefinition) ProcessInstanceList(org.kie.server.api.model.instance.ProcessInstanceList) LoggerFactory(org.slf4j.LoggerFactory) ConvertUtils.convertToServiceApiQueryParam(org.kie.server.services.jbpm.ConvertUtils.convertToServiceApiQueryParam) ConvertUtils.convertToVariablesList(org.kie.server.services.jbpm.ConvertUtils.convertToVariablesList) QueryParam(org.jbpm.services.api.query.model.QueryParam) ConvertUtils.convertToProcessInstance(org.kie.server.services.jbpm.ConvertUtils.convertToProcessInstance) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) ProcessInstanceDesc(org.jbpm.services.api.model.ProcessInstanceDesc) KieInternalServices(org.kie.internal.KieInternalServices) TaskEvent(org.kie.internal.task.api.model.TaskEvent) CountDefinition(org.kie.server.api.model.definition.CountDefinition) NodeInstanceList(org.kie.server.api.model.instance.NodeInstanceList) ConvertUtils.convertToProcessInstanceCustomVarsList(org.kie.server.services.jbpm.ConvertUtils.convertToProcessInstanceCustomVarsList) QueryParam.all(org.jbpm.services.api.query.model.QueryParam.all) NodeInstance(org.kie.server.api.model.instance.NodeInstance) Collection(java.util.Collection) ConvertUtils.buildTaskStatuses(org.kie.server.services.jbpm.ConvertUtils.buildTaskStatuses) ProcessInstanceNotFoundException(org.jbpm.services.api.ProcessInstanceNotFoundException) QueryContext(org.kie.api.runtime.query.QueryContext) VariableInstanceList(org.kie.server.api.model.instance.VariableInstanceList) AuditTask(org.kie.internal.task.api.AuditTask) KieServerRegistry(org.kie.server.services.api.KieServerRegistry) List(java.util.List) ConvertUtils.buildQueryContext(org.kie.server.services.jbpm.ConvertUtils.buildQueryContext) UserTaskInstanceDesc(org.jbpm.services.api.model.UserTaskInstanceDesc) ConvertUtils.convertToProcess(org.kie.server.services.jbpm.ConvertUtils.convertToProcess) DeploymentNotFoundException(org.jbpm.services.api.DeploymentNotFoundException) ProcessInstanceCustomVarsList(org.kie.server.api.model.instance.ProcessInstanceCustomVarsList) TaskEventInstance(org.kie.server.api.model.instance.TaskEventInstance) ConvertUtils.convertToTaskSummaryList(org.kie.server.services.jbpm.ConvertUtils.convertToTaskSummaryList) CorrelationKeyFactory(org.kie.internal.process.CorrelationKeyFactory) Status(org.kie.api.task.model.Status) TaskEventInstanceList(org.kie.server.api.model.instance.TaskEventInstanceList) TASK_ATTR_NAME(org.jbpm.services.api.AdvanceRuntimeDataService.TASK_ATTR_NAME) ConvertUtils.convertToTask(org.kie.server.services.jbpm.ConvertUtils.convertToTask) ConvertUtils.convertToNodeInstanceList(org.kie.server.services.jbpm.ConvertUtils.convertToNodeInstanceList) EntryType(org.jbpm.services.api.RuntimeDataService.EntryType) ConvertUtils.convertToProcessInstanceList(org.kie.server.services.jbpm.ConvertUtils.convertToProcessInstanceList) MarshallerHelper(org.kie.server.services.impl.marshal.MarshallerHelper) HashMap(java.util.HashMap) QueryFilter(org.kie.internal.query.QueryFilter) ArrayList(java.util.ArrayList) ProcessInstance(org.kie.api.runtime.process.ProcessInstance) TaskSummaryList(org.kie.server.api.model.instance.TaskSummaryList) TASK_ATTR_OWNER(org.jbpm.services.api.AdvanceRuntimeDataService.TASK_ATTR_OWNER) ProcessDefinitionList(org.kie.server.api.model.definition.ProcessDefinitionList) TASK_ATTR_STATUS(org.jbpm.services.api.AdvanceRuntimeDataService.TASK_ATTR_STATUS) ProcessInstanceUserTaskWithVariablesList(org.kie.server.api.model.instance.ProcessInstanceUserTaskWithVariablesList) IdentityProvider(org.kie.internal.identity.IdentityProvider) ConvertUtils.convertToNodeInstance(org.kie.server.services.jbpm.ConvertUtils.convertToNodeInstance) ConvertUtils.convertToProcessList(org.kie.server.services.jbpm.ConvertUtils.convertToProcessList) Logger(org.slf4j.Logger) ConvertUtils.buildTaskByNameQueryFilter(org.kie.server.services.jbpm.ConvertUtils.buildTaskByNameQueryFilter) VariableDesc(org.jbpm.services.api.model.VariableDesc) CorrelationKey(org.kie.internal.process.CorrelationKey) TaskInstance(org.kie.server.api.model.instance.TaskInstance) SearchQueryFilterSpec(org.kie.server.api.model.definition.SearchQueryFilterSpec) NodeInstanceDesc(org.jbpm.services.api.model.NodeInstanceDesc) ConvertUtils.nullEmpty(org.kie.server.services.jbpm.ConvertUtils.nullEmpty) Collectors.toList(java.util.stream.Collectors.toList) AdvanceRuntimeDataService(org.jbpm.services.api.AdvanceRuntimeDataService) RuntimeDataService(org.jbpm.services.api.RuntimeDataService) TaskNotFoundException(org.jbpm.services.api.TaskNotFoundException) ConvertUtils.convertToUserTaskWithVariablesList(org.kie.server.services.jbpm.ConvertUtils.convertToUserTaskWithVariablesList) ContainerLocatorProvider(org.kie.server.services.impl.locator.ContainerLocatorProvider) SearchQueryFilterSpec(org.kie.server.api.model.definition.SearchQueryFilterSpec)

Aggregations

ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Arrays.asList (java.util.Arrays.asList)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Collectors.toList (java.util.stream.Collectors.toList)1 AdvanceRuntimeDataService (org.jbpm.services.api.AdvanceRuntimeDataService)1 TASK_ATTR_NAME (org.jbpm.services.api.AdvanceRuntimeDataService.TASK_ATTR_NAME)1 TASK_ATTR_OWNER (org.jbpm.services.api.AdvanceRuntimeDataService.TASK_ATTR_OWNER)1 TASK_ATTR_STATUS (org.jbpm.services.api.AdvanceRuntimeDataService.TASK_ATTR_STATUS)1 DeploymentNotFoundException (org.jbpm.services.api.DeploymentNotFoundException)1 ProcessInstanceNotFoundException (org.jbpm.services.api.ProcessInstanceNotFoundException)1 RuntimeDataService (org.jbpm.services.api.RuntimeDataService)1 EntryType (org.jbpm.services.api.RuntimeDataService.EntryType)1 TaskNotFoundException (org.jbpm.services.api.TaskNotFoundException)1 NodeInstanceDesc (org.jbpm.services.api.model.NodeInstanceDesc)1 ProcessDefinition (org.jbpm.services.api.model.ProcessDefinition)1 ProcessInstanceDesc (org.jbpm.services.api.model.ProcessInstanceDesc)1