{"record":{"id":"04ee5d865f8a1013","repo":"flowable/flowable-engine","slug":"decisionkey-is-null","errorCode":null,"errorMessage":"decisionKey is null","messagePattern":"decisionKey is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/HistoricDecisionExecutionQueryImpl.java","lineNumber":99,"sourceCode":"            throw new FlowableIllegalArgumentException(\"decisionDefinitionId is null\");\n        }\n        this.decisionDefinitionId = decisionDefinitionId;\n        return this;\n    }\n    \n    @Override\n    public DmnHistoricDecisionExecutionQuery deploymentId(String deploymentId) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentId is null\");\n        }\n        this.deploymentId = deploymentId;\n        return this;\n    }\n    \n    @Override\n    public DmnHistoricDecisionExecutionQuery decisionKey(String decisionKey) {\n        if (decisionKey == null) {\n            throw new FlowableIllegalArgumentException(\"decisionKey is null\");\n        }\n        this.decisionKey = decisionKey;\n        return this;\n    }\n\n    @Override\n    public DmnHistoricDecisionExecutionQuery instanceId(String instanceId) {\n        if (instanceId == null) {\n            throw new FlowableIllegalArgumentException(\"instanceId is null\");\n        }\n        this.instanceId = instanceId;\n        return this;\n    }\n    \n    @Override\n    public DmnHistoricDecisionExecutionQuery executionId(String executionId) {\n        if (executionId == null) {\n            throw new FlowableIllegalArgumentException(\"executionId is null\");","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/HistoricDecisionExecutionQueryImpl.java#L81-L117","documentation":"HistoricDecisionExecutionQueryImpl.decisionKey(String) throws FlowableIllegalArgumentException when the decisionKey argument is null. The key criterion is directly translated into a database filter, so Flowable requires a non-null string and throws FlowableIllegalArgumentException in the builder method.","triggerScenarios":"Calling dmnHistoryService.createHistoricDecisionExecutionQuery().decisionKey(null), usually when the key is read from a decision reference, config property, or process variable that is unset.","commonSituations":"Analytics on decision executions per decision key where the key mapping is stale after a model rename; dynamically driven reports with an optional key filter; tests that query before the decision was ever evaluated with the expected key.","solutions":["Pass the actual decision key from the deployed DMN model","Chain decisionKey(...) only when the key is non-null; otherwise omit the filter","Validate the source (config/variable) returns the expected key before building the query"],"exampleFix":"// before\nquery.decisionKey(processVars.get(\"decisionKey\")); // variable may be unset\n// after\nString key = (String) processVars.get(\"decisionKey\");\nif (key != null) {\n    query.decisionKey(key);\n}","handlingStrategy":"validation","validationCode":"if (decisionKey == null || decisionKey.isEmpty()) { throw new IllegalArgumentException(\"decisionKey must be non-null\"); }","typeGuard":"boolean hasDecisionKey(String key) { return key != null && !key.isBlank(); }","tryCatchPattern":"try { query.decisionKey(key); } catch (FlowableIllegalArgumentException e) { log.warn(\"decisionKey filter skipped: {}\", e.getMessage()); }","preventionTips":["Update key mappings when decision tables are renamed; validate keys against the deployed model","Cast process variables defensively and null-check before using them as query criteria"],"tags":["flowable","dmn","history","query","null-check"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}