{"record":{"id":"e989619b08de6142","repo":"flowable/flowable-engine","slug":"provided-execution-id-is-null-e98961","errorCode":null,"errorMessage":"Provided execution id is null","messagePattern":"Provided execution 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":381,"sourceCode":"    }\n\n    @Override\n    public ExternalWorkerJobQuery 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 ExternalWorkerJobQuery 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 ExternalWorkerJobQuery 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":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/ExternalWorkerJobQueryImpl.java#L363-L399","documentation":"ExternalWorkerJobQueryImpl.executionId() requires a non-null execution id and throws FlowableIllegalArgumentException otherwise. The execution id ties external worker jobs to a BPMN execution; null cannot form a valid filter so Flowable validates the argument at query-build time instead of returning misleading results.","triggerScenarios":"Calling externalWorkerJobQuery.executionId(null), typically when the execution variable is optional, a lookup returned null, or the query is built for case-only scenarios where no execution exists.","commonSituations":"Generic job handlers that filter by execution only for BPMN jobs but pass null for CMMN jobs; refactored code paths where execution context was dropped; deserialized filter objects with missing fields.","solutions":["Only call executionId() with a non-null id; use scopeType/scopeId filters for CMMN cases","Guard the call on null before applying the filter","Fix the execution lookup that produced null (wrong process instance?)","Catch FlowableIllegalArgumentException and log the incomplete query context"],"exampleFix":"// before\nquery.executionId(execution == null ? null : execution.getId());\n// after\nif (execution != null) {\n    query.executionId(execution.getId());\n}","handlingStrategy":"validation","validationCode":"if (executionId == null) { throw new IllegalArgumentException(\"executionId must not be null\"); }\nquery.executionId(executionId);","typeGuard":"boolean hasExecutionId(String executionId) { return executionId != null && !executionId.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.executionId(executionId);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Null execution id in job query: {}\", e.getMessage());\n    throw new InvalidQueryException(e);\n}","preventionTips":["Only filter by executionId for BPMN jobs; use scope filters for CMMN","Check execution != null before calling .getId() on lookups","Handle mixed process/case job handlers with explicit branches instead of null ids","Add unit tests covering the case-only and process-only query paths"],"tags":["flowable","null-check","bpmn","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-14T05:17:10.506Z"}