flowable/flowable-engine · error · FlowableIllegalArgumentException

Provided first name is null

Error message

Provided first name is null

What it means

UserQueryImpl.userFirstName(String) filters users by exact first name. Passing null throws FlowableIllegalArgumentException because null is not a valid equality criterion for the generated query. The library fails fast when the criterion is added, before hitting the database.

Solutions

  1. Pass a non-null first name value.
  2. Add the criterion only when the search field is non-null/empty.
  3. Treat empty strings deliberately: convert empty form fields to null at the boundary and then skip the criterion.

Example fix

// before
UserQuery q = identityService.createUserQuery().userFirstName(search.getFirstName());

// after
UserQuery q = identityService.createUserQuery();
if (search.getFirstName() != null && !search.getFirstName().isEmpty()) {
    q = q.userFirstName(search.getFirstName());
}
Defensive patterns

Strategy: validation

Validate before calling

if (firstName != null && !firstName.isEmpty()) {
    query = query.userFirstName(firstName);
}

Type guard

boolean hasSearchValue(String v) { return v != null && !v.trim().isEmpty(); }

Try / catch

try {
    query.userFirstName(firstName);
} catch (FlowableIllegalArgumentException e) {
    if (e.getMessage().contains("first name is null")) { /* skip criterion */ } else { throw e; }
}

Prevention

When it happens

Trigger: Calling UserQuery.userFirstName(null), commonly in a dynamic user search where the first-name filter field was empty and mapped to null.

Common situations: Search forms with optional name fields; REST query parameters absent from the request; code applying every criterion unconditionally instead of skipping unset ones.

Related errors


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

Appendix: source

Thrown at modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/UserQueryImpl.java:96

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

    @Override
    public UserQuery userIdIgnoreCase(String id) {
        if (id == null) {
            throw new FlowableIllegalArgumentException("Provided id is null");
        }
        this.idIgnoreCase = id.toLowerCase();
        return this;
    }

    @Override
    public UserQuery userFirstName(String firstName) {
        if (firstName == null) {
            throw new FlowableIllegalArgumentException("Provided first name is null");
        }
        this.firstName = firstName;
        return this;
    }

    @Override
    public UserQuery userFirstNameLike(String firstNameLike) {
        if (firstNameLike == null) {
            throw new FlowableIllegalArgumentException("Provided first name is null");
        }
        this.firstNameLike = firstNameLike;
        return this;
    }

    @Override
    public UserQuery userFirstNameLikeIgnoreCase(String firstNameLikeIgnoreCase) {
        if (firstNameLikeIgnoreCase == null) {
            throw new FlowableIllegalArgumentException("Provided first name is null");

View on GitHub (pinned to d6d39ce1c6)