{"record":{"id":"d08c96c7c199be94","repo":"flowable/flowable-engine","slug":"value-only-query-without-a-variable-name-is-only","errorCode":null,"errorMessage":"Value-only query (without a variable-name) is only supported when using 'equals' operation.","messagePattern":"Value-only query \\(without a variable-name\\) is only supported when using 'equals' operation\\.","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceBaseResource.java","lineNumber":325,"sourceCode":"\n    protected void addVariables(HistoricCaseInstanceQuery caseInstanceQuery, 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 && variable.getVariableOperation() != QueryVariableOperation.EQUALS) {\n                throw new FlowableIllegalArgumentException(\"Value-only query (without a variable-name) is only supported when using 'equals' operation.\");\n            }\n\n            switch (variable.getVariableOperation()) {\n\n            case EQUALS:\n                if (nameLess) {\n                    caseInstanceQuery.variableValueEquals(actualValue);\n                } else {\n                    caseInstanceQuery.variableValueEquals(variable.getName(), actualValue);\n                }\n                break;\n\n            case EQUALS_IGNORE_CASE:\n                if (actualValue instanceof String) {\n                    caseInstanceQuery.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                }","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceBaseResource.java#L307-L343","documentation":"FlowableIllegalArgumentException for value-only variable queries: omitting the variable name is allowed only with the 'equals' operation, because any other comparator is meaningless without a name to match on.","triggerScenarios":"POST query with {\"value\":\"abc\",\"operation\":\"like\"} (or any non-equals operation) and no \"name\".","commonSituations":"Searching for any variable holding a given value: users generalize the pattern and swap equals for like/greaterThan while still omitting name.","solutions":["Keep operation \"equals\" when querying by value only","Add a variable \"name\" if you need like/notEquals/greaterThan semantics","Split the query into an equals-by-value request plus follow-up filtering","Validate: name==null implies operation must be equals"],"exampleFix":"// before\n{\"value\":\"abc\",\"operation\":\"like\"}\n// after\n{\"value\":\"abc\",\"operation\":\"equals\"} // or add \"name\":\"myVar\"","handlingStrategy":"validation","validationCode":"if (name == null && !\"equals\".equals(operation))\n  throw new IllegalArgumentException(\"Value-only query requires equals operation\");","typeGuard":"boolean validValueOnlyQuery(Map<String,Object> v) {\n  return v.get(\"name\") != null || \"equals\".equals(v.get(\"operation\"));\n}","tryCatchPattern":"try { ... } catch (FlowableIllegalArgumentException e) {\n  return badRequest(\"Unsupported value-only query: \" + e.getMessage());\n}","preventionTips":["Remember nameless queries support only equals","Add a name when using other comparators","Encode this constraint in your query builder"],"tags":["rest-api","validation","query","unsupported-combination"],"backgroundTag":"unsupported-operation","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"}