{"record":{"id":"6c9ac139bf8c4239","repo":"flowable/flowable-engine","slug":"decisiondefinitionid-is-null","errorCode":null,"errorMessage":"decisionDefinitionId is null","messagePattern":"decisionDefinitionId 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":81,"sourceCode":"        super(commandExecutor);\n    }\n\n    @Override\n    public DmnHistoricDecisionExecutionQuery id(String id) {\n        this.id = id;\n        return this;\n    }\n\n    @Override\n    public DmnHistoricDecisionExecutionQuery ids(Set<String> ids) {\n        this.ids = ids;\n        return this;\n    }\n\n    @Override\n    public DmnHistoricDecisionExecutionQuery decisionDefinitionId(String decisionDefinitionId) {\n        if (decisionDefinitionId == null) {\n            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\");","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/HistoricDecisionExecutionQueryImpl.java#L63-L99","documentation":"HistoricDecisionExecutionQueryImpl.decisionDefinitionId(String) throws FlowableIllegalArgumentException when the id argument is null. Historic DMN decision execution queries validate every filter id at the builder call; a null decision definition id would produce an invalid or overly broad query, so it is rejected immediately.","triggerScenarios":"Calling dmnHistoryService.createHistoricDecisionExecutionQuery().decisionDefinitionId(null), usually when the definition id comes from an unresolved variable, a failed repository lookup, or an optional request parameter.","commonSituations":"Auditing dashboards that filter by decision definition where the definition was undeployed or its id was never captured; passing the result of a definition query by key that matched nothing; refactors that changed id sources.","solutions":["Resolve the decision definition id first via dmnRepositoryService.createDecisionDefinitionQuery() and confirm it is non-null","Only apply decisionDefinitionId(...) when a valid id is available; otherwise omit the filter","Add an explicit null guard at the call site with a domain-level error message"],"exampleFix":"// before\nquery.decisionDefinitionId(definition.getId()); // getId() may be null\n// after\nDecisionDefinition def = repoService.createDecisionDefinitionQuery()\n    .decisionDefinitionKey(key).singleResult();\nif (def != null) {\n    query.decisionDefinitionId(def.getId());\n}","handlingStrategy":"validation","validationCode":"if (decisionDefinitionId == null) { throw new IllegalArgumentException(\"decisionDefinitionId must be resolved before querying history\"); }","typeGuard":"boolean hasDefinitionId(DecisionDefinition d) { return d != null && d.getId() != null; }","tryCatchPattern":"try { query.decisionDefinitionId(defId); } catch (FlowableIllegalArgumentException e) { throw new IllegalStateException(\"Unknown decision definition: \" + defId, e); }","preventionTips":["Resolve definition ids via DecisionDefinitionQuery first and check singleResult() for null","Do not cache definition ids across redeployments; look them up at query time"],"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"}