yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelServiceImpl.java
@@ -6,6 +6,7 @@
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.BpmModelMetaInfoVO;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.BpmModelSaveReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO;
@@ -204,6 +205,13 @@
    private Model validateModelManager(String id, Long userId) {
        Model model = validateModelExists(id);
        BpmModelMetaInfoVO metaInfo = BpmModelConvert.INSTANCE.parseMetaInfo(model);
        // 超级管理员始终拥有流程模型的维护权限。
        // 背景:历史模型的 managerUserIds 可能为空(NULL / []),或指向已删除 / 已变更的用户,
        // 严格校验会让这些模型再也无法修改(死锁,客户报「你不是该流程(xxx)的管理员」却无法自愈);
        // 另外客户要求把流程管理员固定为超级管理员,此校验对其不再适用。
        if (SecurityFrameworkUtils.isSuperAdmin()) {
            return model;
        }
        if (metaInfo == null || !CollUtil.contains(metaInfo.getManagerUserIds(), userId)) {
            throw exception(MODEL_UPDATE_FAIL_NOT_MANAGER, model.getName());
        }
@@ -242,7 +250,9 @@
    private void validateBpmnXml(byte[] bpmnBytes, Integer type) {
        BpmnModel bpmnModel = BpmnModelUtils.getBpmnModel(bpmnBytes);
        if (bpmnModel == null) {
            throw exception(MODEL_NOT_EXISTS);
            // 此处是流程图未绘制(bpmnXml 为空或无法解析),不是模型不存在,
            // 用 MODEL_NOT_EXISTS 会误导用户以为模型被删了
            throw exception(MODEL_DEPLOY_FAIL_BPMN_NOT_EXISTS);
        }
        // 1. 没有 StartEvent
        StartEvent startEvent = BpmnModelUtils.getStartEvent(bpmnModel);