| | |
| | | String taskId = getCurrentTaskIdByProcessInstanceId(processInstanceId); |
| | | backWithAssigneeService.backToTaskWithNewAssignee(taskId,targetActivityId,targetAssignee,"流程撤回",new HashMap<>()); |
| | | } |
| | | /* |
| | | String getprocessDefinitionKey(String processInstanceId){ |
| | | Task task = taskService.createTaskQuery() |
| | | .taskId(taskId) |
| | | .singleResult(); |
| | | |
| | | ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery() |
| | | .processDefinitionId(task.getProcessDefinitionId()) |
| | | .singleResult(); |
| | | |
| | | String taskId = getCurrentTaskIdByProcessInstanceId(processInstanceId); |
| | | if (processDefinition == null) { |
| | | throw new RuntimeException("流程定义不存在,processDefinitionId: " + task.getProcessDefinitionId()); |
| | | } |
| | | |
| | | return processDefinition.getKey(); |
| | | }*/ |
| | | |
| | | public String getCurrentTaskIdByProcessInstanceId(String processInstanceId) { |
| | | Optional<String> optTaskId = taskService.createTaskQuery() |
| | |
| | | |
| | | return processDefinition.getKey(); |
| | | } |
| | | |
| | | /** |
| | | * 取回到组长派工 |
| | | * @param processInstanceId |
| | | */ |
| | | public void takeBackToDispatch(String processInstanceId) { |
| | | String targetAssignee = ""+AuthUtil.getUserId(); |
| | | |
| | | final String targetActivityId = "teamLeaderTask";//组长派工 |
| | | String taskId = getCurrentTaskIdByProcessInstanceId(processInstanceId); |
| | | backWithAssigneeService.backToTaskWithNewAssignee(taskId,targetActivityId,targetAssignee,"组长取回",new HashMap<>()); |
| | | } |
| | | } |
| | | |
| | | |