@Override public void addCandidateUsers(CandidateUsersPayload candidateUsersPayload) { if (candidateUsersPayload.getCandidateUsers() != null && !candidateUsersPayload.getCandidateUsers().isEmpty()) { for (String u : candidateUsersPayload.getCandidateUsers()) { taskService.addCandidateUser(candidateUsersPayload.getTaskId(), u); } } }
@Override public void addCandidateUsers(CandidateUsersPayload candidateUsersPayload) { org.activiti.engine.task.Task internalTask; try { internalTask = taskRuntimeHelper.getInternalTaskWithChecks(candidateUsersPayload.getTaskId()); } catch (IllegalStateException ex) { throw new IllegalStateException("The authenticated user cannot update the task" + candidateUsersPayload.getTaskId() + " due it is not the current assignee"); } String authenticatedUserId = securityManager.getAuthenticatedUserId(); // validate that you are trying to add CandidateUsers to the task where you are the assignee if (!Objects.equals(internalTask.getAssignee(), authenticatedUserId)) { throw new IllegalStateException("You cannot update a task where you are not the assignee"); } if (candidateUsersPayload.getCandidateUsers() != null && !candidateUsersPayload.getCandidateUsers().isEmpty()) { for (String u : candidateUsersPayload.getCandidateUsers()) { taskService.addCandidateUser(internalTask.getId(), u); } } }
@Override public void setCandidate(String doingUserId, Task task) { if (task == null) { return; } if (task.getTaskDefinitionKey() != null) { //从配置中获取候选人 List<CandidateInfo> candidateInfoList = processConfigurationService .getActivityConfiguration(doingUserId, task.getProcessDefinitionId(), task.getTaskDefinitionKey()) .getCandidateInfo(task); if (CollectionUtils.isEmpty(candidateInfoList)) { logger.warn("任务:{}未能设置候选人,此任务可能无法办理!", task); } else { for (CandidateInfo candidateInfo : candidateInfoList) { Authentication user = candidateInfo.user(); if (user != null) { taskService.addCandidateUser(task.getId(), user.getUser().getId()); } } } } else { logger.warn("未能成功设置环节候选人,task:{}", task); } }
task.setOwner(securityManager.getAuthenticatedUserId()); taskService.saveTask(task); taskService.addCandidateUser(task.getId(), securityManager.getAuthenticatedUserId()); if (createTaskPayload.getCandidateGroups() != null && !createTaskPayload.getCandidateGroups().isEmpty()) { taskService.addCandidateUser(task.getId(), u);
setVariablesLocal(next.getId(), variable); if (!StringUtils.isNullOrEmpty(request.getNextClaimUserId())) { taskService.addCandidateUser(next.getId(), request.getNextClaimUserId()); } else { setCandidate(request.getCompleteUserId(), next);
taskService.addCandidateUser(task.getId(), request.getNextClaimUserId()); } else { bpmTaskService.setCandidate(request.getCreatorId(), task);
@Override public void setCandidate(String doingUserId, Task task) { if (task == null) { return; } if (task.getTaskDefinitionKey() != null) { //从配置中获取候选人 List<CandidateInfo> candidateInfoList = processConfigurationService .getActivityConfiguration(doingUserId, task.getProcessDefinitionId(), task.getTaskDefinitionKey()) .getCandidateInfo(task); if (CollectionUtils.isEmpty(candidateInfoList)) { logger.warn("任务:{}未能设置候选人,此任务可能无法办理!", task); } else { for (CandidateInfo candidateInfo : candidateInfoList) { Authentication user = candidateInfo.user(); if (user != null) { taskService.addCandidateUser(task.getId(), user.getUser().getId()); } } } } else { logger.warn("未能成功设置环节候选人,task:{}", task); } }
setVariablesLocal(next.getId(), variable); if (!StringUtils.isNullOrEmpty(request.getNextClaimUserId())) { taskService.addCandidateUser(next.getId(), request.getNextClaimUserId()); } else { setCandidate(request.getCompleteUserId(), next);
private void updateTaskCandidates(String taskId, UserAndGroupUpdates updates) { // Only new candidates are present in pooledUsers and pooledGroups, create Links for these for (String user : updates.getUsers()) { taskService.addCandidateUser(taskId, user); } for (String group : updates.getGroups()) { taskService.addCandidateGroup(taskId, group); } // Remove all candidates which have been removed for (IdentityLink link : updates.getLinksToRemove()) { if (link.getUserId() != null) { taskService.deleteUserIdentityLink(link.getTaskId(), link.getUserId(), link.getType()); } else { taskService.deleteGroupIdentityLink(link.getTaskId(), link.getGroupId(), link.getType()); } } }
private void updateTaskCandidates(String taskId, UserAndGroupUpdates updates) { // Only new candidates are present in pooledUsers and pooledGroups, create Links for these for (String user : updates.getUsers()) { taskService.addCandidateUser(taskId, user); } for (String group : updates.getGroups()) { taskService.addCandidateGroup(taskId, group); } // Remove all candidates which have been removed for (IdentityLink link : updates.getLinksToRemove()) { if (link.getUserId() != null) { taskService.deleteUserIdentityLink(link.getTaskId(), link.getUserId(), link.getType()); } else { taskService.deleteGroupIdentityLink(link.getTaskId(), link.getGroupId(), link.getType()); } } }
taskService.addCandidateUser(task.getId(), request.getNextClaimUserId()); } else { bpmTaskService.setCandidate(request.getCreatorId(), task);