flowable/flowable-engine · error · ActivitiIllegalArgumentException
Task name list is empty
Error message
Task name list is empty
What it means
HistoricTaskInstanceQueryImpl.taskNameIn() throws ActivitiIllegalArgumentException when the task name list is non-null but empty. An empty IN list is invalid, so at least one task name must be supplied. Additionally, taskNameIn is mutually exclusive with taskName/taskNameLike, which the library checks right after this guard.
Solutions
- Check !names.isEmpty() before calling taskNameIn; skip the filter when empty.
- Verify how the list is built — ensure at least one name is collected before query execution.
- Ensure you are not mixing taskNameIn with taskName or taskNameLike, which throws a separate invalid-usage error.
Example fix
// before
query.taskNameIn(names); // empty list
// after
if (names != null && !names.isEmpty()) {
query.taskNameIn(names);
} Defensive patterns
Strategy: validation
Validate before calling
if (names != null && !names.isEmpty()) {
if (useNameEquals) { throw new IllegalStateException("taskNameIn is mutually exclusive with taskName"); }
query.taskNameIn(names);
} Type guard
static boolean canApplyNameIn(List<String> names, String taskName, String taskNameLike) { return names != null && !names.isEmpty() && taskName == null && taskNameLike == null; } Try / catch
try {
query.taskNameIn(names);
} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {
// covers both empty-list and taskName/taskNameLike conflicts
log.warn("Invalid task name filter: {}", e.getMessage());
} Prevention
- Guard against empty lists AND against combining taskNameIn with taskName/taskNameLike.
- Treat an empty keyword list as 'no name filter' and skip the call.
- Encode the mutual-exclusion rule in your own query DTO so invalid combinations cannot be built.
When it happens
Trigger: Calling historicTaskInstanceQuery.taskNameIn(new ArrayList<>()) or any empty List<String>.
Common situations: Search box with multiple keywords that the user left blank; splitting an empty string into an empty list ("".split(",") nuances aside); passing an empty filter set from a saved search.
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
- Process category 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/63c55b5d0f26d5de.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/HistoricTaskInstanceQueryImpl.java:381
}
@Override
public HistoricTaskInstanceQuery taskName(String taskName) {
if (inOrStatement) {
this.currentOrQueryObject.taskName = taskName;
} else {
this.taskName = taskName;
}
return this;
}
@Override
public HistoricTaskInstanceQuery taskNameIn(List<String> taskNameList) {
if (taskNameList == null) {
throw new ActivitiIllegalArgumentException("Task name list is null");
}
if (taskNameList.isEmpty()) {
throw new ActivitiIllegalArgumentException("Task name list is empty");
}
if (taskName != null) {
throw new ActivitiIllegalArgumentException("Invalid query usage: cannot set both taskNameIn and taskName");
}
if (taskNameLike != null) {
throw new ActivitiIllegalArgumentException("Invalid query usage: cannot set both taskNameIn and taskNameLike");
}
if (taskNameLikeIgnoreCase != null) {
throw new ActivitiIllegalArgumentException("Invalid query usage: cannot set both taskNameIn and taskNameLikeIgnoreCase");
}
if (inOrStatement) {
currentOrQueryObject.taskNameList = taskNameList;
} else {
this.taskNameList = taskNameList;
}
return this;View on GitHub (pinned to d6d39ce1c6)