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


Java TaskQuery.taskAssignee方法代码示例

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


在下文中一共展示了TaskQuery.taskAssignee方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:22,代码来源:TasksResource.java

示例2: queryForTasksToShow

import org.activiti.engine.task.TaskQuery; //导入方法依赖的package包/类
private List<Task> queryForTasksToShow() {
	final TaskService taskService = lookup(TaskService.class);
	final TaskQuery query = taskService.createTaskQuery();
	switch (period) {
		case TODAY:
			query.taskDueBefore(LocalDate.now().plusDays(1).toDate());
			break;
		case WEEK:
			query.taskDueBefore(LocalDate.now().plusWeeks(1).toDate());
			break;
		case MONTH:
			query.taskDueBefore(LocalDate.now().plusMonths(1).toDate());
			break;
		case ALL:
			break;
	}
	final UserManagementService userService = lookup(UserManagementService.class);
	if (userService.isCurUserHasRole(UserRole.USER)) {
		final String currentUser = userService.getCurrentUserLogin();
		query.taskAssignee(currentUser);
	}
	query.orderByTaskPriority().desc().orderByTaskDueDate().asc();
	return query.list();
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:25,代码来源:TasksGrid.java

示例3: bulkReassign

import org.activiti.engine.task.TaskQuery; //导入方法依赖的package包/类
/**
 * Reassign the given tasks or all the tasks if the given task list is null, to the given substitute
 * @param assignee - original user of the tasks
 * @param substitute - user who getting assigned
 * @param taskList - list of tasks to reassign. Leave this null to reassign all tha tasks of the assignee.
 */
public static void bulkReassign(String assignee, String substitute, List<String> taskList) {

    if (taskList != null) { //reassign the given tasks
        reassignFromTaskIdsList(taskList, substitute);
    } else { //reassign all existing tasks for assignee
        TaskQuery taskQuery = BPMNServerHolder.getInstance().getEngine().getTaskService().createTaskQuery();
        taskQuery.taskAssignee(assignee);
        reassignFromTasksList(taskQuery.list(), substitute);
        transformUnclaimedTasks(assignee, substitute);
    }
    //should mark bulk reassign done
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:19,代码来源:UserSubstitutionUtils.java

示例4: validateTasksList

import org.activiti.engine.task.TaskQuery; //导入方法依赖的package包/类
/**
 * Check whether each given task is a candidate for substitution by assignee
 * @param taskList
 * @param assignee
 */
public static boolean validateTasksList(List<String> taskList, String assignee) {
    if (taskList != null) {
        TaskQuery taskQuery = BPMNServerHolder.getInstance().getEngine().getTaskService().createTaskQuery();
        for (String taskId : taskList) {
            taskQuery.taskId(taskId);
            taskQuery.taskAssignee(assignee);
            List<Task> tasks = taskQuery.list();//this should return a task if valid
            if (tasks == null || tasks.isEmpty()) {
                return false;
            }
        }
    }
    return true;
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:20,代码来源:UserSubstitutionUtils.java

示例5: 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;
}
 
开发者ID:lz84,项目名称:bachelor,代码行数:21,代码来源:BpmRuntimeTaskServiceImpl.java

示例6: 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;
}
 
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:53,代码来源:TasksResource.java


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