| | |
| | | RuntimeService runtimeService; |
| | | @Autowired |
| | | IdentityService identityService; |
| | | /** |
| | | * |
| | | * @description: 检验节点是否已经被接收 |
| | | * @param workflowId 流程id |
| | | * @return: 是否已被接收 |
| | | * |
| | | */ |
| | | |
| | | public boolean checkClaim(String workflowId) { |
| | | Task task = getTask(workflowId); |
| | | if (task == null) { |
| | |
| | | return false; |
| | | } |
| | | } |
| | | /** |
| | | * |
| | | * @description: 接收任务 |
| | | * @param workflowId 流程id |
| | | * @return: 任务id |
| | | * |
| | | */ |
| | | public String claimTask(String workflowId) { |
| | | Task task = getTask(workflowId); |
| | | if (task == null) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @description: 完成节点任务 |
| | | * @param taskId 任务id |
| | | * @param pass 是否通过 true,false |
| | | * @param reason 原因 |
| | | * @param other 其他参数 |
| | | * @return: 是否完成成功 |
| | | * |
| | | */ |
| | | public boolean completeTask(String taskId, Object pass, String reason, Map<String,Object> other) { |
| | | Map<String, Object> variables = new LinkedHashMap<String, Object>(); |
| | | if(other != null){ |
| | |
| | | log.debug("can not complete task(" + taskId + "): " + e.getMessage()); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * |
| | | * @description: 完成节点任务 |
| | | * @param taskId 任务id |
| | | * @param pass 是否通过 true,false |
| | | * @param reason 原因 |
| | | * @return: 是否完成成功 |
| | | * |
| | | */ |
| | | public boolean completeTask(String taskId, Object pass, String reason) { |
| | | return completeTask(taskId,pass,reason,null); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @description: 获取待审批任务列表 |
| | | * @return: 待审批任务列表 |
| | | * |
| | | */ |
| | | public List<String> getTodoTask() { |
| | | TUser onlineUser = getOnlineUser(); |
| | | Set<String> result = new HashSet<>(); |
| | |
| | | |
| | | return new ArrayList<>(result); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @description: 通过流程获取当前任务节点 |
| | | * @param processId 流程id |
| | | * @return: 当前任务节点 |
| | | * |
| | | */ |
| | | public Task geTask(String processId) { |
| | | Task task = taskService.createTaskQuery().processInstanceId(processId).singleResult(); |
| | | return task; |
| | |
| | | } |
| | | nextTaskUserInfo.addUserList(userList); |
| | | return nextTaskUserInfo; |
| | | |
| | | |
| | | } |
| | | |