flowable/flowable-engine · error · ActivitiIllegalArgumentException
nameLike is null
Error message
nameLike is null
What it means
Flowable's ProcessDefinitionQueryImpl.processDefinitionNameLike(String) rejects a null nameLike parameter by throwing ActivitiIllegalArgumentException with message 'nameLike is null'. The query builder requires an actual LIKE pattern string; passing null would silently break the generated SQL filter, so the engine validates eagerly at API-call time rather than at query execution. This is a client-side argument contract violation, not a database or state problem.
Source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java:132
throw new ActivitiIllegalArgumentException("categoryNotEquals is null");
}
this.categoryNotEquals = categoryNotEquals;
return this;
}
@Override
public ProcessDefinitionQueryImpl processDefinitionName(String name) {
if (name == null) {
throw new ActivitiIllegalArgumentException("name is null");
}
this.name = name;
return this;
}
@Override
public ProcessDefinitionQueryImpl processDefinitionNameLike(String nameLike) {
if (nameLike == null) {
throw new ActivitiIllegalArgumentException("nameLike is null");
}
this.nameLike = nameLike;
return this;
}
@Override
public ProcessDefinitionQueryImpl deploymentId(String deploymentId) {
if (deploymentId == null) {
throw new ActivitiIllegalArgumentException("id is null");
}
this.deploymentId = deploymentId;
return this;
}
@Override
public ProcessDefinitionQueryImpl deploymentIds(Set<String> deploymentIds) {
if (deploymentIds == null) {
throw new ActivitiIllegalArgumentException("ids are null");View on GitHub (pinned to d6d39ce1c6)
Solutions
- Ensure a non-null LIKE pattern is passed, e.g. nameLike("%order%")
- If the filter is optional, only call processDefinitionNameLike when the value is non-null
- Default the value to a wildcard pattern like "%%" if 'match all' is intended
- Catch ActivitiIllegalArgumentException to surface a 400-style validation message to the caller
Example fix
// before
query.processDefinitionNameLike(request.getNameLike()); // NPE-ish if absent
// after
if (request.getNameLike() != null) {
query.processDefinitionNameLike(request.getNameLike());
} Defensive patterns
Strategy: validation
Validate before calling
if (nameLike == null) throw new IllegalArgumentException("nameLike pattern is required");
query.processDefinitionNameLike(nameLike); Type guard
boolean isValidPattern(String s) { return s != null && !s.isEmpty(); } Try / catch
try {
query.processDefinitionNameLike(nameLike);
} catch (ActivitiIllegalArgumentException e) {
if (e.getMessage().contains("nameLike is null")) {
throw new BadRequestException("nameLike filter must not be null");
}
throw e;
} Prevention
- Null-check optional filter inputs before applying them to the query builder
- Never forward raw request parameters into query methods without validation
- Use Optional<String> and ifPresent to apply filters conditionally
- Document which query filters are mandatory vs optional
When it happens
Trigger: Calling ProcessDefinitionQuery.processDefinitionNameLike(null) directly, or indirectly when a caller-supplied filter variable that was expected to hold a name pattern is null (e.g. nameLike = request.getParameter(...) returning null, or an unset config field passed through).
Common situations: Web/API layers forwarding query-string filters into the query builder without checking for missing parameters; refactors where a default pattern constant was removed; mapping code copying optional DTO fields into the query unconditionally.
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/a72a85b7e0d35958.
Report an issue: GitHub.