本文整理汇总了Java中org.activiti.engine.task.TaskQuery.taskCandidateUser方法的典型用法代码示例。如果您正苦于以下问题:Java TaskQuery.taskCandidateUser方法的具体用法?Java TaskQuery.taskCandidateUser怎么用?Java TaskQuery.taskCandidateUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.task.TaskQuery
的用法示例。
在下文中一共展示了TaskQuery.taskCandidateUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTasks
import org.activiti.engine.task.TaskQuery; //导入方法依赖的package包/类
@Get
public DataResponse getTasks() {
if(authenticate() == false) return null;
String personalTaskUserId = (String) getQuery().getValues("assignee");
String candidateTaskUserId = (String) getQuery().getValues("candidate");
String candidateGroupId = (String) getQuery().getValues("candidate-group");
TaskQuery taskQuery = ActivitiUtil.getTaskService().createTaskQuery();
if (personalTaskUserId != null) {
taskQuery.taskAssignee(personalTaskUserId);
} else if (candidateTaskUserId != null) {
taskQuery.taskCandidateUser(candidateTaskUserId);
} else if (candidateGroupId != null) {
taskQuery.taskCandidateGroup(candidateGroupId);
} else {
throw new ActivitiException("Tasks must be filtered with 'assignee', 'candidate' or 'candidate-group'");
}
DataResponse dataResponse = new TasksPaginateList().paginateList(getQuery(), taskQuery, "id", properties);
return dataResponse;
}
示例2: transformUnclaimedTasks
import org.activiti.engine.task.TaskQuery; //导入方法依赖的package包/类
/**
* Look for all the tasks the assignee is a candidate and add substitute as a candidate user.
* @param assignee
* @param substitute
*/
private static void transformUnclaimedTasks(String assignee, String substitute) {
TaskQuery taskQuery = BPMNServerHolder.getInstance().getEngine().getTaskService().createTaskQuery();
taskQuery.taskCandidateUser(assignee);
List<Task> candidateTasks = taskQuery.list();
addAsCandidate(candidateTasks, substitute);
}
示例3: getTaskQuery
import org.activiti.engine.task.TaskQuery; //导入方法依赖的package包/类
/**
* 根据查询条件和类型返回对应的TaskQuery实现
*
* @param assignmentType
* @return TaskQuery实现
*/
private TaskQuery getTaskQuery(String assignmentType, String queryArg) {
TaskQuery query = taskService.createTaskQuery();
if (StringUtils.isBlank(assignmentType)) {
query.taskAssignee(queryArg);
} else {
if (BpmConstant.BPM_ASSIGNMENT_TYPE_ASSIGNED.equals(assignmentType)) {
query.taskAssignee(queryArg);
} else if (BpmConstant.BPM_ASSIGNMENT_TYPE_CANDIDATEUSER
.equals(assignmentType)) {
query.taskCandidateUser(queryArg);
}
}
return query;
}
示例4: getTasks
import org.activiti.engine.task.TaskQuery; //导入方法依赖的package包/类
@Get
public DataResponse getTasks() {
if(authenticate() == false) return null;
String personalTaskUserId = getQuery().getValues("assignee");
String ownerTaskUserId = getQuery().getValues("owner");
String involvedTaskUserId = getQuery().getValues("involved");
String candidateTaskUserId = getQuery().getValues("candidate");
String candidateGroupId = getQuery().getValues("candidate-group");
String strPriority = getQuery().getValues("priority");
String strMinPriority = getQuery().getValues("minPriority");
String strMaxPriority = getQuery().getValues("maxPriority");
String strDueDate = getQuery().getValues("dueDate");
String strMinDueDate = getQuery().getValues("minDueDate");
String strMaxDueDate = getQuery().getValues("maxDueDate");
TaskQuery taskQuery = ActivitiUtil.getTaskService().createTaskQuery();
if (personalTaskUserId != null) {
taskQuery.taskAssignee(personalTaskUserId);
} else if (ownerTaskUserId != null) {
taskQuery.taskOwner(ownerTaskUserId);
} else if (involvedTaskUserId != null) {
taskQuery.taskInvolvedUser(involvedTaskUserId);
} else if (candidateTaskUserId != null) {
taskQuery.taskCandidateUser(candidateTaskUserId);
} else if (candidateGroupId != null) {
taskQuery.taskCandidateGroup(candidateGroupId);
} else {
throw new ActivitiException("Tasks must be filtered with 'assignee', 'owner', 'involved', 'candidate' or 'candidate-group'");
}
if (strPriority != null) {
taskQuery.taskPriority(RequestUtil.parseToInteger(strPriority));
} else if (strMinPriority != null) {
taskQuery.taskMinPriority(RequestUtil.parseToInteger(strMinPriority));
} else if (strMaxPriority != null) {
taskQuery.taskMaxPriority(RequestUtil.parseToInteger(strMaxPriority));
}
if (strDueDate != null) {
taskQuery.dueDate(RequestUtil.parseToDate(strDueDate));
} else if (strMinDueDate != null) {
taskQuery.dueAfter(RequestUtil.parseToDate(strMinDueDate));
} else if (strMaxDueDate != null) {
taskQuery.dueBefore(RequestUtil.parseToDate(strMaxDueDate));
}
DataResponse dataResponse = new TasksPaginateList().paginateList(getQuery(), taskQuery, "id", properties);
return dataResponse;
}