{"record":{"id":"e3fd803fec3add94","repo":"flowable/flowable-engine","slug":"provided-execution-id-is-null-e3fd80","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/SuspendedJobQueryImpl.java","lineNumber":383,"sourceCode":"    }\n\n    @Override\n    public SuspendedJobQueryImpl 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 SuspendedJobQueryImpl 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 SuspendedJobQueryImpl 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":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/SuspendedJobQueryImpl.java#L365-L401","documentation":"SuspendedJobQueryImpl.executionId(String) throws FlowableIllegalArgumentException when the given executionId is null. Flowable validates required query parameters at setter time so callers get an immediate, precise error instead of an empty result set or downstream persistence-layer failure. A suspended job filter on execution id must always be a concrete, non-null identifier.","triggerScenarios":"Calling executionId(null) directly, or passing the result of execution.getId() from a variable that was not loaded (e.g. process instance ended and execution no longer resolvable, or a variable/DTO field that is null).","commonSituations":"Admin tooling listing suspended jobs per process instance where the execution id lookup returned null after the process ended; batch scripts that read execution ids from files/DB and hit missing rows.","solutions":["Resolve the execution id via RuntimeService before querying and confirm it is non-null.","Only apply the executionId filter when the value exists; otherwise query on other criteria (processInstanceId, handlerType).","If the execution is expected to exist, check whether the process instance has completed/been deleted and use the historic service instead."],"exampleFix":"// before\nquery.executionId(execution != null ? execution.getId() : null); // throws when execution is null\n// after\nif (execution != null) {\n    query.executionId(execution.getId());\n}","handlingStrategy":"validation","validationCode":"if (executionId == null) {\n    throw new IllegalStateException(\"executionId not resolved; cannot query suspended jobs by execution\");\n}","typeGuard":"boolean hasExecution(Execution e) { return e != null && e.getId() != null; }","tryCatchPattern":"try {\n    query.executionId(executionId);\n} catch (FlowableIllegalArgumentException e) {\n    // fall back to processInstanceId or skip the execution filter\n    query.processInstanceId(processInstanceId);\n}","preventionTips":["Resolve executions via RuntimeService and check for null before using their ids.","Remember finished processes have no runtime execution — query history instead.","Centralize query building in one place that strips null filters."],"tags":["flowable","query","null-check","job-service"],"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"}