{"record":{"id":"6802ad97c1f137c0","repo":"flowable/flowable-engine","slug":"provided-element-ids-are-null-6802ad","errorCode":null,"errorMessage":"Provided element ids are null","messagePattern":"Provided element ids are null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/ExternalWorkerJobQueryImpl.java","lineNumber":214,"sourceCode":"    }\n\n    @Override\n    public ExternalWorkerJobQuery elementId(String elementId) {\n        if (elementId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided element id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.elementId = elementId;\n        } else {\n            this.elementId = elementId;\n        }\n        return this;\n    }\n\n    @Override\n    public ExternalWorkerJobQuery elementIds(Collection<String> elementIds) {\n        if (elementIds == null) {\n            throw new FlowableIllegalArgumentException(\"Provided element ids are null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.elementIds = elementIds;\n        } else {\n            this.elementIds = elementIds;\n        }\n        return this;\n    }\n\n    @Override\n    public ExternalWorkerJobQuery elementName(String elementName) {\n        if (elementName == null) {\n            throw new FlowableIllegalArgumentException(\"Provided element name is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.elementName = elementName;\n        } else {\n            this.elementName = elementName;","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/ExternalWorkerJobQueryImpl.java#L196-L232","documentation":"ExternalWorkerJobQuery.elementIds(Collection<String>) throws FlowableIllegalArgumentException when the provided element-id collection is null. Like jobIds, the multi-value filter is validated eagerly; a null collection cannot be translated into an IN clause. Use an empty collection or conditionally apply the filter.","triggerScenarios":"Calling externalWorkerJobQuery().elementIds(null), typically when the set of interesting element ids is computed conditionally and ends up null.","commonSituations":"Bulk job inspection tools built from config where 'elementIds' is an optional list; refactorings replacing a varargs helper with a collection argument; deserialized payloads missing the field.","solutions":["Pass Collections.emptyList() instead of null when there are no ids.","Only call elementIds(ids) when the collection is non-null and non-empty.","Default optional config fields to empty collections at load time.","Ensure deserialization frameworks populate collection fields with empty defaults."],"exampleFix":"// before\nquery.elementIds(selectedElementIds);\n// after\nif (selectedElementIds != null && !selectedElementIds.isEmpty()) {\n    query.elementIds(selectedElementIds);\n}","handlingStrategy":"validation","validationCode":"if (elementIds != null && !elementIds.isEmpty()) {\n    query.elementIds(elementIds);\n}","typeGuard":"boolean hasElementIds(Collection<String> ids) { return ids != null && !ids.isEmpty(); }","tryCatchPattern":"try {\n    query.elementIds(ids);\n} catch (FlowableIllegalArgumentException e) {\n    query; // rebuild without the elementIds filter\n}","preventionTips":["Initialize element id collections as empty sets/lists, never null.","Configure deserialization to default missing collection fields to empty collections.","Filter out empty collections before applying multi-value filters."],"tags":["flowable","query-builder","null-check","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"}