当前位置: 首页>>代码示例>>Java>>正文


Java TaskQuery类代码示例

本文整理汇总了Java中org.activiti.engine.task.TaskQuery的典型用法代码示例。如果您正苦于以下问题:Java TaskQuery类的具体用法?Java TaskQuery怎么用?Java TaskQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TaskQuery类属于org.activiti.engine.task包,在下文中一共展示了TaskQuery类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addTasksForCandidateGroups

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
private void addTasksForCandidateGroups(List<String> groupNames, Map<String, Task> resultingTasks)
{
    if(groupNames != null && groupNames.size() > 0) {
        
        TaskQuery query = taskService.createTaskQuery().taskCandidateGroupIn(groupNames);
        
        // Additional filtering on the tenant-property in case workflow-definitions are shared across tenants
        if(!activitiUtil.isMultiTenantWorkflowDeploymentEnabled() && tenantService.isEnabled()) {
            query.processVariableValueEquals(ActivitiConstants.VAR_TENANT_DOMAIN, TenantUtil.getCurrentDomain());
        }
        
        List<Task> tasks =query.list();
        for(Task task : tasks)
        {
            resultingTasks.put(task.getId(), task);
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:ActivitiWorkflowEngine.java

示例2: queryRuntimeTasks

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
private List<WorkflowTask> queryRuntimeTasks(WorkflowTaskQuery query)
{
   // Runtime-tasks only exist on process-instances that are active
   // so no use in querying runtime tasks if not active
   if (!Boolean.FALSE.equals(query.isActive()))
   {
       TaskQuery taskQuery = createRuntimeTaskQuery(query);

       List<Task> results;
       int limit = query.getLimit();
       if (limit > 0)
       {
           results = taskQuery.listPage(0, limit);
       }
       else
       {
           results = taskQuery.list();
       }
       return getValidWorkflowTasks(results);
   }
   return new ArrayList<WorkflowTask>();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:23,代码来源:ActivitiWorkflowEngine.java

示例3: addProcessPropertiesToQuery

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
private void addProcessPropertiesToQuery(
        Map<QName, Object> processCustomProps, TaskQuery taskQuery) 
{
    for(Entry<QName, Object> customProperty : processCustomProps.entrySet()) 
    {
        String name =factory.mapQNameToName(customProperty.getKey());

        // Exclude the special "VAR_TENANT_DOMAIN" variable, this cannot be queried by users
        if(name != ActivitiConstants.VAR_TENANT_DOMAIN)
        {
            // Perform minimal property conversions
            Object converted = propertyConverter.convertPropertyToValue(customProperty.getValue());
            taskQuery.processVariableValueEquals(name, converted);
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:ActivitiWorkflowEngine.java

示例4: taskDescriptionLikeIgnoreCase

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
public TaskQuery taskDescriptionLikeIgnoreCase(
        String descriptionLikeIgnoreCase) {
    if (descriptionLikeIgnoreCase == null) {
        throw new ActivitiIllegalArgumentException(
                "Task descriptionLikeIgnoreCase is null");
    }

    if (orActive) {
        currentOrQueryObject.descriptionLikeIgnoreCase = descriptionLikeIgnoreCase
                .toLowerCase();
    } else {
        this.descriptionLikeIgnoreCase = descriptionLikeIgnoreCase
                .toLowerCase();
    }

    return this;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:18,代码来源:TaskQueryImpl.java

示例5: taskDelegationState

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
public TaskQuery taskDelegationState(DelegationState delegationState) {
    if (orActive) {
        if (delegationState == null) {
            currentOrQueryObject.noDelegationState = true;
        } else {
            currentOrQueryObject.delegationState = delegationState;
        }
    } else {
        if (delegationState == null) {
            this.noDelegationState = true;
        } else {
            this.delegationState = delegationState;
        }
    }

    return this;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:18,代码来源:TaskQueryImpl.java

示例6: taskCandidateOrAssigned

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
@Override
public TaskQuery taskCandidateOrAssigned(
        String userIdForCandidateAndAssignee) {
    if (candidateGroup != null) {
        throw new ActivitiIllegalArgumentException(
                "Invalid query usage: cannot set candidateGroup");
    }

    if (candidateUser != null) {
        throw new ActivitiIllegalArgumentException(
                "Invalid query usage: cannot set both candidateGroup and candidateUser");
    }

    if (orActive) {
        currentOrQueryObject.bothCandidateAndAssigned = true;
        currentOrQueryObject.userIdForCandidateAndAssignee = userIdForCandidateAndAssignee;
    } else {
        this.bothCandidateAndAssigned = true;
        this.userIdForCandidateAndAssignee = userIdForCandidateAndAssignee;
    }

    return this;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:24,代码来源:TaskQueryImpl.java

示例7: taskCandidateGroupIn

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
public TaskQuery taskCandidateGroupIn(List<String> candidateGroups) {
    if (candidateGroups == null) {
        throw new ActivitiIllegalArgumentException(
                "Candidate group list is null");
    }

    if (candidateGroups.isEmpty()) {
        throw new ActivitiIllegalArgumentException(
                "Candidate group list is empty");
    }

    if (candidateGroup != null) {
        throw new ActivitiIllegalArgumentException(
                "Invalid query usage: cannot set both candidateGroupIn and candidateGroup");
    }

    if (orActive) {
        currentOrQueryObject.candidateGroups = candidateGroups;
    } else {
        this.candidateGroups = candidateGroups;
    }

    return this;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:25,代码来源:TaskQueryImpl.java

示例8: searchWorkItems

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
public SearchResultList<WorkItemType> searchWorkItems(ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> options, OperationResult result)
		throws SchemaException {
	TaskQuery taskQuery = createTaskQuery(query, true, options, result);
	if (taskQuery == null) {
		return new SearchResultList<>(Collections.emptyList());
	}
	Integer offset = query != null ? query.getOffset() : null;
	Integer maxSize = query != null ? query.getMaxSize() : null;
	List<Task> tasks;
	if (offset == null && maxSize == null) {
		tasks = taskQuery.list();
	} else {
		tasks = taskQuery.listPage(defaultIfNull(offset, 0), defaultIfNull(maxSize, Integer.MAX_VALUE));
	}
	boolean getAllVariables = true;				// TODO implement based on options
	// there's no need to fill-in assignee details ; but candidates are necessary to fill-in; TODO implement based on options (resolve)
	return tasksToWorkItems(tasks, null, false, false, true, getAllVariables, result);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:19,代码来源:WorkItemProvider.java

示例9: whileTaskTest

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
@Test
public void whileTaskTest() {

	deployProcess();
	startProcess();

	// tasks

	TaskQuery taskQuery = this.taskService.createTaskQuery();
	List<Task> tasks = taskQuery.list();
	while (!tasks.isEmpty()) {

		for (Task task : tasks) {

			this.taskService.addComment(task.getId(), task.getProcessInstanceId(), "同意1");
			this.taskService.complete(task.getId());
		}

		tasks = taskQuery.list();
	}
}
 
开发者ID:KayuraTeam,项目名称:kayura-activiti,代码行数:22,代码来源:MultiInstanceTest.java

示例10: taskDelegationState

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
@Override
public TaskQuery taskDelegationState(DelegationState delegationState) {
    if (orActive) {
        if (delegationState == null) {
            currentOrQueryObject.noDelegationState = true;
        } else {
            currentOrQueryObject.delegationState = delegationState;
        }
    } else {
        if (delegationState == null) {
            this.noDelegationState = true;
        } else {
            this.delegationState = delegationState;
        }
    }
    return this;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:18,代码来源:TaskQueryImpl.java

示例11: taskCandidateOrAssigned

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
@Override
public TaskQuery taskCandidateOrAssigned(String userIdForCandidateAndAssignee) {
    if (candidateGroup != null) {
        throw new ActivitiIllegalArgumentException("Invalid query usage: cannot set candidateGroup");
    }
    if (candidateUser != null) {
        throw new ActivitiIllegalArgumentException("Invalid query usage: cannot set both candidateGroup and candidateUser");
    }

    if (orActive) {
        currentOrQueryObject.bothCandidateAndAssigned = true;
        currentOrQueryObject.userIdForCandidateAndAssignee = userIdForCandidateAndAssignee;
    } else {
        this.bothCandidateAndAssigned = true;
        this.userIdForCandidateAndAssignee = userIdForCandidateAndAssignee;
    }

    return this;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:20,代码来源:TaskQueryImpl.java

示例12: taskCandidateGroupIn

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
@Override
public TaskQuery taskCandidateGroupIn(List<String> candidateGroups) {
    if (candidateGroups == null) {
        throw new ActivitiIllegalArgumentException("Candidate group list is null");
    }

    if (candidateGroups.isEmpty()) {
        throw new ActivitiIllegalArgumentException("Candidate group list is empty");
    }

    if (candidateGroup != null) {
        throw new ActivitiIllegalArgumentException("Invalid query usage: cannot set both candidateGroupIn and candidateGroup");
    }

    if (orActive) {
        currentOrQueryObject.candidateGroups = candidateGroups;
    } else {
        this.candidateGroups = candidateGroups;
    }
    return this;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:22,代码来源:TaskQueryImpl.java

示例13: processInstanceIdIn

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
@Override
public TaskQuery processInstanceIdIn(List<String> processInstanceIds) {
    if (processInstanceIds == null) {
        throw new ActivitiIllegalArgumentException("Process instance id list is null");
    }
    if (processInstanceIds.isEmpty()) {
        throw new ActivitiIllegalArgumentException("Process instance id list is empty");
    }
    for (String processInstanceId : processInstanceIds) {
        if (processInstanceId == null) {
            throw new ActivitiIllegalArgumentException("None of the given process instance ids can be null");
        }
    }

    if (orActive) {
        currentOrQueryObject.processInstanceIds = processInstanceIds;
    } else {
        this.processInstanceIds = processInstanceIds;
    }
    return this;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:22,代码来源:TaskQueryImpl.java

示例14: processCategoryIn

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
@Override
public TaskQuery processCategoryIn(List<String> processCategoryInList) {
    if (processCategoryInList == null) {
        throw new ActivitiIllegalArgumentException("Process category list is null");
    }
    if (processCategoryInList.isEmpty()) {
        throw new ActivitiIllegalArgumentException("Process category list is empty");
    }
    for (String processCategory : processCategoryInList) {
        if (processCategory == null) {
            throw new ActivitiIllegalArgumentException("None of the given process categories can be null");
        }
    }

    if (orActive) {
        currentOrQueryObject.processCategoryInList = processCategoryInList;
    } else {
        this.processCategoryInList = processCategoryInList;
    }
    return this;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:22,代码来源:TaskQueryImpl.java

示例15: processCategoryNotIn

import org.activiti.engine.task.TaskQuery; //导入依赖的package包/类
@Override
public TaskQuery processCategoryNotIn(List<String> processCategoryNotInList) {
    if (processCategoryNotInList == null) {
        throw new ActivitiIllegalArgumentException("Process category list is null");
    }
    if (processCategoryNotInList.isEmpty()) {
        throw new ActivitiIllegalArgumentException("Process category list is empty");
    }
    for (String processCategory : processCategoryNotInList) {
        if (processCategory == null) {
            throw new ActivitiIllegalArgumentException("None of the given process categories can be null");
        }
    }

    if (orActive) {
        currentOrQueryObject.processCategoryNotInList = processCategoryNotInList;
    } else {
        this.processCategoryNotInList = processCategoryNotInList;
    }
    return this;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:22,代码来源:TaskQueryImpl.java


注:本文中的org.activiti.engine.task.TaskQuery类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。