{"record":{"id":"f9047f1cbae7dab3","repo":"flowable/flowable-engine","slug":"provided-batch-type-is-null","errorCode":null,"errorMessage":"Provided batch type is null","messagePattern":"Provided batch type 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":77,"sourceCode":"\n    public BatchQueryImpl(CommandExecutor commandExecutor, BatchServiceConfiguration batchServiceConfiguration) {\n        super(commandExecutor);\n        this.batchServiceConfiguration = batchServiceConfiguration;\n    }\n\n    @Override\n    public BatchQuery batchId(String batchId) {\n        if (batchId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided batch id is null\");\n        }\n        this.id = batchId;\n        return this;\n    }\n\n    @Override\n    public BatchQuery batchType(String batchType) {\n        if (batchType == null) {\n            throw new FlowableIllegalArgumentException(\"Provided batch type is null\");\n        }\n        this.batchType = batchType;\n        return this;\n    }\n\n    @Override\n    public BatchQuery batchTypes(Collection<String> batchTypes) {\n        if (batchTypes == null || batchTypes.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Provided batch types must be provided and not empty\");\n        }\n        this.batchTypes = batchTypes;\n        return this;\n    }\n\n    @Override\n    public BatchQuery searchKey(String searchKey) {\n        if (searchKey == null) {\n            throw new FlowableIllegalArgumentException(\"Provided search key is null\");","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchQueryImpl.java#L59-L95","documentation":"BatchQueryImpl.batchType() throws FlowableIllegalArgumentException with message 'Provided batch type is null' when the type argument is null. Batch types (e.g. 'search-indexing', 'delete-anything') are non-null equality filters validated at setter time.","triggerScenarios":"Calling createBatchQuery().batchType(null), or forwarding a batch type constant that failed to resolve (e.g. a handler registry returned null for an unknown type key).","commonSituations":"Generic batch maintenance tooling driven by a configurable type name that is missing in configuration; typos in batch type constants resolved via map lookup.","solutions":["Pass a valid registered batch type string","Guard the setter call when the type is optional","Resolve the type via BatchServiceConfiguration registered handlers and handle unknown types before querying"],"exampleFix":"// before\nquery.batchType(typeName); // typeName may be null\n// after\nif (typeName != null) {\n    query.batchType(typeName);\n} else {\n    throw new IllegalArgumentException(\"Unknown batch type key\");\n}","handlingStrategy":"validation","validationCode":"if (batchType == null) {\n    throw new IllegalArgumentException(\"batchType must be resolved before querying\");\n}\nquery.batchType(batchType);","typeGuard":"boolean hasBatchType(String t) { return t != null && !t.isEmpty(); }","tryCatchPattern":"try {\n    query.batchType(batchType);\n} catch (FlowableIllegalArgumentException e) {\n    throw new IllegalStateException(\"Unknown batch type key: \" + typeKey, e);\n}","preventionTips":["Keep batch type constants in one enum/constant class","Fail fast when a type-name lookup returns null instead of forwarding it","Validate configurable batch type names at startup"],"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-18T11:17:12.947Z"}