flowable/flowable-engine · error · FlowableIllegalArgumentException
value is null
Error message
value is null
What it means
AbstractVariableQueryImpl.variableValueEqualsIgnoreCase validates its String value argument and throws FlowableIllegalArgumentException("value is null") when null is passed. Case-insensitive equality needs a concrete string to lowercase and compare, so null is rejected up front. The exception is thrown immediately at query-construction time, before the query is executed.
Solutions
- Check the value for null before calling variableValueEqualsIgnoreCase
- If an absent value means 'no filter', skip adding the criterion instead of passing null
- If you truly need null matching, use variableValueEquals/variableValueNotEquals (which support null) rather than the IgnoreCase variant
- Default the value to a non-null sentinel string if appropriate
Example fix
// before
query.variableValueEqualsIgnoreCase("name", filter.getName()); // NPE-ish if null
// after
if (filter.getName() != null) {
query.variableValueEqualsIgnoreCase("name", filter.getName());
} Defensive patterns
Strategy: validation
Validate before calling
if (name == null || value == null) { throw new IllegalArgumentException("name and value must be non-null"); } query.variableValueEqualsIgnoreCase(name, value); Type guard
boolean isNonEmptyString(String s) { return s != null && !s.isEmpty(); } Try / catch
try { query.variableValueEqualsIgnoreCase(name, value); } catch (FlowableIllegalArgumentException e) { throw new BadRequestException(e.getMessage()); } Prevention
- Always null-check optional filter values before query building
- Remember IgnoreCase operators do not accept null; use variableValueEquals for null matching
- Validate DTO fields at the API boundary before mapping to queries
When it happens
Trigger: Calling variableValueEqualsIgnoreCase(name, null) (or the localScope variant) on a task/historic/process variable query object.
Common situations: Building queries from user input or optional request parameters where the filter value was never populated; mapping a DTO with a null field directly into the query builder.
Related errors
- Case definition category is null
- Case definition id is null
- Case definition key is null
- name is null
- activatedBefore is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/ec1bb76a9c80a54e.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/AbstractVariableQueryImpl.java:108
protected T variableValueEquals(Object value, boolean localScope) {
queryVariableValues.add(new QueryVariableValue(null, value, QueryOperator.EQUALS, localScope));
return (T) this;
}
@SuppressWarnings("unchecked")
protected T scopedVariableValueEquals(Object value, String scopeType) {
queryVariableValues.add(new QueryVariableValue(null, value, QueryOperator.EQUALS, false, scopeType));
return (T) this;
}
public T variableValueEqualsIgnoreCase(String name, String value) {
return variableValueEqualsIgnoreCase(name, value, true);
}
@SuppressWarnings("unchecked")
protected T variableValueEqualsIgnoreCase(String name, String value, boolean localScope) {
if (value == null) {
throw new FlowableIllegalArgumentException("value is null");
}
addVariable(name, value.toLowerCase(), QueryOperator.EQUALS_IGNORE_CASE, localScope);
return (T) this;
}
@SuppressWarnings("unchecked")
protected T scopedVariableValueEqualsIgnoreCase(String name, String value, String scopeType) {
if (value == null) {
throw new FlowableIllegalArgumentException("value is null");
}
addVariable(name, value.toLowerCase(), QueryOperator.EQUALS_IGNORE_CASE, scopeType, false);
return (T) this;
}
public T variableValueNotEqualsIgnoreCase(String name, String value) {
return variableValueNotEqualsIgnoreCase(name, value, true);
}
View on GitHub (pinned to d6d39ce1c6)