Merge branch 'feature/REQ-1309' into dev
This commit is contained in:
commit
a5d6e0edb1
@ -40,8 +40,8 @@ public interface ProcessModelApi {
|
||||
*/
|
||||
@Operation(summary = "通过模型ID查询指定流程模型")
|
||||
@GetMapping("/api/process/model/get")
|
||||
CommonResponse<BpmnModelDetailVO> getById(@NotBlank(message = "流程模型 ID 不能为空") @RequestParam String processModelId,
|
||||
@NotBlank(message = "租户不能为空") @RequestParam String tenantId);
|
||||
CommonResponse<BpmnModelDetailVO> getById(@NotBlank(message = "流程模型 ID 不能为空") @RequestParam(required = false) String processModelId,
|
||||
@NotBlank(message = "租户不能为空") @RequestParam(required = false) String tenantId);
|
||||
|
||||
|
||||
/**
|
||||
@ -49,8 +49,20 @@ public interface ProcessModelApi {
|
||||
*/
|
||||
@Operation(summary = "通过模型KEY查询指定流程模型")
|
||||
@GetMapping("/api/process/model/getByKey")
|
||||
CommonResponse<BpmnModelDetailVO> getByKey(@NotBlank(message = "流程模型 KEY 不能为空") @RequestParam String processModelKey,
|
||||
@NotBlank(message = "租户不能为空") @RequestParam String tenantId);
|
||||
CommonResponse<BpmnModelDetailVO> getByKey(@NotBlank(message = "流程模型 KEY 不能为空") @RequestParam(required = false) String processModelKey,
|
||||
@NotBlank(message = "租户不能为空") @RequestParam(required = false) String tenantId);
|
||||
|
||||
/**
|
||||
* 校验是否能更新模型即其关联的流程定义内容
|
||||
* <p>
|
||||
* 偏向业务的接口,flowable 引擎是站在流程定义维度进行激活和挂起
|
||||
*
|
||||
* @return true 能更新,表明该模型关联的所有定义版本都是挂起状态
|
||||
*/
|
||||
@Operation(summary = "校验指定的模型是否能修改")
|
||||
@GetMapping("/api/process/model/update/check")
|
||||
CommonResponse<Boolean> checkCanUpdate(@NotBlank(message = "模型 ID 不能为空") @RequestParam(required = false) String modelId,
|
||||
@NotBlank(message = "租户不能为空") @RequestParam(required = false) String tenantId);
|
||||
|
||||
/**
|
||||
* 修改流程信息
|
||||
@ -69,7 +81,6 @@ public interface ProcessModelApi {
|
||||
CommonResponse<String> deployById(@NotBlank(message = "流程模型 ID 不能为空") @RequestParam(required = false) String processModelId,
|
||||
@NotBlank(message = "租户不能为空") @RequestParam(required = false) String tenantId);
|
||||
|
||||
|
||||
/**
|
||||
* 部署模型
|
||||
* return 部署完成的流程定义Id
|
||||
|
||||
@ -34,4 +34,6 @@ public interface FormModelService {
|
||||
void deleteFormModelById(String formModelId, @Nullable String tenantId);
|
||||
|
||||
void deleteFormModelByKey(String formModelKey, @Nullable String tenantId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -93,6 +93,16 @@ public class BpmnProcessDefinitionController implements ProcessDefinitionApi {
|
||||
return success(bpmnProcessDefinitionService.getActiveProcessDefinitionByKey(key, key));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定
|
||||
*
|
||||
* @param deploymentId
|
||||
* @return
|
||||
*/
|
||||
public CommonResponse<Boolean> hasActiveProcessDefinition(String deploymentId) {
|
||||
log.info("获得流程定义标识对应的激活的流程定义 getActiveProcessDefinitionByKey===>>>参数:{}", JSON.toJSONString(deploymentId));
|
||||
return success(bpmnProcessDefinitionService.hasActiveProcessDefinition(deploymentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂起/激活流程,
|
||||
|
||||
@ -7,6 +7,7 @@ import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelUpdateDTO;
|
||||
import cn.axzo.workflow.common.model.response.BpmPageResult;
|
||||
import cn.axzo.workflow.common.model.response.bpmn.model.BpmnModelDetailVO;
|
||||
import cn.axzo.workflow.common.model.response.form.model.FormModelBaseVO;
|
||||
import cn.axzo.workflow.core.service.BpmnProcessDefinitionService;
|
||||
import cn.axzo.workflow.core.service.BpmnProcessModelService;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@ -30,6 +31,8 @@ public class BpmnProcessModelController implements ProcessModelApi {
|
||||
|
||||
@Resource
|
||||
private BpmnProcessModelService bpmnProcessModelService;
|
||||
@Resource
|
||||
private BpmnProcessDefinitionService bpmnProcessDefinitionService;
|
||||
|
||||
/**
|
||||
* 获取流程模型的查询结果
|
||||
@ -90,6 +93,15 @@ public class BpmnProcessModelController implements ProcessModelApi {
|
||||
return success(result);
|
||||
}
|
||||
|
||||
@Operation(summary = "校验流程模型是否能更新")
|
||||
@PutMapping("/update/check")
|
||||
@Override
|
||||
public CommonResponse<Boolean> checkCanUpdate(@NotBlank(message = "模型 ID 不能为空") @RequestParam(required = false) String modelId,
|
||||
@NotBlank(message = "租户不能为空") @RequestParam(required = false) String tenantId) {
|
||||
log.info("校验流程模型是否能更新checkCanUpdate===>>>参数:{}", JSON.toJSONString(modelId));
|
||||
BpmnModelDetailVO detailVO = bpmnProcessModelService.getById(modelId, tenantId);
|
||||
return success(!bpmnProcessDefinitionService.hasActiveProcessDefinition(detailVO.getDeploymentId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程信息
|
||||
|
||||
Loading…
Reference in New Issue
Block a user