flowable/flowable-engine · error · FlowableIllegalArgumentException

Name like is null

Error message

Name like is null

What it means

Flowable throws FlowableIllegalArgumentException from CaseInstanceQueryImpl.caseInstanceNameLike(String) when the like pattern is null. Validation is immediate, keeping null out of the SQL layer. A null pattern means 'no filter', so the correct fix is to not call the method rather than pass null.

Solutions

  1. Guard the call: if (nameLike != null) query.caseInstanceNameLike(nameLike)
  2. Skip null entries in any generic filter-mapping utility before invoking criteria methods
  3. Use caseInstanceName for exact matches when the full name is available
  4. Catch FlowableIllegalArgumentException and surface a client-facing validation message

Example fix

// before
query.caseInstanceNameLike(search.getNameLike());
// after
if (search.getNameLike() != null) {
    query.caseInstanceNameLike(search.getNameLike());
}
Defensive patterns

Strategy: validation

Validate before calling

if (nameLike != null) { query.caseInstanceNameLike(nameLike); }

Type guard

boolean hasPattern = (p instanceof String s) && !s.isEmpty();

Try / catch

try { query.caseInstanceNameLike(pattern); } catch (FlowableIllegalArgumentException e) { throw new BadRequestException("nameLike must not be null"); }

Prevention

When it happens

Trigger: Calling createCaseInstanceQuery().caseInstanceNameLike(null), typically from an empty/absent 'name contains' search input forwarded as null.

Common situations: Search endpoints with optional pattern fields; generic filter-map-to-query builders that don't skip null entries; version upgrades where previously tolerated nulls now throw.

Related errors


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

Appendix: source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java:347

    }

    @Override
    public CaseInstanceQuery caseInstanceName(String name) {
        if (name == null) {
            throw new FlowableIllegalArgumentException("Name is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.name = name;
        } else {
            this.name = name;
        }
        return this;
    }

    @Override
    public CaseInstanceQuery caseInstanceNameLike(String nameLike) {
        if (nameLike == null) {
            throw new FlowableIllegalArgumentException("Name like is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.nameLike = nameLike;
        } else {
            this.nameLike = nameLike;
        }
        return this;
    }

    @Override
    public CaseInstanceQuery caseInstanceNameLikeIgnoreCase(String nameLikeIgnoreCase) {
        if (nameLikeIgnoreCase == null) {
            throw new FlowableIllegalArgumentException("Name like ignore case is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.nameLikeIgnoreCase = nameLikeIgnoreCase;
        } else {
            this.nameLikeIgnoreCase = nameLikeIgnoreCase;

View on GitHub (pinned to d6d39ce1c6)