{"record":{"id":"f39fbac93852d96e","repo":"flowable/flowable-engine","slug":"provided-element-id-is-null-f39fba","errorCode":null,"errorMessage":"Provided element id is null","messagePattern":"Provided element id is 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":201,"sourceCode":"    }\n\n    @Override\n    public ExternalWorkerJobQuery categoryLike(String categoryLike) {\n        if (categoryLike == null) {\n            throw new FlowableIllegalArgumentException(\"Provided categoryLike is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.categoryLike = categoryLike;\n        } else {\n            this.categoryLike = categoryLike;\n        }\n        return this;\n    }\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;","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/ExternalWorkerJobQueryImpl.java#L183-L219","documentation":"ExternalWorkerJobQuery.elementId(String) throws FlowableIllegalArgumentException when the provided flow element id is null. The element id filter targets jobs attached to a specific BPMN element (service task, etc.); null is rejected as an invalid argument. Supply a real element id from the model or drop the filter.","triggerScenarios":"Calling externalWorkerJobQuery().elementId(null), e.g. when the element id is read from a FlowElement or execution that is not job-related.","commonSituations":"Retry tooling that resolves the failing element dynamically and the resolution fails; BPMN parsing where the activity reference is missing; generic job inspectors passing through null element references.","solutions":["Pass the BPMN element id (e.g. the service task's id attribute).","Guard the call site with a null check before applying the filter.","Resolve the element id from the process definition model, handling missing elements explicitly.","Log the null element id to surface upstream model issues."],"exampleFix":"// before\nquery.elementId(flowElement.getId());\n// after\nif (flowElement != null) {\n    query.elementId(flowElement.getId());\n}","handlingStrategy":"validation","validationCode":"if (elementId != null && !elementId.isBlank()) {\n    query.elementId(elementId);\n}","typeGuard":"boolean hasElementId(String id) { return id != null && !id.isBlank(); }","tryCatchPattern":"try {\n    query.elementId(elementId);\n} catch (FlowableIllegalArgumentException e) {\n    throw new IllegalStateException(\"Cannot filter jobs: element id unresolved\", e);\n}","preventionTips":["Resolve element ids from the deployed BPMN model, failing fast if absent.","Keep job-to-element references intact when renaming elements in the model.","Log unresolved element references to catch model drift early."],"tags":["flowable","query-builder","null-check","bpmn-element"],"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"}