{"record":{"id":"a5155f994dd02b4f","repo":"flowable/flowable-engine","slug":"processdefinitionid-is-null-a5155f","errorCode":null,"errorMessage":"processDefinitionId is null","messagePattern":"processDefinitionId is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/DeleteIdentityLinkForProcessDefinitionCmd.java","lineNumber":47,"sourceCode":"\n    private static final long serialVersionUID = 1L;\n\n    protected String processDefinitionId;\n\n    protected String userId;\n\n    protected String groupId;\n\n    public DeleteIdentityLinkForProcessDefinitionCmd(String processDefinitionId, String userId, String groupId) {\n        validateParams(userId, groupId, processDefinitionId);\n        this.processDefinitionId = processDefinitionId;\n        this.userId = userId;\n        this.groupId = groupId;\n    }\n\n    protected void validateParams(String userId, String groupId, String processDefinitionId) {\n        if (processDefinitionId == null) {\n            throw new ActivitiIllegalArgumentException(\"processDefinitionId is null\");\n        }\n\n        if (userId == null && groupId == null) {\n            throw new ActivitiIllegalArgumentException(\"userId and groupId cannot both be null\");\n        }\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        ProcessDefinitionEntity processDefinition = commandContext\n                .getProcessDefinitionEntityManager()\n                .findProcessDefinitionById(processDefinitionId);\n\n        if (processDefinition == null) {\n            throw new ActivitiObjectNotFoundException(\"Cannot find process definition with id \" + processDefinitionId, ProcessDefinition.class);\n        }\n\n        processDefinition.deleteIdentityLink(userId, groupId);","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/DeleteIdentityLinkForProcessDefinitionCmd.java#L29-L65","documentation":"DeleteIdentityLinkForProcessDefinitionCmd removes a start-form/candidate-starter style identity link from a process definition. validateParams rejects a null processDefinitionId with ActivitiIllegalArgumentException because the target definition must be identified before any link can be removed.","triggerScenarios":"Calling repositoryService.deleteProcessDefinitionIdentityLink / deleteCandidateStarterGroup/User (this command) with a null processDefinitionId.","commonSituations":"Deployment tooling where the definition id came from an optional lookup that returned null; scripts operating on definitions by key instead of id and leaving the id unset; CI cleanup steps after failed deployments.","solutions":["Resolve the definition id first (repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).latestVersion().singleResult().getId()).","Guard the call site to skip when the id is null.","Ensure you pass the process DEFINITION id, not the deployment id or instance id."],"exampleFix":"// before\nrepositoryService.deleteCandidateStarterGroup(processDefinitionId, \"sales\");\n// after\nif (processDefinitionId != null) {\n    repositoryService.deleteCandidateStarterGroup(processDefinitionId, \"sales\");\n}","handlingStrategy":"validation","validationCode":"if (processDefinitionId == null) {\n    return; // or resolve from key: createProcessDefinitionQuery().processDefinitionKey(key).latestVersion()\n}","typeGuard":null,"tryCatchPattern":"try {\n    repositoryService.deleteProcessDefinitionIdentityLink(defId, userId, groupId);\n} catch (ActivitiIllegalArgumentException e) {\n    log.warn(\"Invalid definition identity-link delete: {}\", e.getMessage());\n}","preventionTips":["Resolve definition ids via query APIs instead of storing them manually","Distinguish process definition id, deployment id, and process instance id in your code","Null-check optional lookup results before calling repository mutation APIs"],"tags":["null-argument","process-definition","identity-link","validation"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}