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

Only string values can be used with 'not equals ignore…

Error message

Only string values can be used with 'not equals ignore case' condition

What it means

NOT_EQUALS_IGNORE_CASE in Flowable variable queries requires a String value; any other type triggers this FlowableIllegalArgumentException in AbstractVariableQueryImpl.addVariable. The operator compiles to a case-insensitive SQL inequality, which is only defined for text variables. It is thrown immediately when the clause is added.

Solutions

  1. Pass a String value, converting if appropriate (String.valueOf)
  2. Use variableValueNotEquals for non-string types
  3. Check value instanceof String before calling the ignore-case variant
  4. Store the variable as a string if case-insensitive matching is required

Example fix

// before
q.variableValueNotEqualsIgnoreCase("status", 42);
// after
q.variableValueNotEqualsIgnoreCase("status", "42"); // or variableValueNotEquals for numbers
Defensive patterns

Strategy: type-guard

Validate before calling

if (!(value instanceof String)) {
    throw new IllegalArgumentException("notEqualsIgnoreCase requires a String value");
}
query.variableValueNotEqualsIgnoreCase(name, (String) value);

Type guard

static boolean isText(Object v) {
    return v instanceof String;
}

Try / catch

try {
    query.variableValueNotEqualsIgnoreCase(name, value);
} catch (org.flowable.common.engine.api.FlowableIllegalArgumentException e) {
    query.variableValueNotEquals(name, value);
}

Prevention

When it happens

Trigger: Calling variableValueNotEqualsIgnoreCase (or scoped variants) with a non-String value such as Integer, Long, Boolean or null.

Common situations: Swapping notEquals for notEqualsIgnoreCase without changing the value type; enum/number variables queried with case-insensitive intent; generic filters applying ignore-case to all variables.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/AbstractVariableQueryImpl.java:323

            switch (operator) {
                case GREATER_THAN:
                    throw new FlowableIllegalArgumentException("Booleans and null cannot be used in 'greater than' condition");
                case LESS_THAN:
                    throw new FlowableIllegalArgumentException("Booleans and null cannot be used in 'less than' condition");
                case GREATER_THAN_OR_EQUAL:
                    throw new FlowableIllegalArgumentException("Booleans and null cannot be used in 'greater than or equal' condition");
                case LESS_THAN_OR_EQUAL:
                    throw new FlowableIllegalArgumentException("Booleans and null cannot be used in 'less than or equal' condition");
                default:
                    break;
            }

            if (operator == QueryOperator.EQUALS_IGNORE_CASE && !(value instanceof String)) {
                throw new FlowableIllegalArgumentException("Only string values can be used with 'equals ignore case' condition");
            }

            if (operator == QueryOperator.NOT_EQUALS_IGNORE_CASE && !(value instanceof String)) {
                throw new FlowableIllegalArgumentException("Only string values can be used with 'not equals ignore case' condition");
            }

            if ((operator == QueryOperator.LIKE || operator == QueryOperator.LIKE_IGNORE_CASE) && !(value instanceof String)) {
                throw new FlowableIllegalArgumentException("Only string values can be used with 'like' condition");
            }
        }

        queryVariableValues.add(new QueryVariableValue(name, value, operator, localScope, scopeType));
    }

    protected boolean isBoolean(Object value) {
        if (value == null) {
            return false;
        }
        return Boolean.class.isAssignableFrom(value.getClass()) || boolean.class.isAssignableFrom(value.getClass());
    }

    protected void ensureVariablesInitialized() {

View on GitHub (pinned to d6d39ce1c6)