{"record":{"id":"1aae9aaf5832027e","repo":"flowable/flowable-engine","slug":"provided-case-definition-key-null","errorCode":null,"errorMessage":"Provided case definition key null","messagePattern":"Provided case definition key null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/DeadLetterJobQueryImpl.java","lineNumber":344,"sourceCode":"        scopeId(caseInstanceId);\n        scopeType(ScopeTypes.CMMN);\n        return this;\n    }\n    \n    @Override\n    public DeadLetterJobQuery caseDefinitionId(String caseDefinitionId) {\n        if (caseDefinitionId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided case definition id is null\");\n        }\n        scopeDefinitionId(caseDefinitionId);\n        scopeType(ScopeTypes.CMMN);\n        return this;\n    }\n\n    @Override\n    public DeadLetterJobQueryImpl caseDefinitionKey(String caseDefinitionKey) {\n        if (caseDefinitionKey == null) {\n            throw new FlowableIllegalArgumentException(\"Provided case definition key null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.caseDefinitionKey = caseDefinitionKey;\n        } else {\n            this.caseDefinitionKey = caseDefinitionKey;\n        }\n        return this;\n    }\n    \n    @Override\n    public DeadLetterJobQuery 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    }","sourceCodeStart":326,"sourceCodeEnd":362,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/DeadLetterJobQueryImpl.java#L326-L362","documentation":"DeadLetterJobQueryImpl.caseDefinitionKey() throws FlowableIllegalArgumentException when the caseDefinitionKey parameter is null. The key is the business identifier of a case definition, and a null key would produce an invalid filter, so Flowable rejects it at query-build time. This is a client-side precondition check, not a runtime failure.","triggerScenarios":"Calling deadLetterJobQuery().caseDefinitionKey(null) with a key sourced from configuration, a request parameter, or a variable that was never populated, including within or() blocks.","commonSituations":"Missing application property for the case key; API caller omitted the key; key renamed across deployments so old lookups now resolve to null.","solutions":["Null-check (and optionally blank-check) the key before passing it to caseDefinitionKey.","Load the key from a validated configuration source and fail with a clear message if missing at startup.","If filtering by key is optional, add the condition only when the key is present."],"exampleFix":"// before\nquery.caseDefinitionKey(config.getCaseKey());\n// after\nString key = config.getCaseKey();\nif (key != null && !key.isBlank()) {\n    query.caseDefinitionKey(key);\n}","handlingStrategy":"validation","validationCode":"if (caseDefinitionKey == null || caseDefinitionKey.isBlank()) { throw new IllegalArgumentException(\"caseDefinitionKey is required\"); }\nquery.caseDefinitionKey(caseDefinitionKey);","typeGuard":"boolean hasKey(String key) { return key != null && !key.isBlank(); }","tryCatchPattern":"try { query.caseDefinitionKey(key); } catch (FlowableIllegalArgumentException e) { log.warn(\"Null case definition key supplied\"); }","preventionTips":["Load business keys from validated configuration, never raw nulls","Add blank-string checks in addition to null checks","Keep definition keys stable across deployments"],"tags":["flowable","query","null-check","validation"],"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"}