{"record":{"id":"bf912aa406c28329","repo":"flowable/flowable-engine","slug":"provided-status-is-null","errorCode":null,"errorMessage":"Provided status is null","messagePattern":"Provided status is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchQueryImpl.java","lineNumber":149,"sourceCode":"            throw new FlowableIllegalArgumentException(\"Provided date is null\");\n        }\n        this.completeTimeHigherThan = date;\n        return this;\n    }\n\n    @Override\n    public BatchQuery completeTimeLowerThan(Date date) {\n        if (date == null) {\n            throw new FlowableIllegalArgumentException(\"Provided date is null\");\n        }\n        this.completeTimeLowerThan = date;\n        return this;\n    }\n    \n    @Override\n    public BatchQuery status(String status) {\n        if (status == null) {\n            throw new FlowableIllegalArgumentException(\"Provided status is null\");\n        }\n        this.status = status;\n        return this;\n    }\n    \n    @Override\n    public BatchQuery tenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided tenant id is null\");\n        }\n        this.tenantId = tenantId;\n        return this;\n    }\n\n    @Override\n    public BatchQuery tenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new FlowableIllegalArgumentException(\"Provided tenant id is null\");","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchQueryImpl.java#L131-L167","documentation":"Fluent-setter validation in BatchQueryImpl.status: the REST/service query builder rejects a null status filter because it would be indistinguishable from 'not set'. Callers filtering batches by status must supply a non-null status string.","triggerScenarios":"Calling BatchService.createBatchQuery().status(null).","commonSituations":"Mapping an optional status filter from an API request where 'all statuses' is represented as null instead of skipping the filter.","solutions":["Null-check the status string before calling status()","Only apply the filter when a concrete status is chosen","Use Batch's defined status constants rather than raw nullable strings"],"exampleFix":"// before\nquery.status(request.getStatus());\n// after\nif (request.getStatus() != null) {\n    query.status(request.getStatus());\n}","handlingStrategy":"validation","validationCode":"if (status != null) {\n    query.status(status);\n}","typeGuard":null,"tryCatchPattern":"try {\n    query.status(status);\n} catch (FlowableIllegalArgumentException e) {\n    // treat as 'all statuses'\n}","preventionTips":["Use enum/constant sets for batch statuses and validate input against them","Skip optional filters instead of passing null"],"tags":["java","flowable","null-check","query"],"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"}