{"record":{"id":"89706026275d069d","repo":"flowable/flowable-engine","slug":"id-is-null-897060","errorCode":null,"errorMessage":"id is null","messagePattern":"id is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CaseDefinitionQueryImpl.java","lineNumber":150,"sourceCode":"            throw new FlowableIllegalArgumentException(\"nameLike is null\");\n        }\n        this.nameLike = nameLike;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl caseDefinitionNameLikeIgnoreCase(String nameLikeIgnoreCase) {\n        if (nameLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"nameLikeIgnoreCase is null\");\n        }\n        this.nameLikeIgnoreCase = nameLikeIgnoreCase;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl deploymentId(String deploymentId) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"id is null\");\n        }\n        this.deploymentId = deploymentId;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl deploymentIds(Set<String> deploymentIds) {\n        if (deploymentIds == null) {\n            throw new FlowableIllegalArgumentException(\"ids are null\");\n        } else if (deploymentIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"ids is an empty collection\");\n        }\n        this.deploymentIds = deploymentIds;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQuery parentDeploymentId(String parentDeploymentId) {","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CaseDefinitionQueryImpl.java#L132-L168","documentation":"FlowableIllegalArgumentException with the (historically misworded) message \"id is null\" thrown by CaseDefinitionQueryImpl.deploymentId(String). Despite the message text, the null value in question is the deploymentId parameter. The engine rejects a null deployment id because filtering case definitions by a null deployment would be meaningless; use deploymentId only when you have an actual deployment identifier.","triggerScenarios":"Calling caseDefinitionQuery.deploymentId(null) — often when the deployment id was derived from a prior lookup (e.g. a deployment query) that returned nothing.","commonSituations":"Chained flows where code fetches a deployment then queries its case definitions; the first step silently failed or returned null, and the null id was forwarded.","solutions":["Pass a real deployment id string obtained from Deployment.getId().","Skip the deploymentId filter when the id is null.","Verify the earlier step that produced the deployment id (it may have failed to find the deployment)."],"exampleFix":"// before\nDeployment d = repositoryService.createDeploymentQuery().deploymentName(\"cases\").singleResult();\nquery.deploymentId(d.getId()); // NPE/IAE when d is null\n\n// after\nDeployment d = repositoryService.createDeploymentQuery().deploymentName(\"cases\").singleResult();\nif (d != null) {\n    query.deploymentId(d.getId());\n}","handlingStrategy":"validation","validationCode":"if (deploymentId != null) {\n    query.deploymentId(deploymentId);\n}","typeGuard":"boolean hasDeployment = deploymentId != null && !deploymentId.isEmpty();","tryCatchPattern":"try {\n    query.deploymentId(deploymentId);\n} catch (FlowableIllegalArgumentException e) {\n    throw new IllegalStateException(\"deploymentId was null — earlier lookup failed?\", e);\n}","preventionTips":["Null-check the Deployment object itself before calling getId() in chained queries.","Remember the message says 'id is null' but the parameter is deploymentId — don't be misled when debugging."],"tags":["flowable","cmmn","query","deployment-id","null-check"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}