{"record":{"id":"311e72faf317f2d2","repo":"flowable/flowable-engine","slug":"deployment-ids-is-null-311e72","errorCode":null,"errorMessage":"Deployment ids is null","messagePattern":"Deployment ids 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":562,"sourceCode":"    }\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;\n        }\n        return this;\n    }\n    \n    @Override\n    public HistoricCaseInstanceQueryImpl finished() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.finished = true;\n        } else {\n            this.finished = true;\n        }\n        return this;\n    }","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java#L544-L580","documentation":"HistoricCaseInstanceQueryImpl.deploymentIds() throws FlowableIllegalArgumentException when the List of deployment ids is null. The list feeds an SQL IN clause, so a null value is rejected before assignment to the query or the active or-query object. Only null is checked — an empty list passes this specific guard.","triggerScenarios":"Calling deploymentIds(null), typically when the list is built by collecting ids from a stream/filter whose result object was null, or from an absent request body field.","commonSituations":"Bulk history exports scoped to several deployments; the id list is assembled from configuration or a previous query, and an upstream failure leaves it null instead of empty.","solutions":["Pass a non-null List of deployment ids, e.g. Arrays.asList(\"dep-1\", \"dep-2\").","Initialize collections at declaration (Collections.emptyList()) instead of leaving them null.","Skip the deploymentIds call when the list is null/empty to apply no filter.","Catch FlowableIllegalArgumentException when filters come from external input."],"exampleFix":"// before\nquery.deploymentIds(ids);\n// after\nList<String> ids = resolveDeploymentIds();\nif (ids != null && !ids.isEmpty()) {\n    query.deploymentIds(ids);\n}","handlingStrategy":"validation","validationCode":"if (deploymentIds != null && !deploymentIds.isEmpty()) {\n    query.deploymentIds(deploymentIds);\n}","typeGuard":"boolean hasDeploymentIds(List<String> ids) {\n    return ids != null && !ids.isEmpty();\n}","tryCatchPattern":"try {\n    query.deploymentIds(ids);\n} catch (FlowableIllegalArgumentException e) {\n    throw new InvalidRequestException(\"deploymentIds list must not be null\");\n}","preventionTips":["Initialize id lists as empty collections, never null","Map streams defensively: return emptyList() instead of null when nothing matches","Guard multi-id filters with null and isEmpty checks","Unit-test export/report jobs with empty deployment scopes"],"tags":["flowable","cmmn","query","null-argument","collection"],"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"}