flowable/flowable-engine · error · ActivitiIllegalArgumentException
nameLike is null
Error message
nameLike is null
What it means
Fluent-setter validation in flowable5 ModelQueryImpl.modelNameLike: a null LIKE pattern was passed to the Activiti 5 compatibility query and is rejected before SQL generation.
Solutions
- Validate the search pattern for null/blank before calling
- Wrap the pattern with '%' wildcards only after the null check
- Skip the filter when no search term is present
Example fix
// before
query.modelNameLike(term);
// after
if (term != null && !term.trim().isEmpty()) {
query.modelNameLike("%" + term.trim() + "%");
} Defensive patterns
Strategy: validation
Validate before calling
if (nameLike != null && !nameLike.trim().isEmpty()) { query.modelNameLike("%" + nameLike.trim() + "%"); } Type guard
boolean hasText(String s) { return s != null && !s.trim().isEmpty(); } Try / catch
try {
query.modelNameLike(pattern);
} catch (ActivitiIllegalArgumentException e) {
// fall back to unfiltered list
} Prevention
- Blank out empty search terms before building LIKE patterns
- Centralize like-filter construction with wildcard handling and null checks
- Escape '%' and '_' from user input
When it happens
Trigger: repositoryService.createModelQuery().modelNameLike(pattern) with a null pattern, e.g. an unset search input or uninitialized wildcard variable.
Common situations: Client-side search box left empty and bound to null; dynamic filter builder adding the like clause unconditionally; migration from empty-string to null semantics.
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/10f0b21ead2ada9c.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ModelQueryImpl.java:103
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");
}
this.key = key;
return this;
}
@Override
public ModelQueryImpl modelVersion(Integer version) {
if (version == null) {
throw new ActivitiIllegalArgumentException("version is null");View on GitHub (pinned to d6d39ce1c6)