flowable/flowable-engine · error · FlowableIllegalArgumentException

Name is null

Error message

Name is null

What it means

Flowable throws FlowableIllegalArgumentException from CaseInstanceQueryImpl.caseInstanceName(String) when the case instance name is null. As with all criteria methods, null is not a valid filter value and is rejected at query-build time. If the name filter is optional, conditionally apply it.

Solutions

  1. Apply the criterion conditionally: if (name != null) query.caseInstanceName(name)
  2. Use caseInstanceNameLike / caseInstanceNameLikeIgnoreCase (with a non-null pattern) for partial matching needs
  3. Default absent input to a skip-flag in your filter mapping layer rather than null
  4. Catch FlowableIllegalArgumentException to return a clear validation error to API consumers

Example fix

// before
query.caseInstanceName(filter.getName()); // null if not provided
// after
if (filter.getName() != null) {
    query.caseInstanceName(filter.getName());
}
Defensive patterns

Strategy: validation

Validate before calling

if (name != null) { query.caseInstanceName(name); }

Type guard

boolean hasName = (n instanceof String s) && !s.isEmpty();

Try / catch

try { query.caseInstanceName(name); } catch (FlowableIllegalArgumentException e) { throw new BadRequestException("caseInstanceName must not be null"); }

Prevention

When it happens

Trigger: Calling createCaseInstanceQuery().caseInstanceName(null) because an optional name search parameter, config value, or form field was null.

Common situations: Search forms submitted without a name; API clients sending JSON that omits the name field (deserialized as null); code paths migrated from empty-string defaults to null.

Related errors


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

Appendix: source

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

    @Override
    public CaseInstanceQueryImpl caseInstanceIds(Set<String> caseInstanceIds) {
        if (caseInstanceIds == null) {
            throw new FlowableIllegalArgumentException("Case instance ids is null");
        }

        if (inOrStatement) {
            this.currentOrQueryObject.caseInstanceIds = caseInstanceIds;
        } else {
            this.caseInstanceIds = caseInstanceIds;
        }
        return this;
    }

    @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;

View on GitHub (pinned to d6d39ce1c6)