{"record":{"id":"d85c8e27acb62383","repo":"flowable/flowable-engine","slug":"value-only-query-without-a-variable-name-is-not-d85c8e","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-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java","lineNumber":358,"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":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java#L340-L376","documentation":"A nameless (value-only) variable filter, where only the value is supplied, is rejected for historic task queries. Flowable requires a variable name on every task variable query predicate and throws FlowableIllegalArgumentException.","triggerScenarios":"POST query on historic task instances with a taskVariables entry that has a value but no 'name' property (variable.getName()==null) in addTaskVariables.","commonSituations":"Client assumes value-only search like some other query APIs support; JSON body builder drops empty name field; template expansion left name blank.","solutions":["Always include the variable 'name' in the filter object","Remove the value-only entry and use a different search mechanism (e.g. query by process variables at process level if supported)","Validate the request body client-side before posting"],"exampleFix":"// before\n{\"taskVariables\":[{\"operation\":\"equals\",\"value\":\"foo\"}]}\n// after\n{\"taskVariables\":[{\"name\":\"myVar\",\"operation\":\"equals\",\"value\":\"foo\"}]}","handlingStrategy":"validation","validationCode":"if (variable.getName() == null)\n    throw new IllegalArgumentException(\"variable name required in historic task query filter\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set the variable name in query filters","Reject nameless filters in client-side request builders","Review JSON payloads for empty name properties"],"tags":["rest-api","validation","query-variables","flowable"],"backgroundTag":"missing-required-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}