{"record":{"id":"ab7725815d10035e","repo":"flowable/flowable-engine","slug":"error-value-set-rvalue-ab7725","errorCode":null,"errorMessage":"error.value.set.rvalue","messagePattern":"error\\.value\\.set\\.rvalue","errorType":"exception","errorClass":"ELException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/tree/impl/ast/AstMethod.java","lineNumber":54,"sourceCode":"\n\t@Override\n\tpublic boolean isLiteralText() {\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic Class<?> getType(Bindings bindings, ELContext context) {\n\t\treturn null;\n\t}\n\n\t@Override\n\tpublic boolean isReadOnly(Bindings bindings, ELContext context) {\n\t\treturn true;\n\t}\n\n\t@Override\n\tpublic void setValue(Bindings bindings, ELContext context, Object value) {\n\t\tthrow new ELException(LocalMessages.get(\"error.value.set.rvalue\", getStructuralId(bindings)));\n\t}\n\n\t@Override\n\tpublic MethodInfo getMethodInfo(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes) {\n\t\treturn null;\n\t}\n\n\t@Override\n\tpublic boolean isLeftValue() {\n\t\treturn false;\n\t}\n\t\n\t@Override\n\tpublic boolean isMethodInvocation() {\n\t\treturn true;\n\t}\n\t\n\t@Override","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/tree/impl/ast/AstMethod.java#L36-L72","documentation":"AstMethod represents a method invocation in an EL expression, which is a transient value. Its setValue always throws ELException('error.value.set.rvalue', i.e. 'Cannot set value of an rvalue'), because you cannot assign to the result of a method call.","triggerScenarios":"Calling ValueExpression.setValue on an expression that is a method call, e.g. setValue on ${bean.getName()}; generic framework code attempting to write through a parsed expression that is a method invocation rather than a property path.","commonSituations":"Binding frameworks that blindly call setValue on expressions; typos where a setter call should have been a property assignment ${bean.name = x}; EL expressions used as writable bindings when they are read-only.","solutions":["Replace the method-call target with a settable property expression: ${bean.name} instead of ${bean.getName()}.","Invoke a setter method via method invocation semantics instead of setValue, e.g. evaluate ${bean.setName(value)}.","Check isReadOnly()/isLiteralText on the ValueExpression before calling setValue."],"exampleFix":"// before\nve.setValue(context, \"x\"); // ve = ${obj.getName()}\n// after\n// use a property expression\nValueExpression ve2 = factory.createValueExpression(ctx, \"${obj.name}\", String.class);\nve2.setValue(context, \"x\");","handlingStrategy":"validation","validationCode":"if (valueExpression.isLiteralText() || isMethodExpression(valueExpression.getExpressionString())) {\n    throw new UnsupportedOperationException(\"Cannot set value of rvalue: \" + valueExpression.getExpressionString());\n}\n// isMethodExpression: expression ends with ')' or contains '('\n","typeGuard":"boolean isWritablePropertyExpr(String expr) {\n    String e = expr.trim();\n    return e.startsWith(\"${\") && !e.contains(\"(\") && !e.endsWith(\")\");\n}","tryCatchPattern":"try {\n    ve.setValue(context, value);\n} catch (ELException e) {\n    if (!e.getMessage().contains(\"error.value.set.rvalue\") && !e.getMessage().contains(\"rvalue\")) throw e;\n    // convert to a setter invocation or property assignment\n}","preventionTips":["Assign to property paths, not method-call results","Check isReadOnly/isLiteralText before setValue","Use EL to invoke setters (${bean.setName(v)}) rather than setValue on calls"],"tags":["el","expression-language","read-only","rvalue"],"backgroundTag":"unsupported-operation","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"}