flowable/flowable-engine · error · ActivitiIllegalArgumentException

categoryNotEquals is null

Error message

categoryNotEquals is null

What it means

ModelQueryImpl.modelCategoryNotEquals(String) excludes models whose category equals the given value; null is rejected because 'not equals null' is not a meaningful query predicate. Null input throws ActivitiIllegalArgumentException.

Solutions

  1. Only call modelCategoryNotEquals when the value is non-null/non-empty
  2. Drop the exclusion filter when no category should be excluded
  3. Filter nulls out of any configured exclusion list before applying it

Example fix

// before
query.modelCategoryNotEquals(config.getExcludeCategory());
// after
if (config.getExcludeCategory() != null) {
    query.modelCategoryNotEquals(config.getExcludeCategory());
}
Defensive patterns

Strategy: validation

Validate before calling

if (categoryNotEquals != null && !categoryNotEquals.isEmpty()) { query.modelCategoryNotEquals(categoryNotEquals); }

Type guard

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

Try / catch

try {
    query.modelCategoryNotEquals(excluded);
} catch (ActivitiIllegalArgumentException e) {
    // proceed without exclusion filter
}

Prevention

When it happens

Trigger: repositoryService.createModelQuery().modelCategoryNotEquals(excludedCategory) where excludedCategory is null, e.g. from an unset filter option.

Common situations: UI 'exclude category' option left empty and bound to null; configuration-driven exclusion list containing a null entry; refactoring replaced an empty-string sentinel with null.

Related errors


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

Appendix: source

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

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

    @Override
    public ModelQueryImpl modelCategoryLike(String categoryLike) {
        if (categoryLike == null) {
            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");

View on GitHub (pinned to d6d39ce1c6)