{"record":{"id":"6a5f79de3f2eedad","repo":"flowable/flowable-engine","slug":"status-is-null-6a5f79","errorCode":null,"errorMessage":"status is null","messagePattern":"status is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchPartQueryImpl.java","lineNumber":139,"sourceCode":"            throw new FlowableIllegalArgumentException(\"batchSearchKey is null\");\n        }\n        this.batchSearchKey = searchKey;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery batchSearchKey2(String searchKey2) {\n        if (searchKey2 == null) {\n            throw new FlowableIllegalArgumentException(\"batchSearchKey2 is null\");\n        }\n        this.batchSearchKey2 = searchKey2;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery status(String status) {\n        if (status == null) {\n            throw new FlowableIllegalArgumentException(\"status is null\");\n        }\n        this.status = status;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery scopeId(String scopeId) {\n        if (scopeId == null) {\n            throw new FlowableIllegalArgumentException(\"scopeId is null\");\n        }\n        this.scopeId = scopeId;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery subScopeId(String subScopeId) {\n        if (subScopeId == null) {\n            throw new FlowableIllegalArgumentException(\"subScopeId is null\");","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchPartQueryImpl.java#L121-L157","documentation":"BatchPartQueryImpl.status() throws FlowableIllegalArgumentException when the status filter value is null. The Flowable query API validates each fluent setter argument eagerly so that invalid queries fail at construction time instead of producing broken SQL at listPage()/singleResult() time. A null status cannot be matched against the batch part STATUS_ column, so it is rejected outright.","triggerScenarios":"Calling batchPartQuery().status(null) directly, or passing a variable/field that is null (e.g. status resolved from a request parameter or enum lookup that returned null).","commonSituations":"REST/API layers binding an optional 'status' query parameter into the Flowable query without a null check; refactors where a status constant was removed or renamed leaving the lookup null.","solutions":["Pass a non-null status string, e.g. 'ready' or 'failed', matching values stored in FLW_EV_BATCH_PART.STATUS_","Guard the call: only invoke .status(...) when the value is non-null","If you intended no filter, simply omit the .status(...) call instead of passing null"],"exampleFix":"// before\nquery.status(myStatus); // myStatus may be null\n// after\nif (myStatus != null) {\n    query.status(myStatus);\n}","handlingStrategy":"validation","validationCode":"if (status == null) {\n    throw new IllegalArgumentException(\"status must be non-null before calling BatchPartQuery.status()\");\n}\nquery.status(status);","typeGuard":"boolean hasStatus(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try {\n    query.status(status);\n} catch (FlowableIllegalArgumentException e) {\n    // fall back to unfiltered query or rethrow with context\n}","preventionTips":["Never chain .status(null); conditionally apply filters","Validate query-parameter DTOs before building Flowable queries","Treat 'no filter' as 'omit the setter', not 'pass null'"],"tags":["java","flowable","null-check","query-api"],"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"}