{"record":{"id":"9e634405dc018c8a","repo":"flowable/flowable-engine","slug":"only-string-variable-values-are-supported-using-li-9e6344","errorCode":null,"errorMessage":"Only string variable values are supported using like, but was: {valueClassName}","messagePattern":"Only string variable values are supported using like, but was: (.+?)","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskBaseResource.java","lineNumber":455,"sourceCode":"                break;\n\n            case GREATER_THAN_OR_EQUALS:\n                taskQuery.taskVariableValueGreaterThanOrEqual(variable.getName(), actualValue);\n                break;\n\n            case LESS_THAN:\n                taskQuery.taskVariableValueLessThan(variable.getName(), actualValue);\n                break;\n\n            case LESS_THAN_OR_EQUALS:\n                taskQuery.taskVariableValueLessThanOrEqual(variable.getName(), actualValue);\n                break;\n\n            case LIKE:\n                if (actualValue instanceof String) {\n                    taskQuery.taskVariableValueLike(variable.getName(), (String) actualValue);\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported using like, but was: \" + actualValue.getClass().getName());\n                }\n                break;\n\n            case LIKE_IGNORE_CASE:\n                if (actualValue instanceof String) {\n                    taskQuery.taskVariableValueLikeIgnoreCase(variable.getName(), (String) actualValue);\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported using like, but was: \" + actualValue.getClass().getName());\n                }\n                break;\n\n            case EXISTS:\n                taskQuery.taskVariableExists(variable.getName());\n                break;\n\n            case NOT_EXISTS:\n                taskQuery.taskVariableNotExists(variable.getName());\n                break;","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskBaseResource.java#L437-L473","documentation":"LIKE pattern matching on task variables is defined only for string values (SQL LIKE semantics). If the value of a LIKE filter resolves to a non-String type, TaskBaseResource.addTaskvariables throws this FlowableIllegalArgumentException.","triggerScenarios":"POST/GET /runtime/tasks with {\"name\":\"amount\",\"operation\":\"like\",\"value\":\"10%\"} — value is a number, failing the instanceof String check.","commonSituations":"Trying wildcard search on numeric or boolean variables; assuming Flowable coerces values to strings for LIKE; querying variables stored as Integer/Long with pattern filters.","solutions":["Convert the value to a JSON string in the request if the stored variable is actually a string","Use 'equals'/'greaterThan' etc. for non-string variables instead of LIKE","Store the data as a string variable if pattern matching is a requirement"],"exampleFix":"// before\n{\"name\":\"amount\",\"operation\":\"like\",\"value\":10}\n// after\n{\"name\":\"amount\",\"operation\":\"equals\",\"value\":10}","handlingStrategy":"validation","validationCode":"function validateLikeVar(v) {\n  if ((v.operation === 'like') && typeof v.value !== 'string') {\n    throw new Error(`like requires a string value, got ${typeof v.value}`);\n  }\n}","typeGuard":"const isLikeable = (v) => typeof v.value === 'string';","tryCatchPattern":"try {\n  const res = await flowable.queryTasks(body);\n} catch (e) {\n  if (e.message && e.message.includes('using like')) {\n    // convert value to string or use a comparison operator\n  } else throw e;\n}","preventionTips":["Only use LIKE on string variables","Remember SQL LIKE wildcards (%) only make sense for strings","If you need pattern matching on numbers, store a padded string copy of the variable"],"tags":["rest","validation","flowable","type-mismatch"],"backgroundTag":"type-mismatch","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}