flowable/flowable-engine · error · FlowableIllegalArgumentException
Involved groups are null
Error message
Involved groups are null
What it means
TaskQueryImpl.taskInvolvedGroups() throws this when the passed collection is null. The query API requires an explicit, populated collection to filter tasks by involved groups; a null cannot be translated into a query criterion. Fail-fast validation avoids downstream database errors.
Solutions
- Pass a non-null collection of group ids to taskInvolvedGroups().
- Guard with a null check and skip the filter when groups are unavailable.
- Initialize the collection (e.g. Collections.emptyList()) at its source, but note empty is also rejected by a separate error.
- Fix the provider that returns null groups.
Example fix
// before
TaskQuery query = taskService.createTaskQuery().taskInvolvedGroups(groups);
// after
TaskQuery query = taskService.createTaskQuery();
if (groups != null && !groups.isEmpty()) {
query = query.taskInvolvedGroups(groups);
} Defensive patterns
Strategy: validation
Validate before calling
if (involvedGroups == null) {
throw new IllegalArgumentException("involvedGroups must be non-null before taskInvolvedGroups()");
}
query.taskInvolvedGroups(involvedGroups); Type guard
boolean isValidGroupCollection(Collection<String> g) { return g != null && !g.isEmpty(); } Try / catch
try {
query.taskInvolvedGroups(groups);
} catch (FlowableIllegalArgumentException e) {
logger.warn("Invalid task query: {}", e.getMessage());
query = taskService.createTaskQuery();
} Prevention
- Return empty collections (never null) from group-resolution code
- Guard collections for null and emptiness before filter calls
- Skip optional filters conditionally
- Test query builders with null/empty group collections
When it happens
Trigger: Calling taskQuery.taskInvolvedGroups(null), e.g. when group ids come from a service call that returned null or an unset collection field.
Common situations: Group list fetched from an external identity provider returned null; collection field never initialized; conditional logic forgot to populate groups before querying.
Related errors
- Candidate user is null
- Description is null
- Involved user is null
- Max Priority is null
- Min Priority is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/97782ef70b339c08.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java:606
}
@Override
public TaskQueryImpl taskInvolvedUser(String involvedUser) {
if (involvedUser == null) {
throw new FlowableIllegalArgumentException("Involved user is null");
}
if (orActive) {
currentOrQueryObject.involvedUser = involvedUser;
} else {
this.involvedUser = involvedUser;
}
return this;
}
@Override
public TaskQueryImpl taskInvolvedGroups(Collection<String> involvedGroups) {
if (involvedGroups == null) {
throw new FlowableIllegalArgumentException("Involved groups are null");
}
if (involvedGroups.isEmpty()) {
throw new FlowableIllegalArgumentException("Involved groups are empty");
}
if (orActive) {
currentOrQueryObject.involvedGroups = involvedGroups;
} else {
this.involvedGroups = involvedGroups;
}
return this;
}
@Override
public TaskQueryImpl taskCandidateGroup(String candidateGroup) {
if (candidateGroup == null) {
throw new FlowableIllegalArgumentException("Candidate group is null");
}
View on GitHub (pinned to d6d39ce1c6)