{"record":{"id":"9253086cfc98cf7f","repo":"flowable/flowable-engine","slug":"only-string-variable-values-are-supported-using-li-925308","errorCode":null,"errorMessage":"Only string variable values are supported using like, but was: ","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/history/HistoricTaskInstanceBaseResource.java","lineNumber":407,"sourceCode":"                break;\n\n            case GREATER_THAN_OR_EQUALS:\n                taskInstanceQuery.taskVariableValueGreaterThanOrEqual(variable.getName(), actualValue);\n                break;\n\n            case LESS_THAN:\n                taskInstanceQuery.taskVariableValueLessThan(variable.getName(), actualValue);\n                break;\n\n            case LESS_THAN_OR_EQUALS:\n                taskInstanceQuery.taskVariableValueLessThanOrEqual(variable.getName(), actualValue);\n                break;\n\n            case LIKE:\n                if (actualValue instanceof String) {\n                    taskInstanceQuery.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                    taskInstanceQuery.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                taskInstanceQuery.taskVariableExists(variable.getName());\n                break;\n\n            case NOT_EXISTS:\n                taskInstanceQuery.taskVariableNotExists(variable.getName());\n                break;","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java#L389-L425","documentation":"The LIKE variable operator on historic task instance queries only accepts String values; Flowable throws FlowableIllegalArgumentException with the value's class name when the supplied value is not a String.","triggerScenarios":"POST /query/historic-tasks with a taskVariables entry using operation 'like' whose value is a non-string (e.g. unquoted number or boolean).","commonSituations":"Wildcard search attempted on a numeric variable; JSON value not quoted; template that formats numbers into the like filter without string conversion.","solutions":["Quote the value in JSON: {\"operation\":\"like\",\"value\":\"%foo%\"}","Use 'equals' with an exact value for non-string types","Convert the underlying variable to String if partial matching is required"],"exampleFix":"// before\n{\"name\":\"count\",\"operation\":\"like\",\"value\":%5%}\n// after\n{\"name\":\"description\",\"operation\":\"like\",\"value\":\"%urgent%\"}","handlingStrategy":"type-guard","validationCode":"if (!(variable.getValue() instanceof String))\n    throw new IllegalArgumentException(\"like requires a String value\");","typeGuard":"boolean isStringFilter(QueryVariable v) { return v.getValue() instanceof String; }","tryCatchPattern":"try { queryTaskVariables(vars); }\ncatch (FlowableIllegalArgumentException e) { /* fall back to equals */ }","preventionTips":["Quote like values in JSON: \"%text%\"","Use equals for exact non-string matches","Store searchable text as String variables"],"tags":["rest-api","validation","type-mismatch","query-variables","flowable"],"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"}