flowable/flowable-engine · error · FlowableIllegalArgumentException

Provided tokenDataLike is null

Error message

Provided tokenDataLike is null

What it means

TokenQueryImpl.tokenDataLike(String) adds a LIKE criterion on token data. Null arguments throw FlowableIllegalArgumentException at query-build time because a null pattern cannot form a valid SQL LIKE clause and would be ambiguous with no filtering.

Solutions

  1. Pass a non-null pattern, e.g. "%abc%".
  2. Only invoke tokenDataLike when the filter value is non-null.
  3. Omit the criterion to match all token data.

Example fix

// before
TokenQuery q = identityService.createTokenQuery().tokenDataLike(filter.tokenDataLike);

// after
TokenQuery q = identityService.createTokenQuery();
if (filter.tokenDataLike != null) {
    q = q.tokenDataLike("%" + filter.tokenDataLike + "%");
}
Defensive patterns

Strategy: validation

Validate before calling

if (tokenDataLike == null) { tokenDataLike = "%"; } // or skip the call
identityService.createTokenQuery().tokenDataLike(tokenDataLike);

Type guard

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

Try / catch

try {
    query.tokenDataLike(pattern);
} catch (FlowableIllegalArgumentException e) {
    if (e.getMessage().contains("tokenDataLike is null")) { /* skip criterion */ } else { throw e; }
}

Prevention

When it happens

Trigger: Calling TokenQuery.tokenDataLike(null) as part of a createTokenQuery() chain with a null optional filter value.

Common situations: Search endpoints where tokenDataLike is an optional parameter; DTO mapping leaving the field null; uniform application of all criteria without null-guards.

Related errors


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

Appendix: source

Thrown at modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java:182

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

    @Override
    public TokenQuery tokenData(String tokenData) {
        if (tokenData == null) {
            throw new FlowableIllegalArgumentException("Provided token data is null");
        }
        this.tokenData = tokenData;
        return this;
    }

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

    // sorting //////////////////////////////////////////////////////////

    @Override
    public TokenQuery orderByTokenId() {
        return orderBy(TokenQueryProperty.TOKEN_ID);
    }

    @Override
    public TokenQuery orderByTokenDate() {
        return orderBy(TokenQueryProperty.TOKEN_DATE);
    }

    // results //////////////////////////////////////////////////////////

View on GitHub (pinned to d6d39ce1c6)