{"record":{"id":"289a56a786fcaf10","repo":"flowable/flowable-engine","slug":"only-string-variable-values-are-supported-using-li-289a56","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/runtime/task/TaskBaseResource.java","lineNumber":527,"sourceCode":"                break;\n\n            case GREATER_THAN_OR_EQUALS:\n                taskQuery.processVariableValueGreaterThanOrEqual(variable.getName(), actualValue);\n                break;\n\n            case LESS_THAN:\n                taskQuery.processVariableValueLessThan(variable.getName(), actualValue);\n                break;\n\n            case LESS_THAN_OR_EQUALS:\n                taskQuery.processVariableValueLessThanOrEqual(variable.getName(), actualValue);\n                break;\n\n            case LIKE:\n                if (actualValue instanceof String) {\n                    taskQuery.processVariableValueLike(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.processVariableValueLikeIgnoreCase(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.processVariableExists(variable.getName());\n                break;\n\n            case NOT_EXISTS:\n                taskQuery.processVariableNotExists(variable.getName());\n                break;","sourceCodeStart":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskBaseResource.java#L509-L545","documentation":"LIKE variable filtering in the CMMN REST task query is only supported for String values. If a processVariables entry uses LIKE with a non-String value, addProcessvariables throws FlowableIllegalArgumentException with the value's class name.","triggerScenarios":"POST /cmmn-query/tasks with a processVariables entry whose variableOperation is LIKE and whose value is a number, boolean, object or array.","commonSituations":"Appending SQL-like wildcards to numeric variables; clients building dynamic queries assuming like works on all types; JSON values not wrapped as strings.","solutions":["Send the LIKE pattern as a JSON string (e.g. \"%42%\")","Drop the numeric/boolean like filter or use EQUALS with the exact value","Convert the value to String before querying","Review the class name in the message to fix the payload type"],"exampleFix":"// before\n{\"processVariables\":[{\"name\":\"amount\",\"value\":100,\"variableOperation\":\"LIKE\"}]}\n// after\n{\"processVariables\":[{\"name\":\"amount\",\"value\":\"%100%\",\"variableOperation\":\"LIKE\"}]}","handlingStrategy":"validation","validationCode":"if (variableOperation === 'LIKE' && typeof value !== 'string') throw new Error('LIKE requires a string pattern');","typeGuard":"const isLikeable = (v) => typeof v === 'string';","tryCatchPattern":"try { await queryTasks(req); } catch (e) { if (e.message.includes('Only string variable values are supported using like')) { /* fix payload or fall back to EQUALS */ } throw e; }","preventionTips":["Wrap LIKE patterns in JSON string quotes","Use EQUALS for numeric exact matches","Reject non-string LIKE filters in client-side query builders"],"tags":["rest","query","validation","like"],"backgroundTag":"type-mismatch","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T16:30:33.424Z"}