{"record":{"id":"cbbcce69bbc57e34","repo":"flowable/flowable-engine","slug":"callbackids-is-null-or-empty-cbbcce","errorCode":null,"errorMessage":"callbackIds is null or empty","messagePattern":"callbackIds is null or empty","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java","lineNumber":648,"sourceCode":"    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceCallbackId(String callbackId) {\n        if (callbackId == null) {\n            throw new FlowableIllegalArgumentException(\"callbackId is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.callbackId = callbackId;\n        } else {\n            this.callbackId = callbackId;\n        }\n        return this;\n    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceCallbackIds(Set<String> callbackIds) {\n        if (callbackIds == null || callbackIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"callbackIds is null or empty\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.callbackIds = callbackIds;\n        } else {\n            this.callbackIds = callbackIds;\n        }\n        return this;\n    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceCallbackType(String callbackType) {\n        if (callbackType == null) {\n            throw new FlowableIllegalArgumentException(\"callbackType is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.callbackType = callbackType;\n        } else {\n            this.callbackType = callbackType;","sourceCodeStart":630,"sourceCodeEnd":666,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java#L630-L666","documentation":"FlowableIllegalArgumentException thrown by CaseInstanceQueryImpl.caseInstanceCallbackIds(Set<String>) when the callbackIds argument is null or an empty set. Flowable query builders validate required filter parameters eagerly so invalid queries fail at construction time instead of producing broken SQL. Pass a non-empty set of callback ids.","triggerScenarios":"Calling caseInstanceCallbackIds(null) or caseInstanceCallbackIds(new HashSet<>()) / Set.of() (empty) on a CaseInstanceQuery, including inside an or() block.","commonSituations":"Building the query dynamically from user input where the callback-id list is absent or was never populated; deserialization producing an empty set; refactors that renamed a variable leaving it null.","solutions":["Pass a non-empty Set of callback ids to caseInstanceCallbackIds.","If no filter is wanted, skip the call entirely instead of passing null/empty.","Guard caller-side: only invoke the method when ids != null && !ids.isEmpty().","Check upstream data extraction (e.g. from request body) that yields an empty set."],"exampleFix":"// before\nquery.caseInstanceCallbackIds(request.getCallbackIds()); // may be null/empty\n// after\nSet<String> ids = request.getCallbackIds();\nif (ids != null && !ids.isEmpty()) {\n    query.caseInstanceCallbackIds(ids);\n}","handlingStrategy":"validation","validationCode":"Set<String> ids = ...;\nif (ids == null || ids.isEmpty()) { throw new IllegalArgumentException(\"callbackIds must be non-empty\"); }\nquery.caseInstanceCallbackIds(ids);","typeGuard":"boolean hasCallbackIds(Set<String> s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try { query.caseInstanceCallbackIds(ids); } catch (FlowableIllegalArgumentException e) { log.warn(\"invalid callbackIds filter: {}\", e.getMessage()); }","preventionTips":["Only apply query filters for values actually present in input.","Use Optional/conditional builder patterns for optional filters.","Unit-test query construction with absent optional parameters."],"tags":["flowable","cmmn","query","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-18T11:17:12.947Z"}