flowable/flowable-engine · error · FlowableIllegalArgumentException

form tenantId is null

Error message

form tenantId is null

What it means

EventDefinitionQueryImpl.tenantId sets an exact tenant filter on the event definition query. It throws FlowableIllegalArgumentException when tenantId is null; the message says 'form tenantId is null' (copied from the form module, but the check applies to the event definition tenantId).

Source

Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/EventDefinitionQueryImpl.java:261

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

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

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

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

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

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass the actual tenant id string the definitions were deployed with
  2. If the tenant is unknown, omit the tenantId filter instead of passing null
  3. Fix tenant resolution so a valid tenant id is available before querying

Example fix

// before
query.tenantId(currentTenant); // currentTenant may be null
// after
if (currentTenant != null) {
    query.tenantId(currentTenant);
}
Defensive patterns

Strategy: validation

Validate before calling

if (tenantId == null || tenantId.isEmpty()) { throw new IllegalArgumentException("tenantId must be resolved before calling tenantId()"); }

Type guard

boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }

Try / catch

try { query.tenantId(tenant); } catch (FlowableIllegalArgumentException e) { log.warn("tenant null, running unfiltered query"); }

Prevention

When it happens

Trigger: Calling tenantId(null) on the EventDefinitionQuery, usually because a tenant resolver returned null in a multi-tenant setup.

Common situations: Multi-tenant apps where the current tenant is not resolved (no tenant header/context), default-tenant configuration missing, calling the query outside a tenant-aware context.

Related errors


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