| | |
| | | package cn.iocoder.yudao.module.bpm.controller.admin.definition; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionPageReqVO; |
| | |
| | | public CommonResult<BpmProcessDefinitionRespVO> getProcessDefinition( |
| | | @RequestParam(value = "id", required = false) String id, |
| | | @RequestParam(value = "key", required = false) String key) { |
| | | ProcessDefinition processDefinition = id != null ? processDefinitionService.getProcessDefinition(id) |
| | | // id 与 key 至少要传一个,否则 Flowable 会抛 FlowableIllegalArgumentException(key is null) 变成 500 |
| | | if (StrUtil.isBlank(id) && StrUtil.isBlank(key)) { |
| | | throw new IllegalArgumentException("流程编号 id 与流程定义标识 key 不能同时为空"); |
| | | } |
| | | ProcessDefinition processDefinition = StrUtil.isNotBlank(id) ? processDefinitionService.getProcessDefinition(id) |
| | | : processDefinitionService.getActiveProcessDefinition(key); |
| | | if (processDefinition == null) { |
| | | return success(null); |