flowable/flowable-engine · error · FlowableIllegalArgumentException
Invalid query usage: cannot set both taskAssigneeIds and…
Error message
Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLikeIgnoreCase
What it means
taskAssigneeIds cannot be combined with taskAssigneeLikeIgnoreCase(String) on the same query. Like the other assignee filters, the case-insensitive LIKE variant is mutually exclusive with explicit assignee-ID matching, and Flowable throws this error to prevent contradictory criteria.
Solutions
- Remove the taskAssigneeLikeIgnoreCase(...) call when using taskAssigneeIds.
- Centralize assignee filtering in one place so only a single style is applied.
- Normalize assignee IDs to one case and use taskAssigneeIds, dropping the ignore-case filter.
Example fix
// before
taskQuery.taskAssigneeLikeIgnoreCase("team-%");
taskQuery.taskAssigneeIds(ids);
// after
if (ids != null && !ids.isEmpty()) {
taskQuery.taskAssigneeIds(ids);
} else {
taskQuery.taskAssigneeLikeIgnoreCase("team-%");
} Defensive patterns
Strategy: validation
Validate before calling
if (assigneeIds != null && !assigneeIds.isEmpty() && assigneeLikeIgnoreCase != null) { throw new IllegalStateException("choose assigneeIds or assigneeLikeIgnoreCase, not both"); } Type guard
boolean conflict = assigneeLikeIgnoreCase != null && assigneeIds != null && !assigneeIds.isEmpty();
Try / catch
try {
applyAssigneeFilters(taskQuery, assigneeLikeIgnoreCase, assigneeIds);
} catch (FlowableIllegalArgumentException e) {
if (!e.getMessage().contains("cannot set both taskAssigneeIds and taskAssigneeLikeIgnoreCase")) throw e;
logger.error("Conflicting case-insensitive assignee filters", e);
} Prevention
- Normalize assignee IDs once (e.g. lowercase) and use taskAssigneeIds instead of ignore-case LIKE.
- Keep a single assignee-filter code path with an explicit mode parameter.
- Test queries assembled from multiple optional filter sources.
When it happens
Trigger: Calling taskQuery.taskAssigneeLikeIgnoreCase("team-%").taskAssigneeIds(ids) (either order) on the same TaskQuery instance.
Common situations: A case-insensitive search UI adding an ignore-case filter while another component sets assignee IDs; dynamic query assembly applying every set criterion without checking for conflicts.
Related errors
- Invalid query usage: cannot set both taskAssigneeIds and…
- Invalid query usage: cannot set both taskAssigneeIds and…
- Invalid query usage: cannot set both taskNameIn and…
- Invalid query usage: cannot set both taskNameIn and name
- Invalid query usage: cannot set both taskNameIn and nameLike
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/d609a8cfaaaa4299.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java:487
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 (assignee != null) {
throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskAssigneeIds and taskAssignee");
}
if (assigneeLike != null) {
throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLike");
}
if (assigneeLikeIgnoreCase != null) {
throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLikeIgnoreCase");
}
if (orActive) {
currentOrQueryObject.assigneeIds = assigneeIds;
} else {
this.assigneeIds = assigneeIds;
}
return this;
}
@Override
public TaskQueryImpl taskOwner(String owner) {
if (owner == null) {
throw new FlowableIllegalArgumentException("Owner is null");
}
if (orActive) {
currentOrQueryObject.owner = owner;
} else {View on GitHub (pinned to d6d39ce1c6)