flowable/flowable-engine · error · FlowableIllegalArgumentException

Only string variable values are supported using like, but…

Error message

Only string variable values are supported using like, but was: ${type}

What it means

The like variable operation performs SQL-style pattern matching, which requires a string value. Flowable throws FlowableIllegalArgumentException when the variable value used with LIKE is not a java.lang.String. Raised in TaskBaseResource.addTaskvariables in the LIKE branch.

Solutions

  1. Send the like pattern as a JSON string, e.g. "value":"100%".
  2. Use equals/notEquals for exact non-string matching.
  3. Restrict like filters to string-typed variables in the client UI.

Example fix

// before
{"name":"amount","operation":"like","value":100}
// after
{"name":"note","operation":"like","value":"%urgent%"}
Defensive patterns

Strategy: validation

Validate before calling

for (const v of body.taskVariables || []) {
  if (v.operation === 'like' && typeof v.value !== 'string') {
    throw new Error('like requires a string pattern 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":"amount","operation":"like","value":100}]} — a numeric, boolean, or object value with operation like.

Common situations: Using LIKE as a synonym for equals against numeric variables; forgetting to wrap the pattern in quotes; generic filter builders that don't restrict LIKE to text fields.

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/b6cbd2a37e7ead61. 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:431

                break;

            case GREATER_THAN_OR_EQUALS:
                taskQuery.taskVariableValueGreaterThanOrEqual(variable.getName(), actualValue);
                break;

            case LESS_THAN:
                taskQuery.taskVariableValueLessThan(variable.getName(), actualValue);
                break;

            case LESS_THAN_OR_EQUALS:
                taskQuery.taskVariableValueLessThanOrEqual(variable.getName(), actualValue);
                break;

            case LIKE:
                if (actualValue instanceof String) {
                    taskQuery.taskVariableValueLike(variable.getName(), (String) actualValue);
                } else {
                    throw new FlowableIllegalArgumentException("Only string variable values are supported using like, but was: " + actualValue.getClass().getName());
                }
                break;

            case LIKE_IGNORE_CASE:
                if (actualValue instanceof String) {
                    taskQuery.taskVariableValueLikeIgnoreCase(variable.getName(), (String) actualValue);
                } else {
                    throw new FlowableIllegalArgumentException("Only string variable values are supported using like, but was: " + actualValue.getClass().getName());
                }
                break;

            case EXISTS:
                taskQuery.taskVariableExists(variable.getName());
                break;

            case NOT_EXISTS:
                taskQuery.taskVariableNotExists(variable.getName());
                break;

View on GitHub (pinned to d6d39ce1c6)