{"record":{"id":"f492f3aeeca99318","repo":"flowable/flowable-engine","slug":"value-only-query-without-a-variable-name-is-only-f492f3","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":409,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/planitem/PlanItemInstanceBaseResource.java","lineNumber":163,"sourceCode":"        return paginateList(requestParams, queryRequest, query, \"createTime\", allowedSortProperties, restResponseFactory::createPlanItemInstanceResponseList);\n    }\n\n    protected void addVariables(PlanItemInstanceQuery planItemInstanceQuery, List<QueryVariable> variables, boolean isCase) {\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 && 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                    if (isCase) {\n                        planItemInstanceQuery.caseVariableValueEquals(actualValue);\n                    } else {\n                        planItemInstanceQuery.variableValueEquals(actualValue);\n                    }\n                } else {\n                    if (isCase) {\n                        planItemInstanceQuery.caseVariableValueEquals(variable.getName(), actualValue);\n                    } else {\n                        planItemInstanceQuery.variableValueEquals(variable.getName(), actualValue);\n                    }\n                }","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/planitem/PlanItemInstanceBaseResource.java#L145-L181","documentation":"When a QueryVariable has no name (a 'value-only query', meant to match plan item instances having ANY variable equal to the given value), Flowable restricts the operation to EQUALS. Any other operation (LIKE, GREATER_THAN, etc.) combined with a null name makes the query ambiguous, so addVariables throws FlowableIllegalArgumentException.","triggerScenarios":"Sending a plan-item-instance query with a variable filter where 'name' is null/absent and 'variableOperation' is anything other than 'equals' (e.g. like, notEquals, greaterThan).","commonSituations":"Copying a value-only example and changing the operation to 'like'; generic query builders that always omit the name field when the user didn't type one.","solutions":["Set variableOperation to 'equals' when omitting the variable name.","Add an explicit variable name if you need LIKE, NOT_EQUALS, or range comparisons.","Validate name/operation combinations before sending the request."],"exampleFix":"// before\n{\"name\":null,\"variableOperation\":\"like\",\"value\":\"order%\"}\n// after\n{\"name\":\"orderNumber\",\"variableOperation\":\"like\",\"value\":\"order%\"}","handlingStrategy":"validation","validationCode":"if (!filters.every(f => f.name != null ? true : f.variableOperation === 'equals')) throw new Error('Nameless variable filters require equals');","typeGuard":"const isValueOnlyEquals = (f) => f.name == null && f.variableOperation === 'equals';","tryCatchPattern":"try { await query(body); } catch (e) { if (e.status === 400 && /Value-only query/.test(e.message)) { body.variables = body.variables.map(f => f.name ? f : {...f, variableOperation: 'equals'}); } else { throw e; } }","preventionTips":["Only omit the name for equality lookups","Encode operation constraints alongside the filter in your query builder API"],"tags":["rest-api","query-parameters","validation"],"backgroundTag":"conflicting-config-options","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}