| | |
| | | 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 都为空时直接返回 null:否则会调用 getActiveProcessDefinition(null), |
| | | // 由 Flowable 抛 "key is null" 的 IllegalArgumentException 变成 500 |
| | | if (StrUtil.isBlank(id) && StrUtil.isBlank(key)) { |
| | | return success(null); |
| | | } |
| | | ProcessDefinition processDefinition = StrUtil.isNotBlank(id) |
| | | ? processDefinitionService.getProcessDefinition(id) |
| | | : processDefinitionService.getActiveProcessDefinition(key); |
| | | if (processDefinition == null) { |
| | | return success(null); |