{"record":{"id":"35d3483fe89c6b80","repo":"flowable/flowable-engine","slug":"value-only-query-without-a-variable-name-is-not-35d348","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":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/variable/HistoricVariableInstanceBaseResource.java","lineNumber":131,"sourceCode":"        }\n    }\n\n    protected void addVariables(HistoricVariableInstanceQuery variableInstanceQuery, 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.getValue() == null) {\n                throw new FlowableIllegalArgumentException(\"Variable value is missing for variable: \" + variable.getName());\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                variableInstanceQuery.variableValueEquals(variable.getName(), actualValue);\n                break;\n\n            default:\n                throw new FlowableIllegalArgumentException(\"Unsupported variable query operation: \" + variable.getVariableOperation());\n            }\n        }\n    }\n}\n","sourceCodeStart":113,"sourceCodeEnd":146,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/variable/HistoricVariableInstanceBaseResource.java#L113-L146","documentation":"Thrown as FlowableIllegalArgumentException when a variable predicate omits the name (nameless, i.e. a 'value-only' query) and the operation is not EQUALS. The CMMN history REST API only supports value-only matching with the equals operator; any other operator needs a variable name to compare against. The request is rejected with HTTP 400.","triggerScenarios":"Filter entry like {\"value\":\"done\",\"operation\":\"like\"} or {\"value\":5,\"operation\":\"greaterThan\"} without \"name\" on the historic-variable-instances query endpoint.","commonSituations":"Porting queries from the BPMN engine API that allowed value-only equals and extending them to other operators, generic query-builder UIs that allow leaving the name blank, or intent to 'search any variable with value X using like' — which the historic variable query model cannot express.","solutions":["If doing a value-only match, restrict operation to \"equals\": {\"value\":\"done\",\"operation\":\"equals\"}.","If you need like/greaterThan/etc., supply a variable name: {\"name\":\"status\",\"value\":\"done\",\"operation\":\"like\"}.","To find any variable with a given value regardless of name, iterate candidate names or fetch all instances and filter client-side; the query API does not support it.","Validate filters before sending: nameless entries are only legal with operation equals."],"exampleFix":"// before: 400 - nameless non-equals\n{\"variables\":[{\"value\":\"done\",\"operation\":\"like\"}]}\n\n// after\n{\"variables\":[{\"name\":\"status\",\"value\":\"done\",\"operation\":\"equals\"}]}","handlingStrategy":"validation","validationCode":"boolean ok = variables.stream().allMatch(v -> v.getName() != null || \"equals\".equals(v.getOperation()));\nif (!ok) { throw new IllegalArgumentException(\"nameless variable filters require operation equals\"); }","typeGuard":null,"tryCatchPattern":"try {\n    HistoricVariableInstanceListResponse r = query(variables);\n} catch (FlowableIllegalArgumentException e) {\n    // HTTP 400: value-only query with non-equals operator\n}","preventionTips":["Value-only filters are only legal with operation equals","Always supply a name for like/greaterThan/lessThan style operators","Do not assume BPMN-engine query semantics carry over to the CMMN history REST API"],"tags":["rest-api","query","validation","flowable"],"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"}