{"record":{"id":"036c7c7a5dce6383","repo":"flowable/flowable-engine","slug":"key-is-null-036c7c","errorCode":null,"errorMessage":"key is null","messagePattern":"key is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/DecisionQueryImpl.java","lineNumber":160,"sourceCode":"            throw new FlowableIllegalArgumentException(\"ids are null\");\n        }\n        this.deploymentIds = deploymentIds;\n        return this;\n    }\n\n    @Override\n    public DecisionQueryImpl parentDeploymentId(String parentDeploymentId) {\n        if (parentDeploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"parentDeploymentId is null\");\n        }\n        this.parentDeploymentId = parentDeploymentId;\n        return this;\n    }\n\n    @Override\n    public DecisionQueryImpl decisionKey(String key) {\n        if (key == null) {\n            throw new FlowableIllegalArgumentException(\"key is null\");\n        }\n        this.key = key;\n        return this;\n    }\n\n    @Override\n    public DecisionQueryImpl decisionKeyLike(String keyLike) {\n        if (keyLike == null) {\n            throw new FlowableIllegalArgumentException(\"keyLike is null\");\n        }\n        this.keyLike = keyLike;\n        return this;\n    }\n\n    @Override\n    public DecisionQueryImpl decisionResourceName(String resourceName) {\n        if (resourceName == null) {\n            throw new FlowableIllegalArgumentException(\"resourceName is null\");","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/DecisionQueryImpl.java#L142-L178","documentation":"Flowable's DMN DecisionQueryImpl.decisionKey(String) requires a non-null key because the query is translated into a SQL WHERE clause; a null key cannot be expressed as a condition. Calling decisionKey(null) is treated as a programming error and rejected immediately with FlowableIllegalArgumentException rather than failing later at query execution.","triggerScenarios":"Calling decisionTableQuery().decisionKey(null) or decisionQuery().decisionKey(null) — passing a variable that was never initialized, or a method parameter forwarded straight into the query builder.","commonSituations":"Dynamic query builders where the key comes from a user request, config file, or REST path parameter that is missing/empty; refactors that renamed a deployment key so the lookup variable is null; code that treats null key as 'match all' which Flowable does not support (use no filter or keyLike instead).","solutions":["Ensure a non-null decision key before building the query; if the key is optional, skip calling decisionKey entirely.","Validate or resolve the key (e.g. from config/request) with a default or early return when absent.","If you need pattern matching with a possibly-null value, guard with `if (key != null) query.decisionKey(key);`"],"exampleFix":"// before\nDmnDecisionQuery query = dmnRepositoryService.createDecisionQuery().decisionKey(request.getKey());\n// after\nDmnDecisionQuery query = dmnRepositoryService.createDecisionQuery();\nif (request.getKey() != null) {\n    query.decisionKey(request.getKey());\n}","handlingStrategy":"validation","validationCode":"if (key == null || key.isEmpty()) {\n    throw new IllegalArgumentException(\"decision key must be provided\");\n}\nquery.decisionKey(key);","typeGuard":"boolean hasKey(String k) { return k != null && !k.isEmpty(); }","tryCatchPattern":"try {\n    query.decisionKey(key);\n} catch (FlowableIllegalArgumentException e) {\n    if (\"key is null\".equals(e.getMessage())) {\n        // proceed with unfiltered query or rethrow with context\n    } else { throw e; }\n}","preventionTips":["Never forward optional parameters into query builders unconditionally","Treat null filters as 'skip the filter', not 'pass null'","Validate request/config inputs at the boundary before building queries"],"tags":["java","flowable","dmn","null-check","query-builder"],"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"}