{"record":{"id":"6ba3647c6659da83","repo":"flowable/flowable-engine","slug":"deployment-id-is-null-6ba364","errorCode":null,"errorMessage":"Deployment id is null","messagePattern":"Deployment id is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java","lineNumber":549,"sourceCode":"            this.caseInstanceParentId = parentId;\n        }\n        return this;\n    }\n    \n    @Override\n    public HistoricCaseInstanceQuery withoutCaseInstanceParent() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.withoutCaseInstanceParentId = true;\n        } else {\n            this.withoutCaseInstanceParentId = true;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricCaseInstanceQueryImpl deploymentId(String deploymentId) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"Deployment id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.deploymentId = deploymentId;\n        } else {\n            this.deploymentId = deploymentId;\n        }\n        return this;\n    }\n    \n    @Override\n    public HistoricCaseInstanceQueryImpl deploymentIds(List<String> deploymentIds) {\n        if (deploymentIds == null) {\n            throw new FlowableIllegalArgumentException(\"Deployment ids is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.deploymentIds = deploymentIds;\n        } else {\n            this.deploymentIds = deploymentIds;","sourceCodeStart":531,"sourceCodeEnd":567,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java#L531-L567","documentation":"HistoricCaseInstanceQueryImpl.deploymentId() rejects a null deployment id with FlowableIllegalArgumentException. The deployment id filter is translated into an equality predicate, so Flowable validates non-null before storing the value on the query or on currentOrQueryObject within an or() block.","triggerScenarios":"Calling deploymentId(null) — for example when the deployment id comes from a resolver that failed, an unset request attribute, or a null return from a deployment lookup service.","commonSituations":"Environment-scoped history views filtered by the deployment that provisioned the process; after a failed deployment or migration, the id lookup returns null and is passed to the query.","solutions":["Pass a real deployment id, e.g. deploymentId(repositoryService.createDeploymentQuery()...singleResult().getId()).","Only call deploymentId when the id is non-null; otherwise omit the filter.","Fail fast upstream with a clear message if the deployment id is required for the operation.","Catch FlowableIllegalArgumentException to convert the failure into a 400 validation response."],"exampleFix":"// before\nquery.deploymentId(deploymentId);\n// after\nif (deploymentId != null) {\n    query.deploymentId(deploymentId);\n}","handlingStrategy":"validation","validationCode":"if (deploymentId != null) {\n    query.deploymentId(deploymentId);\n}","typeGuard":"boolean hasDeploymentId(String id) {\n    return id != null && !id.isBlank();\n}","tryCatchPattern":"try {\n    query.deploymentId(deploymentId);\n} catch (FlowableIllegalArgumentException e) {\n    throw new InvalidRequestException(\"deploymentId must not be null\");\n}","preventionTips":["Resolve deployment ids before query building and fail fast if missing","Never pass lookup results that may be null directly into setters","Make deployment scoping explicit in configuration with validation","Test history queries in environments where no deployment exists yet"],"tags":["flowable","cmmn","query","null-argument","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"}