flowable/flowable-engine · error · ActivitiIllegalArgumentException
Process category list is empty
Error message
Process category list is empty
What it means
HistoricTaskInstanceQueryImpl.processCategoryIn() throws ActivitiIllegalArgumentException when the category list is non-null but empty. An empty IN clause is invalid, so the library demands at least one category. Provide one or more process definition category values.
Solutions
- Check !categories.isEmpty() before calling processCategoryIn; skip the call or abort when empty.
- Populate the list with the correct process definition category keys.
- Verify category configuration/deployment: categories come from deployed process definitions (empty deployments yield empty lists).
Example fix
// before
query.processCategoryIn(selectedCategories); // can be empty
// after
if (selectedCategories != null && !selectedCategories.isEmpty()) {
query.processCategoryIn(selectedCategories);
} Defensive patterns
Strategy: validation
Validate before calling
if (categories != null && !categories.isEmpty()) { query.processCategoryIn(categories); } Type guard
static boolean nonEmpty(List<String> list) { return list != null && !list.isEmpty(); } Try / catch
try {
query.processCategoryIn(categories);
} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {
return Collections.emptyList(); // empty selection means no matches expected
} Prevention
- Skip the processCategoryIn call when the selection is empty instead of passing an empty list.
- Verify deployed process definitions actually carry the category keys you filter on.
- Add a validation step in UI/service layers requiring at least one category selection when the filter is active.
When it happens
Trigger: Calling historicTaskInstanceQuery.processCategoryIn(new ArrayList<>()) or any empty List<String>.
Common situations: Tenant/category selection UI that produced no selections; configuration listing categories that was empty; filtering a category list to empty before passing it.
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
- Task name list is empty
- None of the given process categories can be null
- None of the given process instance ids can be null
- Process category list is null
- Process definition category is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/9c1c878e3c9293bf.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java:297
}
@Override
public HistoricTaskInstanceQuery processDefinitionNameLike(String processDefinitionNameLike) {
if (inOrStatement) {
this.currentOrQueryObject.processDefinitionNameLike = processDefinitionNameLike;
} else {
this.processDefinitionNameLike = processDefinitionNameLike;
}
return this;
}
@Override
public HistoricTaskInstanceQuery 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 (inOrStatement) {
currentOrQueryObject.processCategoryInList = processCategoryInList;
} else {
this.processCategoryInList = processCategoryInList;
}
return this;
}
@Override
public HistoricTaskInstanceQuery processCategoryNotIn(List<String> processCategoryNotInList) {
if (processCategoryNotInList == null) {View on GitHub (pinned to d6d39ce1c6)