{"record":{"id":"dd6de8dcdaafefc4","repo":"flowable/flowable-engine","slug":"failed-is-null","errorCode":null,"errorMessage":"failed is null","messagePattern":"failed 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":162,"sourceCode":"        return this;\n    }\n\n    @Override\n    public DmnHistoricDecisionExecutionQuery processInstanceIdWithChildren(String processInstanceId) {\n        this.processInstanceIdWithChildren = processInstanceId;\n        return this;\n    }\n\n    @Override\n    public DmnHistoricDecisionExecutionQuery caseInstanceIdWithChildren(String caseInstanceId) {\n        this.caseInstanceIdWithChildren = caseInstanceId;\n        return this;\n    }\n    \n    @Override\n    public DmnHistoricDecisionExecutionQuery failed(Boolean failed) {\n        if (failed == null) {\n            throw new FlowableIllegalArgumentException(\"failed is null\");\n        }\n        this.failed = failed;\n        return this;\n    }\n\n    @Override\n    public DmnHistoricDecisionExecutionQuery tenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"tenantId is null\");\n        }\n        this.tenantId = tenantId;\n        return this;\n    }\n\n    @Override\n    public DmnHistoricDecisionExecutionQuery tenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new FlowableIllegalArgumentException(\"tenantId is null\");","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/HistoricDecisionExecutionQueryImpl.java#L144-L180","documentation":"FlowableIllegalArgumentException thrown by DmnHistoricDecisionExecutionQuery.failed(Boolean) when the failed flag is passed as null. Since the filter is a Boolean tri-state, the library forces callers to explicitly choose true, false, or to not call the method at all, rather than silently treating null as 'no filter'.","triggerScenarios":"Calling .failed(null) on a DmnHistoricDecisionExecutionQuery, often when the flag is sourced from an unset Boolean variable, an absent map/config entry, or a wrapper Boolean that failed autoboxing initialization.","commonSituations":"Passing a java.lang.Boolean field that was never assigned (defaults to null); binding the flag from an optional request parameter without a default; generic builder-helper code that forwards a possibly-null Boolean unconditionally.","solutions":["Pass Boolean.TRUE or Boolean.FALSE explicitly to filter for failed or successful executions.","If both failed and successful executions should be returned, omit the failed() call.","Add a null check or default (e.g. Boolean.TRUE.equals(flag)) before calling failed()."],"exampleFix":"// before\nquery.failed(Boolean.parseBoolean(cfg.get(\"failed\")) ? Boolean.TRUE : null);\n// after\nif (cfg.containsKey(\"failed\")) {\n    query.failed(Boolean.parseBoolean(cfg.get(\"failed\")));\n}","handlingStrategy":"validation","validationCode":"if (failed != null) { query.failed(failed); } // or require an explicit true/false up front","typeGuard":"boolean isExplicitBoolean(Boolean b) { return b != null; }","tryCatchPattern":"try {\n    query.failed(failed);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"failed filter skipped: {}\", e.getMessage());\n}","preventionTips":["Use primitive boolean or default to Boolean.FALSE when the intent is known.","Treat failed() as opt-in: only call it when filtering by outcome.","Null-check wrapper Booleans sourced from maps/config before use."],"tags":["flowable","dmn","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-18T11:17:12.947Z"}