flowable/flowable-engine · error · ActivitiIllegalArgumentException
None of the given process categories can be null
Error message
None of the given process categories can be null
What it means
HistoricTaskInstanceQueryImpl.processCategoryIn() throws ActivitiIllegalArgumentException when any element of the category list is null. Since the list feeds an SQL IN clause, null entries are rejected. Remove nulls or fix the code that builds the list.
Solutions
- Strip null entries: categories.removeIf(Objects::isNull) before calling.
- Sanitize the config/source producing the categories so blanks become skips, not nulls.
- Validate each category string (non-null, non-empty) when building the list.
Example fix
// before
query.processCategoryIn(categories); // contains nulls
// after
List<String> safe = categories.stream().filter(Objects::nonNull).collect(Collectors.toList());
if (!safe.isEmpty()) {
query.processCategoryIn(safe);
} Defensive patterns
Strategy: validation
Validate before calling
List<String> safe = categories.stream().filter(c -> c != null && !c.trim().isEmpty()).collect(Collectors.toList());
if (!safe.isEmpty()) { query.processCategoryIn(safe); } Type guard
static boolean allNonNull(List<String> list) { return list != null && list.stream().allMatch(Objects::nonNull); } Try / catch
try {
query.processCategoryIn(categories);
} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {
log.error("processCategoryIn rejected: {}", e.getMessage());
throw e; // programmer error, rethrow after logging
} Prevention
- Sanitize config-sourced category lists (drop blank/null entries) at load time.
- Prefer Optional-based assembly that skips missing values rather than inserting nulls.
- Cover null-element cases in tests for list-valued query filters.
When it happens
Trigger: Calling historicTaskInstanceQuery.processCategoryIn(Arrays.asList("http://example.com/hr", null)).
Common situations: Reading category names from config files/DB rows where some entries are blank; mapping optional fields to list entries with nulls; JSON payloads containing null array items.
Related errors
- None of the given process instance ids can be null
- Process category list is empty
- Process category list is null
- Process definition category is null
- Process definition id is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/46db10af93ddeb60.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java:301
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) {
throw new ActivitiIllegalArgumentException("Process category list is null");
}
if (processCategoryNotInList.isEmpty()) {
throw new ActivitiIllegalArgumentException("Process category list is empty");View on GitHub (pinned to d6d39ce1c6)