flowable/flowable-engine · error · ActivitiIllegalArgumentException
Invalid query usage: cannot set both taskNameInIgnoreCase…
Error message
Invalid query usage: cannot set both taskNameInIgnoreCase and nameLike
What it means
A task query cannot combine a name-like pattern with an exact-in-list name filter. taskNameLike(String) sets `nameLike`; calling taskNameInIgnoreCase afterwards detects the conflicting criterion and throws ActivitiIllegalArgumentException immediately.
Solutions
- Keep only one of the two filters; remove taskNameLike(...) if the in-list filter is intended
- Validate the search input so only one name-matching mode is accepted
- Use an or() block only if OR semantics between the two name conditions are genuinely desired
Example fix
// before
taskQuery.taskNameLike("%review%").taskNameInIgnoreCase(names);
// after
taskQuery.taskNameInIgnoreCase(names); Defensive patterns
Strategy: validation
Validate before calling
if (nameLike != null && namesIn != null) {
throw new IllegalArgumentException("taskNameLike and taskNameInIgnoreCase are mutually exclusive");
} Try / catch
try {
query.taskNameInIgnoreCase(names);
} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {
// rebuild query with only one name filter
} Prevention
- Pick a single name-matching mode per query
- Never apply every non-empty field of a search form blindly
- Document filter exclusivity in your query-builder helper
When it happens
Trigger: Chaining taskQuery.taskNameLike("%review%").taskNameInIgnoreCase(list), or calling taskNameInIgnoreCase on a query where the nameLike field was already populated (including via an OR query object).
Common situations: Dynamic search builders that apply every non-empty field of a search form, so both nameLike and a names list end up set; migrating queries that previously used only one filter.
Related errors
- Invalid query usage: cannot set both taskNameInIgnoreCase…
- Invalid query usage: cannot set both taskNameInIgnoreCase…
- Invalid query usage: cannot set both candidateGroupIn and…
- Invalid query usage: cannot set both candidateGroup and…
- Invalid query usage: cannot set both candidateGroup and…
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/8828c6639bcfec6a.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java:209
@Override
public TaskQuery taskNameInIgnoreCase(List<String> nameList) {
if (nameList == null) {
throw new ActivitiIllegalArgumentException("Task name list is null");
}
if (nameList.isEmpty()) {
throw new ActivitiIllegalArgumentException("Task name list is empty");
}
for (String name : nameList) {
if (name == null) {
throw new ActivitiIllegalArgumentException("None of the given task names can be null");
}
}
if (name != null) {
throw new ActivitiIllegalArgumentException("Invalid query usage: cannot set both taskNameInIgnoreCase and name");
}
if (nameLike != null) {
throw new ActivitiIllegalArgumentException("Invalid query usage: cannot set both taskNameInIgnoreCase and nameLike");
}
if (nameLikeIgnoreCase != null) {
throw new ActivitiIllegalArgumentException("Invalid query usage: cannot set both taskNameInIgnoreCase and nameLikeIgnoreCase");
}
final int nameListSize = nameList.size();
final List<String> caseIgnoredNameList = new ArrayList<>(nameListSize);
for (String name : nameList) {
caseIgnoredNameList.add(name.toLowerCase());
}
if (orActive) {
this.currentOrQueryObject.nameListIgnoreCase = caseIgnoredNameList;
} else {
this.nameListIgnoreCase = caseIgnoredNameList;
}
return this;
}View on GitHub (pinned to d6d39ce1c6)