flowable/flowable-engine · error · FlowableIllegalArgumentException

Only string variable values are supported when ignoring…

Error message

Only string variable values are supported when ignoring casing, but was: ${type}

What it means

The equalsIgnoreCase variable operation is only defined for string values, since case-insensitive comparison requires a textual value. Flowable throws FlowableIllegalArgumentException when the deserialized variable value is not a java.lang.String. Raised in TaskBaseResource.addTaskvariables when handling the EQUALS_IGNORE_CASE case of the switch.

Solutions

  1. Send the value as a JSON string, e.g. "value":"3" instead of "value":3.
  2. Use the plain equals operation for non-string values.
  3. Coerce the value to a string on the client before building the query.

Example fix

// before
{"name":"level","operation":"equalsIgnoreCase","value":3}
// after
{"name":"level","operation":"equalsIgnoreCase","value":"three"}
Defensive patterns

Strategy: validation

Validate before calling

for (const v of body.taskVariables || []) {
  if (v.operation === 'equalsIgnoreCase' && typeof v.value !== 'string') {
    throw new Error('equalsIgnoreCase requires a string value for variable ' + v.name);
  }
}

Type guard

const isStringValued = v => typeof v.value === 'string';

Prevention

When it happens

Trigger: POST /cmmn-query/tasks with {"taskVariables":[{"name":"level","operation":"equalsIgnoreCase","value":3}]} — any non-string JSON value (number, boolean, array, object) with operation equalsIgnoreCase.

Common situations: Passing numeric or boolean variables to case-insensitive filters, JSON clients that send unquoted numbers where a string was intended, generic search UIs that apply 'ignore case' to every filter.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskBaseResource.java:395

            if (nameLess && variable.getVariableOperation() != QueryVariableOperation.EQUALS) {
                throw new FlowableIllegalArgumentException("Value-only query (without a variable-name) is only supported when using 'equals' operation.");
            }

            switch (variable.getVariableOperation()) {

            case EQUALS:
                if (nameLess) {
                    taskQuery.taskVariableValueEquals(actualValue);
                } else {
                    taskQuery.taskVariableValueEquals(variable.getName(), actualValue);
                }
                break;

            case EQUALS_IGNORE_CASE:
                if (actualValue instanceof String) {
                    taskQuery.taskVariableValueEqualsIgnoreCase(variable.getName(), (String) actualValue);
                } else {
                    throw new FlowableIllegalArgumentException("Only string variable values are supported when ignoring casing, but was: " + actualValue.getClass().getName());
                }
                break;

            case NOT_EQUALS:
                taskQuery.taskVariableValueNotEquals(variable.getName(), actualValue);
                break;

            case NOT_EQUALS_IGNORE_CASE:
                if (actualValue instanceof String) {
                    taskQuery.taskVariableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);
                } else {
                    throw new FlowableIllegalArgumentException("Only string variable values are supported when ignoring casing, but was: " + actualValue.getClass().getName());
                }
                break;

            case GREATER_THAN:
                taskQuery.taskVariableValueGreaterThan(variable.getName(), actualValue);
                break;

View on GitHub (pinned to d6d39ce1c6)