flowable/flowable-engine · error · ActivitiIllegalArgumentException

Process category list is empty

Error message

Process category list is empty

What it means

TaskQueryImpl.processCategoryIn(List<String>) throws ActivitiIllegalArgumentException when the processCategoryInList is empty. An empty category list would produce a meaningless SQL IN () predicate, so the engine rejects it eagerly while the query is being built.

Solutions

  1. Check isEmpty() before calling processCategoryIn; skip the filter (all categories) or short-circuit to an empty result depending on business rules.
  2. Combine null/empty handling into a shared guard used by all in-list query filters.
  3. Catch ActivitiIllegalArgumentException and return 'no categories selected' feedback to the user.

Example fix

// before
taskQuery.processCategoryIn(selectedCategories); // may be empty

// after
if (selectedCategories == null || selectedCategories.isEmpty()) {
    // no category filter selected
} else {
    taskQuery.processCategoryIn(selectedCategories);
}
Defensive patterns

Strategy: validation

Validate before calling

if (selectedCategories == null || selectedCategories.isEmpty()) {
    // all categories selected: do not apply filter
} else {
    taskQuery.processCategoryIn(selectedCategories);
}

Type guard

boolean isNonEmptyCategoryList(List<String> categories) { return categories != null && !categories.isEmpty(); }

Try / catch

try {
    return taskQuery.processCategoryIn(categories).list();
} catch (ActivitiIllegalArgumentException e) {
    log.warn("Empty category list rejected: {}", e.getMessage());
    return Collections.emptyList();
}

Prevention

When it happens

Trigger: Calling taskQuery.processCategoryIn(new ArrayList<>()) or passing a list whose entries were all filtered out before the query was assembled.

Common situations: Users deselecting all category filters in a UI; config-driven category sets that resolve to zero entries in a given environment.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java:1035

    }

    @Override
    public TaskQuery processDefinitionNameLike(String processDefinitionNameLike) {
        if (orActive) {
            currentOrQueryObject.processDefinitionNameLike = processDefinitionNameLike;
        } else {
            this.processDefinitionNameLike = processDefinitionNameLike;
        }
        return this;
    }

    @Override
    public TaskQuery processCategoryIn(List<String> processCategoryInList) {
        if (processCategoryInList == null) {
            throw new ActivitiIllegalArgumentException("Process category list is null");
        }
        if (processCategoryInList.isEmpty()) {
            throw new ActivitiIllegalArgumentException("Process category list is empty");
        }
        for (String processCategory : processCategoryInList) {
            if (processCategory == null) {
                throw new ActivitiIllegalArgumentException("None of the given process categories can be null");
            }
        }

        if (orActive) {
            currentOrQueryObject.processCategoryInList = processCategoryInList;
        } else {
            this.processCategoryInList = processCategoryInList;
        }
        return this;
    }

    @Override
    public TaskQuery processCategoryNotIn(List<String> processCategoryNotInList) {
        if (processCategoryNotInList == null) {

View on GitHub (pinned to d6d39ce1c6)