{"record":{"id":"fb7f7d17780fe51c","repo":"flowable/flowable-engine","slug":"provided-execution-id-is-null-fb7f7d","errorCode":null,"errorMessage":"Provided execution id is null","messagePattern":"Provided execution id is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TimerJobQueryImpl.java","lineNumber":93,"sourceCode":"            throw new ActivitiIllegalArgumentException(\"Provided process instance id is null\");\n        }\n        this.processInstanceId = processInstanceId;\n        return this;\n    }\n\n    @Override\n    public TimerJobQueryImpl processDefinitionId(String processDefinitionId) {\n        if (processDefinitionId == null) {\n            throw new ActivitiIllegalArgumentException(\"Provided process definition id is null\");\n        }\n        this.processDefinitionId = processDefinitionId;\n        return this;\n    }\n\n    @Override\n    public TimerJobQueryImpl executionId(String executionId) {\n        if (executionId == null) {\n            throw new ActivitiIllegalArgumentException(\"Provided execution id is null\");\n        }\n        this.executionId = executionId;\n        return this;\n    }\n\n    @Override\n    public TimerJobQuery executable() {\n        executable = true;\n        return this;\n    }\n\n    @Override\n    public TimerJobQuery timers() {\n        if (onlyMessages) {\n            throw new ActivitiIllegalArgumentException(\"Cannot combine onlyTimers() with onlyMessages() in the same query\");\n        }\n        this.onlyTimers = true;\n        return this;","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TimerJobQueryImpl.java#L75-L111","documentation":"TimerJobQueryImpl.executionId() throws ActivitiIllegalArgumentException when the execution id argument is null. The query layer rejects null filters up front so the resulting job query is never built from an unset identifier. An execution id identifies the specific execution a timer job is attached to.","triggerScenarios":"Calling timerJobQuery().executionId(null), usually because the Execution object or its id was null — e.g. after the process instance already ended, or the variable holding the execution was never assigned.","commonSituations":"Querying timers for an execution that already completed (execution no longer exists, stored reference is null); async listener code reading a stale execution reference; wiring an optional execution context parameter through without a null check.","solutions":["Ensure a valid execution id is passed; fetch it via runtimeService.createExecutionQuery() or from the DelegateExecution","Skip the executionId() filter when the value is null instead of passing it","Check that the process instance/execution still exists before querying its timer jobs"],"exampleFix":"// before\nquery.executionId(executionId);\n// after\nif (executionId != null) {\n    query.executionId(executionId);\n}","handlingStrategy":"validation","validationCode":"if (executionId == null) {\n    throw new IllegalStateException(\"executionId is required; execution may have already ended\");\n}\nquery.executionId(executionId);","typeGuard":"boolean hasExecutionId(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try {\n    query.executionId(executionId);\n} catch (ActivitiIllegalArgumentException e) {\n    throw new IllegalStateException(\"Execution no longer exists or id was not captured\", e);\n}","preventionTips":["Capture the execution id from DelegateExecution while the process is alive","Check execution existence before querying its jobs","Guard optional execution context values before applying the filter"],"tags":["flowable","activiti","null-argument","job-query"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}