{"record":{"id":"62a185dfdac82f80","repo":"flowable/flowable-engine","slug":"provided-execution-id-is-null-62a185","errorCode":null,"errorMessage":"Provided execution id is null","messagePattern":"Provided execution id is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/JobQueryImpl.java","lineNumber":373,"sourceCode":"    }\n\n    @Override\n    public JobQueryImpl correlationId(String correlationId) {\n        if (correlationId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided correlationId is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.correlationId = correlationId;\n        } else {\n            this.correlationId = correlationId;\n        }\n        return this;\n    }\n\n    @Override\n    public JobQueryImpl executionId(String executionId) {\n        if (executionId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided execution id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.executionId = executionId;\n        } else {\n            this.executionId = executionId;\n        }\n        return this;\n    }\n\n    @Override\n    public JobQueryImpl handlerType(String handlerType) {\n        if (handlerType == null) {\n            throw new FlowableIllegalArgumentException(\"Provided handlerType is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.handlerType = handlerType;\n        } else {\n            this.handlerType = handlerType;","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/JobQueryImpl.java#L355-L391","documentation":"JobQueryImpl.executionId(String) rejects a null execution id with FlowableIllegalArgumentException before storing it as a query filter. Execution id ties jobs to a specific BPMN execution; null would make the filter invalid, so the library fails fast at query construction. This is thrown before any database interaction, purely from argument validation.","triggerScenarios":"Calling jobQuery.executionId(null); commonly when the execution id comes from a DelegateExecution/Task field that was null (e.g. a task not tied to an execution), or from a lookup that found no execution.","commonSituations":"Passing executionId from a historic record whose runtime execution was removed; using the method on job/async-executor code paths where the execution context is absent; copy-pasted query builders where the variable was never set.","solutions":["Null-check the execution id before calling and skip the filter when absent","Use processInstanceId instead when you have the process instance but not the execution id","Verify the execution still exists at runtime (runtimeService.createExecutionQuery()) before querying its jobs","Fix the upstream code that should populate the execution id field"],"exampleFix":"// before\nList<Job> jobs = jobService.createJobQuery().executionId(executionId).list();\n// after\nif (executionId != null) {\n    List<Job> jobs = jobService.createJobQuery().executionId(executionId).list();\n} else {\n    List<Job> jobs = jobService.createJobQuery().processInstanceId(processInstanceId).list();\n}","handlingStrategy":"validation","validationCode":"if (executionId == null) { throw new IllegalArgumentException(\"executionId must not be null\"); }\njobQuery.executionId(executionId);","typeGuard":"boolean hasExecutionId(String id) { return id != null; }","tryCatchPattern":"try {\n    jobQuery.executionId(executionId);\n} catch (FlowableIllegalArgumentException e) {\n    logger.warn(\"executionId was null\", e);\n}","preventionTips":["Null-check DelegateExecution/Task-derived ids before querying","Use processInstanceId as a broader filter when execution id is unknown","Verify executions still exist at runtime; historic data may lack runtime ids"],"tags":["flowable","java","null-check","bpmn"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}