flowable/flowable-engine · error · FlowableIllegalArgumentException
keyLike is null
Error message
keyLike is null
What it means
FlowableIllegalArgumentException thrown by CaseDefinitionQueryImpl.caseDefinitionKeyLike(String) when the key like-pattern is null. Like filters require an actual pattern with optional SQL wildcards; null is rejected eagerly. Omit the setter to match all case definitions.
Source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CaseDefinitionQueryImpl.java:188
throw new FlowableIllegalArgumentException("parentDeploymentId is null");
}
this.parentDeploymentId = parentDeploymentId;
return this;
}
@Override
public CaseDefinitionQueryImpl caseDefinitionKey(String key) {
if (key == null) {
throw new FlowableIllegalArgumentException("key is null");
}
this.key = key;
return this;
}
@Override
public CaseDefinitionQueryImpl caseDefinitionKeyLike(String keyLike) {
if (keyLike == null) {
throw new FlowableIllegalArgumentException("keyLike is null");
}
this.keyLike = keyLike;
return this;
}
@Override
public CaseDefinitionQueryImpl caseDefinitionResourceName(String resourceName) {
if (resourceName == null) {
throw new FlowableIllegalArgumentException("resourceName is null");
}
this.resourceName = resourceName;
return this;
}
@Override
public CaseDefinitionQueryImpl caseDefinitionResourceNameLike(String resourceNameLike) {
if (resourceNameLike == null) {
throw new FlowableIllegalArgumentException("resourceNameLike is null");View on GitHub (pinned to d6d39ce1c6)
Solutions
- Pass a non-null pattern, e.g. caseDefinitionKeyLike("invoice-%").
- Guard: only call caseDefinitionKeyLike when the pattern is non-null (and non-empty if desired).
- Default the pattern upstream if a wildcard match-all is actually intended.
Example fix
// before
query.caseDefinitionKeyLike(keyPattern); // may be null
// after
if (keyPattern != null && !keyPattern.isEmpty()) {
query.caseDefinitionKeyLike(keyPattern);
} Defensive patterns
Strategy: validation
Validate before calling
if (keyLike != null && !keyLike.isEmpty()) {
query.caseDefinitionKeyLike(keyLike);
} Type guard
boolean hasPattern = keyLike != null && !keyLike.isEmpty();
Try / catch
try {
query.caseDefinitionKeyLike(keyLike);
} catch (FlowableIllegalArgumentException e) {
// null pattern — fall back to unfiltered query
} Prevention
- Build patterns defensively (prefix + user fragment + '%') only when the fragment is non-null.
- Centralize optional-filter application in a helper to avoid repeating null checks.
When it happens
Trigger: Calling caseDefinitionQuery.caseDefinitionKeyLike(null) from an uninitialized pattern variable or an absent search input.
Common situations: Search screens and batch selectors that build key patterns dynamically; the pattern variable stayed null when the input was empty or the config value missing.
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/46ac8b9cf317b9d5.
Report an issue: GitHub.