{"record":{"id":"40d0b7d4c005ca56","repo":"flowable/flowable-engine","slug":"provided-correlationid-is-null-40d0b7","errorCode":null,"errorMessage":"Provided correlationId is null","messagePattern":"Provided correlationId 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":370,"sourceCode":"            this.caseDefinitionKey = caseDefinitionKey;\n        }\n        return this;\n    }\n    \n    @Override\n    public SuspendedJobQueryImpl planItemInstanceId(String planItemInstanceId) {\n        if (planItemInstanceId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided plan item instance id is null\");\n        }\n        subScopeId(planItemInstanceId);\n        scopeType(ScopeTypes.CMMN);\n        return this;\n    }\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;","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/SuspendedJobQueryImpl.java#L352-L388","documentation":"SuspendedJobQueryImpl.correlationId(String) throws FlowableIllegalArgumentException when the supplied correlationId is null. Like other query setters, it validates input at call time so an incomplete filter fails fast instead of silently matching nothing. The value is also routed to the current OR-query object when inside an or() block, so validation happens before either branch.","triggerScenarios":"Calling correlationId(null) directly, or passing a variable holding the job correlation id (e.g. from an event, message header, or external correlation store) that is null, inside or outside an or() block.","commonSituations":"Message-driven integrations where a correlation id header is missing; lookups of suspended jobs after a failed external-worker enqueue where the correlation key was never assigned.","solutions":["Verify the correlation id is actually generated/persisted before querying (check where the job was created).","Guard the call site: skip the filter or fall back to another filter (e.g. handlerType, executionId) when the id is null.","If the correlation id comes from a request/event, add upstream validation to reject messages without it."],"exampleFix":"// before\nSuspendedJobQuery q = jobService.createSuspendedJobQuery().correlationId(msg.getCorrelationId());\n// after\nif (msg.getCorrelationId() == null) {\n    throw new IllegalArgumentException(\"Message missing correlationId\");\n}\nSuspendedJobQuery q = jobService.createSuspendedJobQuery().correlationId(msg.getCorrelationId());","handlingStrategy":"validation","validationCode":"if (correlationId == null || correlationId.isEmpty()) {\n    throw new IllegalArgumentException(\"correlationId must be non-null to query suspended jobs\");\n}","typeGuard":"boolean hasCorrelationId(String id) { return id != null && !id.trim().isEmpty(); }","tryCatchPattern":"try {\n    return jobService.createSuspendedJobQuery().correlationId(correlationId).list();\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Missing correlationId, skipping suspended job lookup\");\n    return Collections.emptyList();\n}","preventionTips":["Validate correlation ids at the message boundary (reject messages without one).","Default to an alternative filter (handlerType/executionId) when the correlation id is absent.","Document correlation id as a required field in your integration contract."],"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"}