| | |
| | | import org.springblade.mdm.flow.service.TaskDispatchService; |
| | | import org.springblade.mdm.flow.service.execute.*; |
| | | import org.springblade.mdm.flow.vo.BatchDispatchVO; |
| | | import org.springblade.mdm.flow.vo.FlowStartResult; |
| | | import org.springblade.mdm.flow.vo.TaskAssignVO; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | |
| | | private final StartDispatcher dispatcher; |
| | | |
| | | private final TaskService taskService; |
| | | private final RuntimeService runtimeService; |
| | | private final FlowProgramFileService flowProgramFileService; |
| | | |
| | | |
| | | private final TryFlowCompleteService tryFlowCompleteService; |
| | |
| | | } |
| | | |
| | | try { |
| | | String instId = dispatcher.start(startVO); |
| | | FlowStartResult result = dispatcher.start(startVO); |
| | | dispatch.setStatus(TaskDispatch.STATUS_STARTED); |
| | | dispatch.setProcessInstanceId(instId); |
| | | dispatch.setProcessInstanceId(result.getProcessInstanceId()); |
| | | dispatch.setProgramNo(result.getProgramNo()); |
| | | taskDispatchService.updateById(dispatch); |
| | | return R.data(true); |
| | | } catch (Exception e) { |
| | | dispatch.setStatus(TaskDispatch.STATUS_EXCEPTION); |
| | | dispatch.setErrMsg(e.getMessage()); |
| | | taskDispatchService.updateById(dispatch); |
| | | //return R.fail("任务启动异常:"+e.getMessage()); |
| | | return R.fail(new IResultCode() { |
| | | @Override |
| | | public String getMessage() { |