| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 流程节点进程图 |
| | | * |
| | | * @param processDefinitionId 流程id |
| | | * @param processInstanceId 流程实例id |
| | | */ |
| | | @GetMapping(value = "model-view") |
| | | public R modelView(String processDefinitionId, String processInstanceId) { |
| | | return R.data(flowEngineService.modelView(processDefinitionId, processInstanceId)); |
| | | } |
| | | |
| | | /** |
| | | * 获取流程节点进程图 |
| | | * |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * FlowEngineService |
| | |
| | | * @return |
| | | */ |
| | | boolean deleteProcessInstance(String processInstanceId, String deleteReason); |
| | | |
| | | /** |
| | | * 流程节点进程图 |
| | | * |
| | | * @param processDefinitionId |
| | | * @param processInstanceId |
| | | * @return |
| | | */ |
| | | Map<String, Object> modelView(String processDefinitionId, String processInstanceId); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 流程节点进程图 |
| | | * |
| | | * @param processDefinitionId |
| | | * @param processInstanceId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> modelView(String processDefinitionId, String processInstanceId) { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | // 节点标记 |
| | | if (StringUtil.isNotBlank(processInstanceId)) { |
| | | result.put("flow", this.historyFlowList(processInstanceId, null, null)); |
| | | HistoricProcessInstance processInstance = historyService.createHistoricProcessInstanceQuery() |
| | | .processInstanceId(processInstanceId) |
| | | .singleResult(); |
| | | processDefinitionId = processInstance.getProcessDefinitionId(); |
| | | } |
| | | BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId); |
| | | // 流程图展示 |
| | | result.put("xml", new String(new BpmnXMLConverter().convertToXML(bpmnModel))); |
| | | return result; |
| | | } |
| | | } |