{"record":{"id":"269f99ab2115acf9","repo":"flowable/flowable-engine","slug":"business-status-is-null-269f99","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/runtime/CaseInstanceQueryImpl.java","lineNumber":464,"sourceCode":"    }\n    \n    @Override\n    public CaseInstanceQueryImpl caseInstanceBusinessKeyLikeIgnoreCase(String businessKeyLikeIgnoreCase) {\n        if (businessKeyLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"Business key is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.businessKeyLikeIgnoreCase = businessKeyLikeIgnoreCase;\n        } else {\n            this.businessKeyLikeIgnoreCase = businessKeyLikeIgnoreCase;\n        }\n        return this;\n    }\n    \n    @Override\n    public CaseInstanceQueryImpl 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 CaseInstanceQueryImpl 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":446,"sourceCodeEnd":482,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java#L446-L482","documentation":"Flowable's CaseInstanceQueryImpl throws FlowableIllegalArgumentException when caseInstanceBusinessStatus(String) is called with null. The business status is a user-managed state string on case instances (set via setBusinessStatus); filtering by a null status is rejected up front because it would not be a valid query condition. Pass a concrete status string.","triggerScenarios":"Calling caseInstanceBusinessKeyStatus alias caseInstanceBusinessStatus(null); forwarding an optional status filter from a request/DTO that was not provided; using a variable expected to hold the status that was never initialized.","commonSituations":"Dashboards filtering by business status where the status dropdown default is null; refactoring between businessKey and businessStatus methods and passing the wrong (null) field; older data model code where businessStatus was not yet tracked.","solutions":["Null-check the status before calling; only apply the criterion when a status is present","If 'any status' is intended, omit the criterion rather than passing null","Validate that the status value is one your application actually sets on case instances","Populate the status source (form/config) or make it a required API parameter"],"exampleFix":"// before\nquery.caseInstanceBusinessStatus(statusFilter); // may be null\n// after\nif (statusFilter != null) {\n    query.caseInstanceBusinessStatus(statusFilter);\n}","handlingStrategy":"validation","validationCode":"if (businessStatus == null) {\n    return query; // no status filter\n}\nquery.caseInstanceBusinessStatus(businessStatus);","typeGuard":"boolean hasText(String s) {\n    return s != null && !s.trim().isEmpty();\n}","tryCatchPattern":"try {\n    query.caseInstanceBusinessStatus(businessStatus);\n} catch (FlowableIllegalArgumentException e) {\n    throw new ResponseStatusException(HttpStatus.BAD_REQUEST, \"businessStatus filter must not be null\");\n}","preventionTips":["Only apply the business status criterion when a status value exists","Omit the filter entirely when 'any status' is desired","Keep businessKey and businessStatus parameters clearly separated","Ensure status values match what your application sets via setBusinessStatus"],"tags":["flowable","cmmn","query","null-check","business-status"],"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"}