{"record":{"id":"8b9ad5b6cd98b099","repo":"flowable/flowable-engine","slug":"only-string-variable-values-are-supported-for-like-8b9ad5","errorCode":null,"errorMessage":"Only string variable values are supported for like, but was: \" + actualValue.getClass().getName()","messagePattern":"Only string variable values are supported for like, but was: \" \\+ actualValue\\.getClass\\(\\)\\.getName\\(\\)","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceBaseResource.java","lineNumber":356,"sourceCode":"                break;\n\n            case EQUALS_IGNORE_CASE:\n                if (actualValue instanceof String) {\n                    processInstanceQuery.variableValueEqualsIgnoreCase(variable.getName(), (String) actualValue);\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported when ignoring casing, but was: \" + actualValue.getClass().getName());\n                }\n                break;\n\n            case NOT_EQUALS:\n                processInstanceQuery.variableValueNotEquals(variable.getName(), actualValue);\n                break;\n\n            case LIKE:\n                if (actualValue instanceof String) {\n                    processInstanceQuery.variableValueLike(variable.getName(), (String) actualValue);\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported for like, but was: \" + actualValue.getClass().getName());\n                }\n                break;\n\n            case LIKE_IGNORE_CASE:\n                if (actualValue instanceof String) {\n                    processInstanceQuery.variableValueLikeIgnoreCase(variable.getName(), (String) actualValue);\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported for like, but was: \"\n                            + actualValue.getClass().getName());\n                }\n                break;\n\n            case GREATER_THAN:\n                processInstanceQuery.variableValueGreaterThan(variable.getName(), actualValue);\n                break;\n\n            case GREATER_THAN_OR_EQUALS:\n                processInstanceQuery.variableValueGreaterThanOrEqual(variable.getName(), actualValue);","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceBaseResource.java#L338-L374","documentation":"The LIKE variable query operation performs SQL-style pattern matching, which only makes sense for String variables. If the resolved value is not a String, addVariables throws FlowableIllegalArgumentException including the actual value's class name.","triggerScenarios":"History process instance query requests with a variable whose variableOperation is LIKE but whose value is a number, boolean, date, or other non-String type.","commonSituations":"Querying numeric variables with wildcard patterns assuming implicit conversion; passing dates to LIKE expecting string formatting; generic query builders that reuse one value type across operations.","solutions":["Use EQUALS, GREATER_THAN, etc. for non-String variables and reserve LIKE for text","Send the value as a JSON string when a textual pattern match is intended","Convert the numeric/date variable's value to a String variable in the process definition if pattern search is required"],"exampleFix":"// before\n{\"name\":\"amount\",\"type\":\"long\",\"value\":500,\"variableOperation\":\"LIKE\"}\n// after\n{\"name\":\"description\",\"value\":\"%refund%\",\"variableOperation\":\"LIKE\"}","handlingStrategy":"validation","validationCode":"if (variable.variableOperation === 'LIKE' && typeof variable.value !== 'string') throw new Error('LIKE requires a string value');","typeGuard":"const isString = (v) => typeof v === 'string';","tryCatchPattern":"catch (e) { if (e.response && e.response.status === 400) { console.error(e.response.data.message); } throw e; }","preventionTips":["Reserve LIKE/LIKE_IGNORE_CASE for string variables","Add wildcard patterns as strings with % escapes","Restrict operation choices in UI by variable type"],"tags":["rest-api","query-variables","like-operator","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"}