{"record":{"id":"bb09247248fd3b21","repo":"flowable/flowable-engine","slug":"only-string-variable-values-are-supported-using-li","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-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/task/HistoricTaskInstanceBaseResource.java","lineNumber":388,"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":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/task/HistoricTaskInstanceBaseResource.java#L370-L406","documentation":"The CMMN historic task query REST endpoint applies a variable filter with the LIKE operation, but LIKE can only be expressed on string variable values. In HistoricTaskInstanceBaseResource.addTaskVariables the code checks `actualValue instanceof String` and throws FlowableIllegalArgumentException when the deserialized variable value is any other type. This is a hard constraint of the underlying taskInstanceQuery.taskVariableValueLike API.","triggerScenarios":"Calling GET /cmmn-history/historic-task-instances with a query variable whose variableOperation=LIKE (or via the taskVariable filter parameter) while the variable value deserializes to a non-string type such as Integer, Long, Boolean, Date or Double.","commonSituations":"Clients reuse the same request body across numeric and string filters; JSON sends unquoted numbers (e.g. 123 instead of \"123\") with operation LIKE; a query builder UI always emits LIKE regardless of variable type.","solutions":["Quote the variable value in the JSON query so it is parsed as a String (e.g. \"123\" instead of 123).","Change variableOperation to EQUALS / GREATER_THAN / LESS_THAN, which support non-string types.","Ensure restResponseFactory.getVariableValue infers a string type for this variable (check the type field sent with the variable).","Catch FlowableIllegalArgumentException on the client and fall back to an equals query."],"exampleFix":"// before\n{\"name\": \"priority\", \"value\": 10, \"variableOperation\": \"LIKE\"}\n// after\n{\"name\": \"priority\", \"value\": \"10\", \"variableOperation\": \"LIKE\"}","handlingStrategy":"validation","validationCode":"// Java client-side\nif (\"LIKE\".equals(v.getVariableOperation()) && !(v.getValue() instanceof String)) {\n    throw new IllegalArgumentException(\"LIKE requires a string value for variable: \" + v.getName());\n}","typeGuard":null,"tryCatchPattern":"try { result = historicTaskApi.queryTasks(query); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().contains(\"Only string variable values are supported using like\")) { /* retry with EQUALS */ } else { throw e; } }","preventionTips":["Quote string values in query-variable JSON payloads.","Restrict LIKE/LIKE_IGNORE_CASE to string-typed variables in your query builder.","Document variable type per filter in API client code."],"tags":["rest-api","query","variables","like-operator","type-constraint"],"backgroundTag":"incompatible-source-type","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}