{"record":{"id":"d2eee0968c1c5692","repo":"flowable/flowable-engine","slug":"value-only-query-without-a-variable-name-is-only-d2eee0","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-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceBaseResource.java","lineNumber":327,"sourceCode":"\n    protected void addVariables(HistoricProcessInstanceQuery processInstanceQuery, 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                    processInstanceQuery.variableValueEquals(actualValue);\n                } else {\n                    processInstanceQuery.variableValueEquals(variable.getName(), actualValue);\n                }\n                break;\n\n            case EQUALS_IGNORE_CASE:\n                if (actualValue instanceof String) {\n                    processInstanceQuery.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":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceBaseResource.java#L309-L345","documentation":"Querying historic process instances by variable value without a variable name (a value-only search across all variables) is only meaningful with the EQUALS operation. addVariables throws FlowableIllegalArgumentException when the variable name is null but the operation is anything other than equals.","triggerScenarios":"GET /history/historic-process-instances with a nameless variable filter combined with a non-equals operation, e.g. variable=|like|%foo% or |gt|10.","commonSituations":"Client UI allows selecting an operator without entering a variable name; generic query builders that omit the name when unknown; experimenting with value-only search using the wrong operator.","solutions":["Use the equals operation for value-only queries: variable=|equals|someValue","Provide a variable name if you need like/gt/lt or other operations","Catch FlowableIllegalArgumentException (HTTP 400) and enforce the name+operation rule in the client"],"exampleFix":"// before\nGET /history/historic-process-instances?variable=|like|%acme%\n\n// after\nGET /history/historic-process-instances?variable=customerName|like|%acme%","handlingStrategy":"validation","validationCode":"if (variables.some(v => (v.name == null || v.name === '') && v.operation !== 'equals')) {\n  throw new Error('Value-only queries require the equals operation');\n}","typeGuard":"function isLegalValueOnlyQuery(v) { return v.name != null || v.operation === 'equals'; }","tryCatchPattern":"try { return await queryHistoricInstances(vars); } catch (e) { if (e.status === 400 && /Value-only query/.test(e.message)) switchToEqualsOrAddName(vars); else throw e; }","preventionTips":["Enforce name+operator pairing in query-builder UIs","Restrict operator choices when no variable name is entered","Document the value-only equals limitation in client SDKs"],"tags":["rest-api","flowable","query-parameter","validation"],"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-18T11:17:12.947Z"}