flowable/flowable-engine · error · FlowableIllegalArgumentException

Provided batch type is null

Error message

Provided batch type is null

What it means

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.

Solutions

  1. Pass a valid registered batch type string
  2. Guard the setter call when the type is optional
  3. Resolve the type via BatchServiceConfiguration registered handlers and handle unknown types before querying

Example fix

// before
query.batchType(typeName); // typeName may be null
// after
if (typeName != null) {
    query.batchType(typeName);
} else {
    throw new IllegalArgumentException("Unknown batch type key");
}
Defensive patterns

Strategy: validation

Validate before calling

if (batchType == null) {
    throw new IllegalArgumentException("batchType must be resolved before querying");
}
query.batchType(batchType);

Type guard

boolean hasBatchType(String t) { return t != null && !t.isEmpty(); }

Try / catch

try {
    query.batchType(batchType);
} catch (FlowableIllegalArgumentException e) {
    throw new IllegalStateException("Unknown batch type key: " + typeKey, e);
}

Prevention

When it happens

Trigger: 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).

Common situations: Generic batch maintenance tooling driven by a configurable type name that is missing in configuration; typos in batch type constants resolved via map lookup.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/f9047f1cbae7dab3. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchQueryImpl.java:77

    public BatchQueryImpl(CommandExecutor commandExecutor, BatchServiceConfiguration batchServiceConfiguration) {
        super(commandExecutor);
        this.batchServiceConfiguration = batchServiceConfiguration;
    }

    @Override
    public BatchQuery batchId(String batchId) {
        if (batchId == null) {
            throw new FlowableIllegalArgumentException("Provided batch id is null");
        }
        this.id = batchId;
        return this;
    }

    @Override
    public BatchQuery batchType(String batchType) {
        if (batchType == null) {
            throw new FlowableIllegalArgumentException("Provided batch type is null");
        }
        this.batchType = batchType;
        return this;
    }

    @Override
    public BatchQuery batchTypes(Collection<String> batchTypes) {
        if (batchTypes == null || batchTypes.isEmpty()) {
            throw new FlowableIllegalArgumentException("Provided batch types must be provided and not empty");
        }
        this.batchTypes = batchTypes;
        return this;
    }

    @Override
    public BatchQuery searchKey(String searchKey) {
        if (searchKey == null) {
            throw new FlowableIllegalArgumentException("Provided search key is null");

View on GitHub (pinned to d6d39ce1c6)