{"record":{"id":"7a4e2dd4150ec1e4","repo":"flowable/flowable-engine","slug":"provided-element-id-is-null-7a4e2d","errorCode":null,"errorMessage":"Provided element id is null","messagePattern":"Provided element id is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/TimerJobQueryImpl.java","lineNumber":199,"sourceCode":"    }\n\n    @Override\n    public TimerJobQueryImpl 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 TimerJobQueryImpl 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 TimerJobQuery 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":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/TimerJobQueryImpl.java#L181-L217","documentation":"Flowable's TimerJobQueryImpl.elementId(String) throws FlowableIllegalArgumentException when the element id filter is null. The element id identifies the BPMN activity the timer is attached to; null is not a valid filter value so it is rejected eagerly. Omit the call if you do not want to filter by element.","triggerScenarios":"Calling createTimerJobQuery().elementId(null), e.g. when the id is taken from a FlowElement reference or model node that was null.","commonSituations":"Resolving the element from an execution that has not reached the activity yet; a misconfigured BPMN model where the boundary event has no id; dynamic inspection code that passes through a nullable model object.","solutions":["Validate the FlowElement/BpmnModel reference is non-null before reading its id","Null-check and skip the elementId filter when absent","Fix the BPMN model so the relevant timer/boundary event has an id","Catch FlowableIllegalArgumentException for defensive UI/API layers"],"exampleFix":"// before\nquery.elementId(flowElement.getId());\n// after\nif (flowElement != null) {\n    query.elementId(flowElement.getId());\n}","handlingStrategy":"validation","validationCode":"if (elementId == null) { throw new IllegalArgumentException(\"elementId must be resolved from a non-null FlowElement\"); }","typeGuard":"boolean hasElementId(FlowElement e) { return e != null && e.getId() != null; }","tryCatchPattern":"try { query.elementId(elId); } catch (FlowableIllegalArgumentException e) { log.warn(\"Null element id filter\", e); }","preventionTips":["Ensure BPMN elements carry unique ids","Null-check FlowElement/BpmnModel references before reading ids","Handle executions that have not reached the target activity","Prefer conditional filtering over null passthrough"],"tags":["flowable","null-check","query-api","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"}