{"record":{"id":"6f4aabfe99597d0c","repo":"flowable/flowable-engine","slug":"business-status-is-null","errorCode":null,"errorMessage":"Business status is null","messagePattern":"Business status is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java","lineNumber":461,"sourceCode":"    }\n\n    @Override\n    public HistoricCaseInstanceQuery caseInstanceParentScopeIds(Set<String> parentScopeIds) {\n        if (parentScopeIds == null || parentScopeIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"parentScopeIds is null or empty\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.parentScopeIds = parentScopeIds;\n        } else {\n            this.parentScopeIds = parentScopeIds;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricCaseInstanceQueryImpl caseInstanceBusinessStatus(String businessStatus) {\n        if (businessStatus == null) {\n            throw new FlowableIllegalArgumentException(\"Business status is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.businessStatus = businessStatus;\n        } else {\n            this.businessStatus = businessStatus;\n        }\n        return this;\n    }\n    \n    @Override\n    public HistoricCaseInstanceQueryImpl caseInstanceBusinessStatusLike(String businessStatusLike) {\n        if (businessStatusLike == null) {\n            throw new FlowableIllegalArgumentException(\"Business status is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.businessStatusLike = businessStatusLike;\n        } else {\n            this.businessStatusLike = businessStatusLike;","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java#L443-L479","documentation":"HistoricCaseInstanceQueryImpl.caseInstanceBusinessStatus() rejects a null business status string up front. A null value would produce an invalid equality predicate in the generated SQL, so Flowable throws FlowableIllegalArgumentException immediately instead of deferring failure to query execution. To clear a business status filter, build a fresh query rather than passing null.","triggerScenarios":"Calling historicCaseInstanceQuery.caseInstanceBusinessStatus(null), including inside an or() compound where the value is stored on the currentOrQueryObject only after this null check passes.","commonSituations":"Mapping a REST/GraphQL request field (optional businessStatus) directly into the query; deserialization leaves the field null when the client omitted it, and the code forwards it unconditionally.","solutions":["Pass a non-null business status string, e.g. caseInstanceBusinessStatus(\"approved\").","Skip the call when the value is null so no business-status filter is applied.","Default null to a sentinel or use a builder pattern that only applies set filters.","Catch FlowableIllegalArgumentException and surface a client-side validation message."],"exampleFix":"// before\nquery.caseInstanceBusinessStatus(request.getBusinessStatus());\n// after\nif (request.getBusinessStatus() != null) {\n    query.caseInstanceBusinessStatus(request.getBusinessStatus());\n}","handlingStrategy":"validation","validationCode":"if (businessStatus != null) {\n    query.caseInstanceBusinessStatus(businessStatus);\n}","typeGuard":"boolean hasText(String s) {\n    return s != null && !s.isBlank();\n}","tryCatchPattern":"try {\n    query.caseInstanceBusinessStatus(status);\n} catch (FlowableIllegalArgumentException e) {\n    throw new InvalidRequestException(\"businessStatus is required: \" + e.getMessage());\n}","preventionTips":["Guard every optional string filter with a null check before the setter call","Treat blank strings as 'no filter' and normalize input early","Never forward deserialized request fields straight into query setters","Cover optional-filter paths with unit tests"],"tags":["flowable","cmmn","query","null-argument","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-14T05:17:10.506Z"}