flowable/flowable-engine · error · ActivitiIllegalArgumentException
name is null
Error message
name is null
What it means
ModelQueryImpl.modelName(String) sets an exact-match filter on the model name and rejects null — to query all models, simply don't apply the name filter. Null input throws ActivitiIllegalArgumentException.
Solutions
- Guard the value with a null/empty check before applying the filter
- Skip the name filter when no name is specified
- For partial matching use modelNameLike with a validated non-null pattern
Example fix
// before
query.modelName(filter.getName());
// after
if (filter.getName() != null) { query.modelName(filter.getName()); } Defensive patterns
Strategy: validation
Validate before calling
if (name != null && !name.isEmpty()) { query.modelName(name); } Type guard
boolean hasText(String s) { return s != null && !s.trim().isEmpty(); } Try / catch
try {
query.modelName(name);
} catch (ActivitiIllegalArgumentException e) {
// run query without name filter
} Prevention
- Validate DTO fields before mapping them into query filters
- Use conditional filter building for optional search fields
- Prefer Optional<String> in your own filter-builder API to force explicit handling
When it happens
Trigger: repositoryService.createModelQuery().modelName(name) with a null name, typically an unpopulated request field or variable.
Common situations: Search form submitted without a name; JSON body field missing so the mapped Java field stays null; variable renamed elsewhere and now unset at the call site.
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/54ff5c60d3b4d67d.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ModelQueryImpl.java:94
throw new ActivitiIllegalArgumentException("categoryLike is null");
}
this.categoryLike = categoryLike;
return this;
}
@Override
public ModelQueryImpl modelCategoryNotEquals(String categoryNotEquals) {
if (categoryNotEquals == null) {
throw new ActivitiIllegalArgumentException("categoryNotEquals is null");
}
this.categoryNotEquals = categoryNotEquals;
return this;
}
@Override
public ModelQueryImpl modelName(String name) {
if (name == null) {
throw new ActivitiIllegalArgumentException("name is null");
}
this.name = name;
return this;
}
@Override
public ModelQueryImpl modelNameLike(String nameLike) {
if (nameLike == null) {
throw new ActivitiIllegalArgumentException("nameLike is null");
}
this.nameLike = nameLike;
return this;
}
@Override
public ModelQuery modelKey(String key) {
if (key == null) {
throw new ActivitiIllegalArgumentException("key is null");View on GitHub (pinned to d6d39ce1c6)