flowable/flowable-engine · error · FlowableIllegalArgumentException
involved user is null
Error message
involved user is null
What it means
taskInvolvedUser(String) throws FlowableIllegalArgumentException when the involvedUser argument is null. Flowable validates that required identity filters are non-null at call time. The involved-user filter matches tasks where the given user appears in identity links (participant, assignee, etc.).
Solutions
- Pass a non-null user id; verify the security-context/user variable before the call.
- Skip taskInvolvedUser() when no user filter is intended.
- For unassigned tasks use taskUnassigned() instead of deriving a user from a null assignee.
Example fix
// before
String userId = securityService.getCurrentUser();
query.taskInvolvedUser(userId); // throws when anonymous
// after
String userId = securityService.getCurrentUser();
if (userId != null) {
query.taskInvolvedUser(userId);
} Defensive patterns
Strategy: validation
Validate before calling
if (involvedUser != null && !involvedUser.isEmpty()) {
historicTaskInstanceQuery.taskInvolvedUser(involvedUser);
} Type guard
boolean isValidUser(String userId) {
return userId != null && !userId.trim().isEmpty();
} Try / catch
try {
query.taskInvolvedUser(userId);
} catch (FlowableIllegalArgumentException e) {
log.warn("Invalid involvedUser filter: {}", e.getMessage());
} Prevention
- Never forward a null assignee (unassigned task) as an involved-user filter; use taskUnassigned() instead.
- Handle unauthenticated requests: skip user filters when the security context yields null.
- Validate optional REST parameters before applying them to the query.
When it happens
Trigger: Calling taskInvolvedUser(null) — commonly an unresolved variable from task.getAssignee() (null for unassigned tasks), a missing session user, or an optional REST parameter forwarded unchecked.
Common situations: Passing the current user id from a security context that is null for anonymous/unauthenticated requests; querying involvement of a user derived from an unassigned task.
Related errors
- Candidate group is null
- Candidate group list is null
- Candidate user is null
- Involved groups are null
- Assignee is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/28224ebcbca29390.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/HistoricTaskInstanceQueryImpl.java:1944
throw new FlowableIllegalArgumentException("Candidate group list is empty");
}
if (candidateGroup != null) {
throw new FlowableIllegalArgumentException("Invalid query usage: cannot set both candidateGroupIn and candidateGroup");
}
if (inOrStatement) {
this.currentOrQueryObject.candidateGroups = candidateGroups;
} else {
this.candidateGroups = candidateGroups;
}
return this;
}
@Override
public HistoricTaskInstanceQuery taskInvolvedUser(String involvedUser) {
if (involvedUser == null) {
throw new FlowableIllegalArgumentException("involved user is null");
}
if (inOrStatement) {
this.currentOrQueryObject.involvedUser = involvedUser;
} else {
this.involvedUser = involvedUser;
}
return this;
}
@Override
public HistoricTaskInstanceQuery taskInvolvedGroups(Collection<String> involvedGroups) {
if (involvedGroups == null) {
throw new FlowableIllegalArgumentException("Involved groups are null");
}
if (involvedGroups.isEmpty()) {
throw new FlowableIllegalArgumentException("Involved groups are empty");
}View on GitHub (pinned to d6d39ce1c6)