{"record":{"id":"efe7a5b836c36510","repo":"flowable/flowable-engine","slug":"ids-is-an-empty-collection-efe7a5","errorCode":null,"errorMessage":"ids is an empty collection","messagePattern":"ids is an empty collection","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":161,"sourceCode":"        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) {\n        if (parentDeploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"parentDeploymentId is null\");\n        }\n        this.parentDeploymentId = parentDeploymentId;\n        return this;\n    }\n\n    @Override\n    public CaseDefinitionQueryImpl caseDefinitionKey(String key) {\n        if (key == null) {\n            throw new FlowableIllegalArgumentException(\"key is null\");","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CaseDefinitionQueryImpl.java#L143-L179","documentation":"FlowableIllegalArgumentException thrown by CaseDefinitionQueryImpl.deploymentIds(Set<String>) when the set is non-null but empty. An empty IN-clause would produce invalid or degenerate SQL, so the engine rejects it explicitly. An empty set means the caller has no deployment ids and should either skip the filter or short-circuit to an empty result.","triggerScenarios":"Calling deploymentIds(new HashSet<>()) or deploymentIds(Collections.emptySet()) after collecting zero deployment ids (e.g. no deployments matched an earlier filter).","commonSituations":"Batch jobs filtering by deployments found in a previous query step; when nothing matched, the empty set was still passed through.","solutions":["Check isEmpty() before calling deploymentIds and skip the filter or return an empty result early.","Guard with ids != null && !ids.isEmpty() before building the query.","Investigate why no deployment ids were collected if a non-empty set was expected."],"exampleFix":"// before\nSet<String> ids = collectDeploymentIds(); // may be empty\nquery.deploymentIds(ids); // throws on empty\n\n// after\nSet<String> ids = collectDeploymentIds();\nif (ids.isEmpty()) {\n    return Collections.emptyList();\n}\nquery.deploymentIds(ids);","handlingStrategy":"validation","validationCode":"if (deploymentIds == null || deploymentIds.isEmpty()) {\n    return Collections.emptyList(); // match-none semantics\n}\nquery.deploymentIds(deploymentIds);","typeGuard":"boolean usableIds = deploymentIds != null && !deploymentIds.isEmpty();","tryCatchPattern":"try {\n    query.deploymentIds(deploymentIds);\n} catch (FlowableIllegalArgumentException e) {\n    // empty collection — return empty results instead of querying\n    return Collections.emptyList();\n}","preventionTips":["Decide whether an empty id set should mean 'no filter' or 'no results' and short-circuit accordingly.","Filter empty sets out early in batch pipelines before they reach query builders."],"tags":["flowable","cmmn","query","empty-collection"],"backgroundTag":"empty-required-field","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}