| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.flowable.engine.HistoryService; |
| | | import org.flowable.engine.RuntimeService; |
| | | import org.flowable.engine.TaskService; |
| | | import org.flowable.engine.history.HistoricProcessInstance; |
| | | import org.flowable.engine.history.HistoricProcessInstanceQuery; |
| | | import org.flowable.engine.runtime.Execution; |
| | | import org.flowable.engine.runtime.ProcessInstance; |
| | | import org.flowable.task.api.Task; |
| | | import org.flowable.task.api.TaskQuery; |
| | | import org.flowable.task.api.history.HistoricTaskInstance; |
| | | import org.flowable.task.api.history.HistoricTaskInstanceQuery; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.Func; |
| | |
| | | |
| | | private final TaskService taskService; |
| | | private final HistoryService historyService; |
| | | private final RuntimeService runtimeService; |
| | | |
| | | @Override |
| | | public IPage<BladeFlow> selectClaimPage(IPage<BladeFlow> page, BladeFlow bladeFlow) { |
| | |
| | | variables = Kv.create(); |
| | | } |
| | | variables.put(ProcessConstant.PASS_KEY, flow.isPass()); |
| | | variables.put("yn","y"); |
| | | |
| | | // 完成任务 |
| | | taskService.complete(taskId, variables); |
| | | |
| | | // //设置下一步审核人 |
| | | // Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).active().singleResult();//下一步节点 |
| | | // String taskKey = task.getTaskDefinitionKey();//就是流程配置的节点id |
| | | // Object to = getVar(processInstanceId,taskKey); |
| | | // if(to==null){ |
| | | // throw new ServiceException(taskKey+"没有设置审核人"); |
| | | // } |
| | | // String assignee = to.toString(); |
| | | // |
| | | // if(StringUtils.isNotEmpty(assignee)) { |
| | | // task.setAssignee(assignee); |
| | | // } |
| | | return true; |
| | | } |
| | | |
| | |
| | | return historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); |
| | | } |
| | | |
| | | public Object getVar(String processInstanceId,String key){ |
| | | Object t = null; |
| | | List<Execution> list = runtimeService.createExecutionQuery().processInstanceId(processInstanceId).list(); |
| | | for (Execution execution : list) { |
| | | Object va = runtimeService.getVariable(execution.getId(),key); |
| | | if(va!=null){ |
| | | t=va; |
| | | } |
| | | } |
| | | return t; |
| | | } |
| | | |
| | | } |