flowable/flowable-engine · error · FlowableIllegalArgumentException

tenantIdLike is null

Error message

tenantIdLike is null

What it means

BatchPartQueryImpl.tenantIdLike() throws FlowableIllegalArgumentException when the tenantIdLike argument is null. The like-filter value must be a non-null SQL LIKE pattern; null is rejected at setter time instead of being turned into invalid SQL.

Source

Thrown at modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchPartQueryImpl.java:184

            throw new FlowableIllegalArgumentException("scopeType is null");
        }
        this.scopeType = scopeType;
        return this;
    }

    @Override
    public BatchPartQuery tenantId(String tenantId) {
        if (tenantId == null) {
            throw new FlowableIllegalArgumentException("tenantId is null");
        }
        this.tenantId = tenantId;
        return this;
    }

    @Override
    public BatchPartQuery tenantIdLike(String tenantIdLike) {
        if (tenantIdLike == null) {
            throw new FlowableIllegalArgumentException("tenantIdLike is null");
        }
        this.tenantIdLike = tenantIdLike;
        return this;
    }

    @Override
    public BatchPartQuery withoutTenantId() {
        this.withoutTenantId = true;
        return this;
    }

    @Override
    public BatchPartQuery completed() {
        this.completed = true;
        return this;
    }

    @Override

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass a non-null LIKE pattern, e.g. "myTenant%"
  2. Skip .tenantIdLike(...) when no like-filter is desired
  3. Ensure the pattern source (config/input) is validated before building the query

Example fix

// before
query.tenantIdLike(prefix + "%"); // prefix may be null -> "null%"
// after
if (prefix != null) {
    query.tenantIdLike(prefix + "%");
}
Defensive patterns

Strategy: validation

Validate before calling

if (tenantIdLike == null) {
    throw new IllegalArgumentException("tenantIdLike pattern must be non-null");
}
query.tenantIdLike(tenantIdLike);

Type guard

boolean hasLikePattern(String p) { return p != null && !p.isEmpty(); }

Try / catch

try {
    query.tenantIdLike(pattern);
} catch (FlowableIllegalArgumentException e) {
    logger.warn("tenantIdLike pattern was null; using unfiltered query");
}

Prevention

When it happens

Trigger: Calling batchPartQuery().tenantIdLike(null), or building a pattern via String concatenation where the prefix variable is null.

Common situations: Dynamic tenant-prefix searches where the prefix configuration is missing; string patterns assembled from null user input.

Related errors


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