{"record":{"id":"c05a585fd4b9f3df","repo":"flowable/flowable-engine","slug":"error-value-set-rvalue-c05a58","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/AstText.java","lineNumber":59,"sourceCode":"\t\n\t@Override\n\tpublic boolean isMethodInvocation() {\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 ValueReference getValueReference(Bindings bindings, ELContext context) {\n\t\treturn null;\n\t}\n\t\n\t@Override \n\tpublic Object eval(Bindings bindings, ELContext context) {\n\t\treturn value;\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","sourceCodeStart":41,"sourceCodeEnd":77,"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/AstText.java#L41-L77","documentation":"AstText represents literal text in an EL expression. It is always read-only (isReadOnly returns true) and setValue always throws ELException because literal text is not an assignable value. The message reuses the rvalue key since text nodes are structurally rvalues.","triggerScenarios":"Calling setValue on a ValueExpression parsed from a literal string (no ${} or #{} delimiters), e.g. ValueExpression for 'hello world'.setValue(...), or flowable:expression attributes containing plain text used as an assignment target.","commonSituations":"Forgetting the ${...} wrapper so the whole string is treated as literal text; attempting to assign into a static text field in a BPMN form or expression attribute.","solutions":["Wrap the expression in ${...} so it parses as an assignable expression: '${myVar}' instead of 'myVar'.","Set variables through the engine API (delegateExecution.setVariable) rather than via EL setValue.","Check ValueExpression.isReadOnly() before calling setValue."],"exampleFix":"// before\nfactory.createValueExpression(\"myVar\", Object.class).setValue(ctx, 5); // literal text -> ELException\n// after\nfactory.createValueExpression(\"${myVar}\", Object.class).setValue(ctx, 5);","handlingStrategy":"type-guard","validationCode":"if (!expr.contains(\"${\") && !expr.contains(\"#{\")) { throw new IllegalArgumentException(\"Literal text is not settable: \" + expr); }","typeGuard":"boolean isElExpression(String s) { return s != null && (s.contains(\"${\") || s.contains(\"#{\")); }","tryCatchPattern":"try { ve.setValue(ctx, value); } catch (ELException e) { log.warn(\"Attempted to set literal text expression\"); }","preventionTips":["Always wrap variable references in ${...}","Never use plain-text attributes as assignment targets","Check ValueExpression.isReadOnly() first"],"tags":["el","expression","literal","readonly"],"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"}