{"record":{"id":"625a7fb2b62116c6","repo":"flowable/flowable-engine","slug":"value-only-query-without-a-variable-name-is-not","errorCode":null,"errorMessage":"Value-only query (without a variable-name) is not supported.","messagePattern":"Value-only query \\(without a variable-name\\) is not supported\\.","errorType":"validation","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":339,"sourceCode":"\n    protected void addTaskVariables(HistoricTaskInstanceQuery taskInstanceQuery, List<QueryVariable> variables) {\n        for (QueryVariable variable : variables) {\n            if (variable.getVariableOperation() == null) {\n                throw new FlowableIllegalArgumentException(\"Variable operation is missing for variable: \" + variable.getName());\n            }\n            if (variable.getVariableOperation() != QueryVariableOperation.EXISTS && variable.getVariableOperation() != QueryVariableOperation.NOT_EXISTS) {\n                if (variable.getValue() == null) {\n                    throw new FlowableIllegalArgumentException(\"Variable value is missing for variable: \" + variable.getName());\n                }\n            }\n\n            boolean nameLess = variable.getName() == null;\n\n            Object actualValue = restResponseFactory.getVariableValue(variable);\n\n            // A value-only query is only possible using equals-operator\n            if (nameLess) {\n                throw new FlowableIllegalArgumentException(\"Value-only query (without a variable-name) is not supported.\");\n            }\n\n            switch (variable.getVariableOperation()) {\n\n            case EQUALS:\n                taskInstanceQuery.taskVariableValueEquals(variable.getName(), actualValue);\n                break;\n\n            case EQUALS_IGNORE_CASE:\n                if (actualValue instanceof String) {\n                    taskInstanceQuery.taskVariableValueEqualsIgnoreCase(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                taskInstanceQuery.taskVariableValueNotEquals(variable.getName(), actualValue);","sourceCodeStart":321,"sourceCodeEnd":357,"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#L321-L357","documentation":"FlowableIllegalArgumentException rejecting a value-only query condition (a variable with no name) in historic task instance queries. Unlike some runtime task query APIs, the historic task query does not support matching tasks purely by value without a variable name, so any nameless variable is invalid (HTTP 400).","triggerScenarios":"POST /cmmn-history/historic-task-instances/query with a variable entry lacking the 'name' field, e.g. {\"value\":\"kermit\",\"operation\":\"EQUALS\"}.","commonSituations":"Porting queries written for runtime task variable queries that allowed nameless value conditions; client models defaulting name to null; generic query builders omitting the name key.","solutions":["Always include the variable \"name\" in each variable condition: {\"name\":\"owner\",\"operation\":\"EQUALS\",\"value\":\"kermit\"}.","If you need 'any variable equals this value' semantics, issue one query per candidate variable name and merge results client-side.","Reject nameless variable conditions in your client before calling the API.","Check for client-side model bugs where the name field is lost during serialization."],"exampleFix":"// before\n{\"value\":\"kermit\",\"operation\":\"EQUALS\"}\n// after\n{\"name\":\"owner\",\"value\":\"kermit\",\"operation\":\"EQUALS\"}","handlingStrategy":"validation","validationCode":"function validateQueryVars(vars) {\n  for (const v of vars.taskVariableValues || []) {\n    if (v.name === undefined || v.name === null) {\n      throw new Error(\"value-only queries are not supported: add a variable name\");\n    }\n  }\n}","typeGuard":"const hasName = (v) => typeof v.name === 'string' && v.name.length > 0;","tryCatchPattern":null,"preventionTips":["Never omit 'name' in variable conditions for historic task queries.","Do not port nameless value-filter patterns from runtime task query APIs.","For 'any variable equals X' semantics, fan out per variable name and merge."],"tags":["flowable","rest","validation","query"],"backgroundTag":"invalid-query-parameter","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"}