flowable/flowable-engine · error · ActivitiIllegalArgumentException
Min Priority is null
Error message
Min Priority is null
What it means
Thrown by TaskQueryImpl.taskMinPriority(Integer) in the Flowable 5 engine when the minPriority argument is null. Query builder methods in this library validate arguments eagerly so invalid queries fail at construction time rather than producing broken SQL or an empty/incorrect result set at execution time. Passing null means you cannot express a minimum priority filter, so the library refuses immediately with ActivitiIllegalArgumentException.
Source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java:313
}
@Override
public TaskQuery taskPriority(Integer priority) {
if (priority == null) {
throw new ActivitiIllegalArgumentException("Priority is null");
}
if (orActive) {
currentOrQueryObject.priority = priority;
} else {
this.priority = priority;
}
return this;
}
@Override
public TaskQuery taskMinPriority(Integer minPriority) {
if (minPriority == null) {
throw new ActivitiIllegalArgumentException("Min Priority is null");
}
if (orActive) {
currentOrQueryObject.minPriority = minPriority;
} else {
this.minPriority = minPriority;
}
return this;
}
@Override
public TaskQuery taskMaxPriority(Integer maxPriority) {
if (maxPriority == null) {
throw new ActivitiIllegalArgumentException("Max Priority is null");
}
if (orActive) {
currentOrQueryObject.maxPriority = maxPriority;
} else {
this.maxPriority = maxPriority;View on GitHub (pinned to d6d39ce1c6)
Solutions
- Pass a concrete Integer value (e.g. taskMinPriority(50)) to taskMinPriority.
- If the threshold is optional, call taskMinPriority only when the value is non-null: if (min != null) query.taskMinPriority(min);
- Provide a sane default at the config/DTO layer so the value can never be null.
- Catch ActivitiIllegalArgumentException at the API boundary and return a 400 with a clear message.
Example fix
// before
int min = config.getMin(); // may be null
query.taskMinPriority(min);
// after
Integer min = config.getMin();
if (min != null) {
query.taskMinPriority(min);
} Defensive patterns
Strategy: validation
Validate before calling
if (minPriority != null) {
query.taskMinPriority(minPriority);
} Type guard
boolean hasMinPriority(Integer v) { return v != null; } Try / catch
try {
query.taskMinPriority(minPriority);
} catch (ActivitiIllegalArgumentException e) {
throw new BadRequestException("Invalid minPriority: " + e.getMessage());
} Prevention
- Default unset priority thresholds to concrete values (e.g. 0/100).
- Only apply optional filters when their value is non-null.
- Validate filter DTOs before building queries.
When it happens
Trigger: Calling taskQuery.taskMinPriority(null) directly, or passing a variable that was resolved to null (e.g. a config value or request parameter that defaulted to null) into taskMinPriority.
Common situations: Mapping an optional HTTP query parameter straight into taskMinPriority without a default; reading a priority threshold from properties/yaml where the key is absent; deserializing a saved filter DTO where the minPriority field is missing.
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/18eab86c27720e74.
Report an issue: GitHub.