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
- Check isEmpty() before calling processCategoryIn; skip the filter (all categories) or short-circuit to an empty result depending on business rules.
- Combine null/empty handling into a shared guard used by all in-list query filters.
- 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
- Map 'nothing selected' in UIs to an explicit unfiltered query
- Check both null and empty before applying in-list filters
- Document whether empty selection means 'all' or 'none' per business rule
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
- Candidate group list is empty
- Candidate group list is null
- None of the given process instance ids can be null
- Process category list is null
- Process instance id list is empty
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)