{"record":{"id":"296a2f93e530a5b3","repo":"flowable/flowable-engine","slug":"deploymentid-is-null-296a2f","errorCode":null,"errorMessage":"deploymentId is null","messagePattern":"deploymentId is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DeleteDeploymentCmd.java","lineNumber":37,"sourceCode":"import org.flowable.common.engine.impl.interceptor.CommandContext;\n\n/**\n * @author Joram Barrez\n */\npublic class DeleteDeploymentCmd implements Command<Void> {\n    \n    protected String deploymentId;\n    protected boolean cascade;\n\n    public DeleteDeploymentCmd(String deploymentId, boolean cascade) {\n        this.deploymentId = deploymentId;\n        this.cascade = cascade;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentId is null\");\n        }\n        \n        CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);\n        cmmnEngineConfiguration.getDeploymentManager().removeDeployment(deploymentId, cascade);\n        return null;\n    }\n}\n","sourceCodeStart":19,"sourceCodeEnd":45,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DeleteDeploymentCmd.java#L19-L45","documentation":"DeleteDeploymentCmd validates its deploymentId argument before delegating to the DeploymentManager. If the caller passes null, it throws FlowableIllegalArgumentException(\"deploymentId is null\") immediately. This is a pure argument-validation error, not a lookup failure.","triggerScenarios":"Calling CmmnRepositoryService.deleteDeployment(null) or deleteDeployment(null, cascade), typically when the id variable was never populated (failed deploy, unmapped result).","commonSituations":"Deploy result object not checked before delete; configuration property or DB column holding null used as the id; refactor renamed a variable leaving it uninitialized.","solutions":["Assert/validate deploymentId is non-null and non-empty before calling deleteDeployment","Trace where the id comes from (deployment response, config, DB) and fix the null source","Guard with a repositoryService.createDeploymentQuery().deploymentId(id) existence check"],"exampleFix":"// before\nrepositoryService.deleteDeployment(deploymentId);\n// after\nif (deploymentId != null && !deploymentId.isEmpty()) {\n    repositoryService.deleteDeployment(deploymentId);\n}","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(deploymentId, \"deploymentId must not be null\");\nrepositoryService.deleteDeployment(deploymentId);","typeGuard":"boolean isValidId(String id) { return id != null && !id.trim().isEmpty(); }","tryCatchPattern":"try { repositoryService.deleteDeployment(deploymentId, cascade); }\ncatch (FlowableIllegalArgumentException e) { if (\"deploymentId is null\".equals(e.getMessage())) { throw new IllegalStateException(\"caller passed null deploymentId\", e); } throw e; }","preventionTips":["Validate ids at API boundaries with Objects.requireNonNull","Check deploy results before scheduling deletes","Avoid optional/null-returning sources for deployment ids"],"tags":["cmmn","deployment","null-argument","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-14T05:17:10.506Z"}