{"record":{"id":"524ce4a5c01f3521","repo":"flowable/flowable-engine","slug":"id-is-null","errorCode":null,"errorMessage":"id is null","messagePattern":"id is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java","lineNumber":131,"sourceCode":"            throw new FlowableIllegalArgumentException(\"name is null\");\n        }\n        this.name = name;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl appDefinitionNameLike(String nameLike) {\n        if (nameLike == null) {\n            throw new FlowableIllegalArgumentException(\"nameLike is null\");\n        }\n        this.nameLike = nameLike;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl 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 AppDefinitionQueryImpl 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 AppDefinitionQueryImpl appDefinitionKey(String key) {","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java#L113-L149","documentation":"deploymentId(null) throws FlowableIllegalArgumentException with the (slightly mismatched) message 'id is null' — the method filters app definitions by their deployment id, which must be a concrete non-null string for an equality predicate.","triggerScenarios":"Calling appDefinitionQuery.deploymentId(deploymentId) where the deployment id variable is null — e.g. derived from a nullable path variable, an optional lookup result, or an unset config value.","commonSituations":"Deploying/fetching flow where the deployment was never created so its id is null; REST param not provided; passing another entity's null id field directly into the query.","solutions":["Verify the deployment id is resolved and non-null before querying; if it is null the deployment itself likely does not exist — fix the earlier step","Null-check and skip the filter when absent if that is semantically valid","Catch FlowableIllegalArgumentException and surface a 400/404 as appropriate"],"exampleFix":"// before\nAppDefinition appDef = repoService.createAppDefinitionQuery().deploymentId(deploymentId).singleResult();\n// after\nif (deploymentId == null) {\n    throw new IllegalArgumentException(\"No deployment id available\");\n}\nAppDefinition appDef = repoService.createAppDefinitionQuery().deploymentId(deploymentId).singleResult();","handlingStrategy":"validation","validationCode":"if (deploymentId == null) {\n    throw new IllegalStateException(\"deploymentId must be resolved before querying\");\n}\nquery.deploymentId(deploymentId);","typeGuard":"boolean hasDeploymentId(Object ctx) { return ctx != null && ((DeploymentContext) ctx).getDeploymentId() != null; }","tryCatchPattern":"try {\n    query.deploymentId(deploymentId);\n} catch (FlowableIllegalArgumentException e) {\n    throw new ResponseStatusException(HttpStatus.NOT_FOUND, \"Deployment id missing or unknown\", e);\n}","preventionTips":["Resolve the deployment id (deploy first, or fetch it) before querying by it","A null id usually means an earlier step failed — validate the whole chain","Prefer checking required identifiers at method entry with clear domain errors"],"tags":["flowable","null-check","query-builder","deployment"],"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"}