flowable/flowable-engine · error · org.flowable.common.engine.api.FlowableIllegalArgumentException

variableNameLike is null

Error message

variableNameLike is null

What it means

HistoricVariableInstanceQuery.variableNameLike() throws FlowableIllegalArgumentException when the variableNameLike argument is null. Name-like filtering of historic variable instances requires a pattern string; a null pattern is treated as a programming/caller error and rejected immediately.

Solutions

  1. Pass a non-null pattern string, using % wildcards as needed (e.g. "%amount%").
  2. Only call variableNameLike when the pattern is non-null/empty; omit the filter otherwise.
  3. If an exact name match is needed, use variableName(...) instead.
  4. Trace where the pattern value originates and add validation at that boundary.

Example fix

// before
query.variableNameLike(namePattern);

// after
if (namePattern != null && !namePattern.isEmpty()) {
    query.variableNameLike("%" + namePattern + "%");
}
Defensive patterns

Strategy: validation

Validate before calling

if (namePattern == null || namePattern.isEmpty()) {
    throw new IllegalArgumentException("namePattern must be non-null before variableNameLike");
}

Try / catch

try {
    query.variableNameLike(pattern);
} catch (FlowableIllegalArgumentException e) {
    // proceed without the name filter
}

Prevention

When it happens

Trigger: Calling historicVariableInstanceQuery.variableNameLike(null), typically with a pattern built from user input or configuration that was never assigned.

Common situations: A search form's 'name contains' field left blank and passed straight through; string concatenation producing the pattern returned null from a helper; property/placeholder not resolved in the environment.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/2bd3bb258e6ed382. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/HistoricVariableInstanceQueryImpl.java:245

    }

    @Override
    public HistoricVariableInstanceQuery variableValueLikeIgnoreCase(String variableName, String variableValue) {
        if (variableName == null) {
            throw new FlowableIllegalArgumentException("variableName is null");
        }
        if (variableValue == null) {
            throw new FlowableIllegalArgumentException("variableValue is null");
        }
        this.variableName = variableName;
        queryVariableValue = new QueryVariableValue(variableName, variableValue.toLowerCase(), QueryOperator.LIKE_IGNORE_CASE, true);
        return this;
    }

    @Override
    public HistoricVariableInstanceQuery variableNameLike(String variableNameLike) {
        if (variableNameLike == null) {
            throw new FlowableIllegalArgumentException("variableNameLike is null");
        }
        this.variableNameLike = variableNameLike;
        return this;
    }
    
    @Override
    public HistoricVariableInstanceQuery scopeId(String scopeId) {
        this.scopeId = scopeId;
        return this;
    }
    
    @Override
    public HistoricVariableInstanceQuery scopeIds(Collection<String> scopeIds) {
        if (scopeIds == null || scopeIds.isEmpty()) {
            throw new FlowableIllegalArgumentException("scopeIds is empty");
        }
        this.scopeIds = scopeIds;
        return this;

View on GitHub (pinned to d6d39ce1c6)