flowable/flowable-engine · error · FlowableIllegalArgumentException
None of the given task assignees can be null
Error message
None of the given task assignees can be null
What it means
Flowable throws this when taskTaskAssigneeIds(...) (assignee-id list query) is called with a list containing at least one null element. The library validates every entry eagerly so a malformed IN-clause is never sent to the database. It is an immediate argument-validation failure, not a state or runtime issue.
Solutions
- Filter null (and blank) entries before calling taskTaskAssigneeIds
- Ensure upstream data does not produce null assignee ids (fix the query/source)
- If you truly have no assignees, skip setting the filter instead of passing a list of nulls
Example fix
// before
query.taskTaskAssigneeIds(assigneeIds); // list may contain nulls
// after
List<String> clean = assigneeIds.stream().filter(Objects::nonNull).collect(Collectors.toList());
if (!clean.isEmpty()) { query.taskTaskAssigneeIds(clean); } Defensive patterns
Strategy: validation
Validate before calling
List<String> safeAssignees = assigneeIds == null ? Collections.emptyList() : assigneeIds.stream().filter(Objects::nonNull).collect(Collectors.toList());
if (safeAssignees.isEmpty()) throw new IllegalArgumentException("assigneeIds must contain at least one non-null id"); Type guard
boolean isValidAssigneeIds(Collection<String> ids) {
return ids != null && !ids.isEmpty() && ids.stream().allMatch(Objects::nonNull);
} Try / catch
try {
query.taskTaskAssigneeIds(assigneeIds);
} catch (FlowableIllegalArgumentException e) {
// fall back to no assignee filter or corrected list
} Prevention
- Always filter nulls from id collections before passing to Flowable query setters
- Validate collections at the API/DTO boundary before they reach query construction
- Prefer Optional/stream filtering over raw collections from external sources
When it happens
Trigger: Calling HistoricTaskInstanceQuery.taskTaskAssigneeIds(Collection<String>) with a collection that contains a null element (e.g. a List built from a sparse map or split string with trailing separators).
Common situations: Collecting assignee ids from a database/HTTP join where some rows have NULL assignee; building the list from user input without filtering blanks; deserializing JSON arrays containing nulls.
Related errors
- Booleans and null cannot be used in 'greater than or equal'…
- Booleans and null cannot be used in 'less than or equal'…
- None of the given task categories can be null
- Task category list is null
- Task formKey is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/c6740dcf6ee48057.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/HistoricTaskInstanceQueryImpl.java:947
this.currentOrQueryObject.withAssignee = true;
}
else {
this.withAssignee = true;
}
return this;
}
@Override
public HistoricTaskInstanceQuery taskAssigneeIds(Collection<String> assigneeIds) {
if (assigneeIds == null) {
throw new FlowableIllegalArgumentException("Task assignee list is null");
}
if (assigneeIds.isEmpty()) {
throw new FlowableIllegalArgumentException("Task assignee list is empty");
}
for (String assignee : assigneeIds) {
if (assignee == null) {
throw new FlowableIllegalArgumentException("None of the given task assignees can be null");
}
}
if (taskAssignee != null) {
throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskAssigneeIds and taskAssignee");
}
if (taskAssigneeLike != null) {
throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLike");
}
if (taskAssigneeLikeIgnoreCase != null) {
throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLikeIgnoreCase");
}
if (inOrStatement) {
currentOrQueryObject.taskAssigneeIds = assigneeIds;
} else {
this.taskAssigneeIds = assigneeIds;
}View on GitHub (pinned to d6d39ce1c6)