flowable/flowable-engine · error · FlowableIllegalArgumentException
Task name is null
Error message
Task name is null
What it means
Flowable throws this FlowableIllegalArgumentException when TaskQuery.taskName(null) is called. The name filter requires a concrete value for the SQL equality predicate, so null is rejected at build time. This is an argument-validation failure, not a query-execution failure.
Solutions
- Null-check the name and omit the taskName filter when absent.
- Provide a default task name value in configuration if the filter is required.
- Validate the request parameter at the boundary before building the query.
- If partial matching was intended, use taskNameLike with a validated non-null pattern.
Example fix
// before
query.taskName(filter.getName()); // throws when name is null
// after
if (filter.getName() != null) {
query.taskName(filter.getName());
} Defensive patterns
Strategy: validation
Validate before calling
if (name != null) {
query.taskName(name);
} Type guard
boolean isNotBlank(String s) { return s != null && !s.trim().isEmpty(); } Try / catch
try {
query.taskName(name);
} catch (FlowableIllegalArgumentException e) {
if (e.getMessage().equals("Task name is null")) {
throw new BadRequestException("task name filter must not be null", e);
}
throw e;
} Prevention
- Treat optional filters as optional: only apply them when non-null
- Supply defaults for required task-name configuration keys
- Validate filter DTOs before query construction
- Distinguish 'no filter' from 'filter by null' explicitly in your API
When it happens
Trigger: Calling createTaskQuery().taskName(null), usually when the name comes from an unpopulated variable, config value, or optional request parameter.
Common situations: Search screens where the name filter is optional but passed straight through; property files where the expected task name key is missing; beans built before their name field was set.
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/4e75b2c52009d511.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java:239
}
@Override
public TaskQuery taskIds(Collection<String> taskIds) {
if (taskIds == null) {
throw new FlowableIllegalArgumentException("Task ids are null");
}
if (orActive) {
currentOrQueryObject.taskIds = taskIds;
} else {
this.taskIds = taskIds;
}
return this;
}
@Override
public TaskQueryImpl taskName(String name) {
if (name == null) {
throw new FlowableIllegalArgumentException("Task name is null");
}
if (orActive) {
currentOrQueryObject.name = name;
} else {
this.name = name;
}
return this;
}
@Override
public TaskQuery taskNameIn(Collection<String> nameList) {
if (nameList == null) {
throw new FlowableIllegalArgumentException("Task name list is null");
}
if (nameList.isEmpty()) {
throw new FlowableIllegalArgumentException("Task name list is empty");
}View on GitHub (pinned to d6d39ce1c6)