flowable/flowable-engine · error · FlowableIllegalArgumentException
Task name list is empty
Error message
Task name list is empty
What it means
Flowable throws this FlowableIllegalArgumentException when TaskQuery.taskNameIn is given an empty collection. An empty IN list would generate invalid or pointless SQL, so Flowable rejects it during query construction, after the null check.
Source
Thrown at modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java:256
if (name == null) {
throw new FlowableIllegalArgumentException("Task name is null");
}
if (orActive) {
currentOrQueryObject.name = name;
} else {
this.name = name;
}
return this;
}
@Override
public TaskQuery taskNameIn(Collection<String> nameList) {
if (nameList == null) {
throw new FlowableIllegalArgumentException("Task name list is null");
}
if (nameList.isEmpty()) {
throw new FlowableIllegalArgumentException("Task name list is empty");
}
for (String name : nameList) {
if (name == null) {
throw new FlowableIllegalArgumentException("None of the given task names can be null");
}
}
if (name != null) {
throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskNameIn and name");
}
if (nameLike != null) {
throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskNameIn and nameLike");
}
if (nameLikeIgnoreCase != null) {
throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskNameIn and nameLikeIgnoreCase");
}
if (orActive) {View on GitHub (pinned to d6d39ce1c6)
Solutions
- Check isEmpty() before calling taskNameIn and omit the filter when the list is empty.
- Decide semantics explicitly: an empty selection usually means 'no filter' or 'no results' - implement whichever is intended.
- Short-circuit and return an empty result set yourself if empty selection must mean zero results.
- Make the UI/API forbid submitting a name filter with zero entries.
Example fix
// before
query.taskNameIn(selectedNames); // throws when selectedNames is empty
// after
if (selectedNames != null && !selectedNames.isEmpty()) {
query.taskNameIn(selectedNames);
} // else: no name filter applied Defensive patterns
Strategy: validation
Validate before calling
if (names != null && !names.isEmpty()) {
query.taskNameIn(names);
} else if (names != null) {
return Collections.emptyList(); // empty selection means no matches by design
} Type guard
boolean isNonEmpty(Collection<?> c) { return c != null && !c.isEmpty(); } Try / catch
try {
query.taskNameIn(names);
} catch (FlowableIllegalArgumentException e) {
if (e.getMessage().equals("Task name list is empty")) {
log.warn("Empty name list; returning no results");
return Collections.emptyList();
}
throw e;
} Prevention
- Decide and document empty-selection semantics (no filter vs no results)
- Check isEmpty() at the call site before building the query
- Avoid passing UI-cleared selections straight into taskNameIn
- Test the empty-list path of every dynamic query
When it happens
Trigger: Calling createTaskQuery().taskNameIn(Collections.emptyList()) or taskNameIn(new ArrayList<>()) - any collection with size 0.
Common situations: Dynamic filters where the user selected no names; upstream filtering (e.g. by tenant or permission) removed all entries from the list before the query was built.
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
- Could not find an app definition with id '<appDefinitionId>
- Could not find a deployment with id '<deploymentId>
- ids is an empty collection
- callbackIds is null or empty
- Error retrieving app engine info
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/948121a703cfac5e.
Report an issue: GitHub.