{"record":{"id":"7cee9b0f55eeb7e8","repo":"flowable/flowable-engine","slug":"value-only-query-without-a-variable-name-is-only-7cee9b","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/runtime/process/ExecutionBaseResource.java","lineNumber":140,"sourceCode":"        return paginateList(requestParams, queryRequest, query, \"processInstanceId\", allowedSortProperties, restResponseFactory::createExecutionResponseList);\n    }\n\n    protected void addVariables(ExecutionQuery processInstanceQuery, List<QueryVariable> variables, boolean process) {\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 (process) {\n                        processInstanceQuery.processVariableValueEquals(actualValue);\n                    } else {\n                        processInstanceQuery.variableValueEquals(actualValue);\n                    }\n                } else {\n                    if (process) {\n                        processInstanceQuery.processVariableValueEquals(variable.getName(), actualValue);\n                    } else {\n                        processInstanceQuery.variableValueEquals(variable.getName(), actualValue);\n                    }\n                }","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ExecutionBaseResource.java#L122-L158","documentation":"FlowableIllegalArgumentException thrown when a query variable omits the name (a value-only search) but uses an operation other than equals. Searching 'any variable with this value' is only implemented for the equals operator.","triggerScenarios":"POST /query/process-instances with variables:[{\"value\":\"42\",\"operation\":\"like\"}] (or notEquals, greaterThan, ignoreCase variants) and no name field.","commonSituations":"Generic query builders that treat variables uniformly and sometimes emit name-less predicates; user expects value-only search to work for all operators; migration from another engine whose query API allows it.","solutions":["Add the variable name to the predicate, keeping the desired operation.","If a value-only search is intended, change the operation to \"equals\".","Restrict the generic query builder to emit name-less variables only with equals.","Catch FlowableIllegalArgumentException (HTTP 400) and fall back to a named equals query."],"exampleFix":"// before\n{\"variables\":[{\"value\":\"42\",\"operation\":\"like\"}]}\n// after\n{\"variables\":[{\"value\":\"42\",\"operation\":\"equals\"}]}","handlingStrategy":"validation","validationCode":"for (const v of query.variables) {\n  if ((v.name === undefined || v.name === null) && v.operation !== 'equals')\n    throw new Error('Value-only query requires operation equals');\n}","typeGuard":"const isValueOnlyEquals = (v) => (v.name == null) && v.operation === 'equals';","tryCatchPattern":"try { /* query */ } catch (e) {\n  if (e.status === 400 && /Value-only query/.test(e.message)) {\n    // retry with equals or add the variable name\n  } else throw e;\n}","preventionTips":["Constrain query builders: name-less variables only with equals","Add the variable name whenever a specific operation is needed","Document this API restriction for users of your generic query UI"],"tags":["rest-api","query","validation","flowable"],"backgroundTag":"unsupported-operation","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"}