flowable/flowable-engine · error · ActivitiIllegalArgumentException

name is null

Error message

name is null

What it means

ModelQueryImpl.modelName(String) sets an exact-match filter on the model name and rejects null — to query all models, simply don't apply the name filter. Null input throws ActivitiIllegalArgumentException.

Solutions

  1. Guard the value with a null/empty check before applying the filter
  2. Skip the name filter when no name is specified
  3. For partial matching use modelNameLike with a validated non-null pattern

Example fix

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

Strategy: validation

Validate before calling

if (name != null && !name.isEmpty()) { query.modelName(name); }

Type guard

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

Try / catch

try {
    query.modelName(name);
} catch (ActivitiIllegalArgumentException e) {
    // run query without name filter
}

Prevention

When it happens

Trigger: repositoryService.createModelQuery().modelName(name) with a null name, typically an unpopulated request field or variable.

Common situations: Search form submitted without a name; JSON body field missing so the mapped Java field stays null; variable renamed elsewhere and now unset at the call site.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ModelQueryImpl.java:94

            throw new ActivitiIllegalArgumentException("categoryLike is null");
        }
        this.categoryLike = categoryLike;
        return this;
    }

    @Override
    public ModelQueryImpl modelCategoryNotEquals(String categoryNotEquals) {
        if (categoryNotEquals == null) {
            throw new ActivitiIllegalArgumentException("categoryNotEquals is null");
        }
        this.categoryNotEquals = categoryNotEquals;
        return this;
    }

    @Override
    public ModelQueryImpl modelName(String name) {
        if (name == null) {
            throw new ActivitiIllegalArgumentException("name is null");
        }
        this.name = name;
        return this;
    }

    @Override
    public ModelQueryImpl modelNameLike(String nameLike) {
        if (nameLike == null) {
            throw new ActivitiIllegalArgumentException("nameLike is null");
        }
        this.nameLike = nameLike;
        return this;
    }

    @Override
    public ModelQuery modelKey(String key) {
        if (key == null) {
            throw new ActivitiIllegalArgumentException("key is null");

View on GitHub (pinned to d6d39ce1c6)