{"record":{"id":"973ed646fb3bf549","repo":"flowable/flowable-engine","slug":"business-status-is-null-973ed6","errorCode":null,"errorMessage":"Business status is null","messagePattern":"Business status is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessInstanceQueryImpl.java","lineNumber":226,"sourceCode":"            this.businessKeyLike = businessKeyLike;\n        }\n        return this;\n    }\n    \n    @Override\n    public ProcessInstanceQuery processInstanceBusinessKeyLikeIgnoreCase(String businessKeyLikeIgnoreCase) {\n        if (inOrStatement) {\n            this.currentOrQueryObject.businessKeyLikeIgnoreCase = businessKeyLikeIgnoreCase;\n        } else {\n            this.businessKeyLikeIgnoreCase = businessKeyLikeIgnoreCase;\n        }\n        return this;\n    }\n    \n    @Override\n    public ProcessInstanceQuery processInstanceBusinessStatus(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 ProcessInstanceQuery processInstanceBusinessStatusLike(String businessStatusLike) {\n        if (inOrStatement) {\n            this.currentOrQueryObject.businessStatusLike = businessStatusLike;\n        } else {\n            this.businessStatusLike = businessStatusLike;\n        }\n        return this;\n    }","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessInstanceQueryImpl.java#L208-L244","documentation":"processInstanceBusinessStatus(String) throws FlowableIllegalArgumentException when businessStatus is null. Query criteria setters validate their argument so the query fails fast at build time. A null criterion must be expressed by omitting the setter call, not by passing null.","triggerScenarios":"Calling processInstanceBusinessStatus(null), typically with a variable or request parameter that was never set.","commonSituations":"An optional filter field in a search UI passed straight through; a process variable/entity attribute that is null because the business status was never recorded; migrating code where the field was added later and older data lacks it.","solutions":["Only call processInstanceBusinessStatus when the value is non-null, building the query conditionally.","Populate the business status upstream (ensure startProcessInstanceBy... businessStatus or the runtime data actually sets it).","If no filtering is intended, drop the call."],"exampleFix":"// before\nquery.processInstanceBusinessStatus(businessStatus);\n// after\nif (businessStatus != null) {\n    query.processInstanceBusinessStatus(businessStatus);\n}","handlingStrategy":"validation","validationCode":"if (businessStatus == null) {\n    throw new IllegalArgumentException(\"businessStatus must be non-null when filtering by business status\");\n}","typeGuard":"boolean hasBusinessStatus(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try {\n    query.processInstanceBusinessStatus(businessStatus);\n} catch (FlowableIllegalArgumentException e) {\n    if (!e.getMessage().contains(\"Business status is null\")) throw e;\n    log.debug(\"businessStatus absent; query unfiltered by status\");\n}","preventionTips":["Guard optional business-status filters before applying them.","Ensure process starts actually set businessStatus if the query depends on it.","Treat 'no filter' as 'don't call the setter', never as null."],"tags":["flowable","null-check","query-api","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"}