flowable/flowable-engine · error · ActivitiIllegalArgumentException
Task assignee list is empty
Error message
Task assignee list is empty
What it means
Thrown by TaskQueryImpl.taskAssigneeIds(List<String>) when the assigneeIds list is non-null but empty. An empty IN () clause is invalid SQL and meaningless as a filter, so the library rejects it explicitly rather than producing a broken query or silently returning all tasks.
Solutions
- Check isEmpty() before calling and skip the filter (or return an empty result directly) when the list is empty.
- Populate the list with at least one valid assignee id.
- If an empty selection must return nothing, short-circuit: return an empty task list without executing the query.
- Validate the ids collection in the service layer before building the query.
Example fix
// before
query.taskAssigneeIds(selectedIds); // selectedIds may be empty
// after
if (selectedIds == null || selectedIds.isEmpty()) {
return Collections.emptyList(); // or omit the filter
}
query.taskAssigneeIds(selectedIds); Defensive patterns
Strategy: validation
Validate before calling
if (assigneeIds == null || assigneeIds.isEmpty()) {
return Collections.emptyList(); // nothing selected: no results (or omit filter)
}
query.taskAssigneeIds(assigneeIds); Type guard
boolean isQueryableIdList(List<String> l) { return l != null && !l.isEmpty(); } Try / catch
try {
query.taskAssigneeIds(assigneeIds);
} catch (ActivitiIllegalArgumentException e) {
throw new BadRequestException("Assignee ids must be non-empty");
} Prevention
- Decide semantics for empty selections: empty result vs no filter — then enforce before the call.
- Check isEmpty() after any stream/filter transformation of the id list.
- Validate collection inputs in the service layer.
When it happens
Trigger: Calling taskQuery.taskAssigneeIds(new ArrayList<>()) or passing a collection that ended up empty after filtering (e.g. no users selected, empty group).
Common situations: UI bulk-selection with nothing selected; filtering a role's members leaves zero ids; a stream filter reduced the candidate list to empty before query construction.
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
- Assignee is null
- Invalid query usage: cannot set both taskAssigneeIds and…
- Invalid query usage: cannot set both taskAssigneeIds and…
- None of the given task assignees can be null
- Task assignee list is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/ed714a5ea99d37a8.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java:381
public TaskQuery taskAssigneeLikeIgnoreCase(String assigneeLikeIgnoreCase) {
if (assigneeLikeIgnoreCase == null) {
throw new ActivitiIllegalArgumentException("assigneeLikeIgnoreCase is null");
}
if (orActive) {
currentOrQueryObject.assigneeLikeIgnoreCase = assigneeLikeIgnoreCase.toLowerCase();
} else {
this.assigneeLikeIgnoreCase = assigneeLikeIgnoreCase.toLowerCase();
}
return this;
}
@Override
public TaskQuery taskAssigneeIds(List<String> assigneeIds) {
if (assigneeIds == null) {
throw new ActivitiIllegalArgumentException("Task assignee list is null");
}
if (assigneeIds.isEmpty()) {
throw new ActivitiIllegalArgumentException("Task assignee list is empty");
}
for (String assignee : assigneeIds) {
if (assignee == null) {
throw new ActivitiIllegalArgumentException("None of the given task assignees can be null");
}
}
if (assignee != null) {
throw new ActivitiIllegalArgumentException("Invalid query usage: cannot set both taskAssigneeIds and taskAssignee");
}
if (assigneeLike != null) {
throw new ActivitiIllegalArgumentException("Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLike");
}
if (assigneeLikeIgnoreCase != null) {
throw new ActivitiIllegalArgumentException("Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLikeIgnoreCase");
}
if (orActive) {View on GitHub (pinned to d6d39ce1c6)