flowable/flowable-engine · error · ActivitiException
Cannot change fixed value
Error message
Cannot change fixed value
What it means
FixedValue wraps a literal value injected into a delegate (e.g. a field on a JavaDelegate or a DelegateExpression) that is intentionally constant. Its setValue method always throws because a fixed value cannot be assigned at runtime. The library throws this to signal that someone is trying to write to what is a read-only, statically-configured expression.
Solutions
- If the field should be assignable, change the BPMN field injection from a literal to an expression, e.g. <flow:field name="x" expression="${myVar}"/>.
- Remove code/assignment attempts that write to fields configured as fixed values; treat them as constants.
- Use an Expression instead of FixedValue when you need read-write semantics.
Example fix
<!-- before: literal, not assignable -->
<flow:field name="amount" stringValue="100"/>
<!-- after: expression, assignable -->
<flow:field name="amount" expression="${amountVar}"/> Defensive patterns
Strategy: validation
Validate before calling
// In a custom ELResolver or field-injection helper, reject writes to literal expressions:
if (expression instanceof FixedValue) {
throw new IllegalArgumentException("Field 'x' is configured as a fixed literal and cannot be assigned");
} Type guard
boolean isWritable(org.activiti.engine.impl.el.Expression e) {
return !(e instanceof org.activiti.engine.impl.el.FixedValue);
} Try / catch
try {
fixedValue.setValue(newValue, container);
} catch (ActivitiException e) {
// value is a constant; use the expression's getValue instead
} Prevention
- Treat literal field injections (stringValue=) as constants; never assign to them in delegates.
- Use expression= (JUEL) instead of literals when a field must be updated.
- Review delegate setters for assignments to injected fields.
When it happens
Trigger: Calling setValue(...) on a FixedValue instance — typically the UEL/EL resolver assigning a variable into a delegate field whose configured expression is a literal (value="..." in flow:field) rather than ${...} or #{...}.
Common situations: BPMN field injection with literal values being written back by the delegate, or framework code attempting to assign a value into an injected field expression that was configured as a constant.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Can only use a collection of String elements for…
- Cannot change fixed value with
- Cannot resolve calledElement expression
- Cannot set value of '', it resolves to a bean defined in…
- Cannot set value of '', it's readonly!
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/5223bb037fbd23ee.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/el/FixedValue.java:41
* @author Frederik Heremans
*/
public class FixedValue implements Expression {
private static final long serialVersionUID = 1L;
private Object value;
public FixedValue(Object value) {
this.value = value;
}
@Override
public Object getValue(VariableContainer variableContainer) {
return value;
}
@Override
public void setValue(Object value, VariableContainer variableContainer) {
throw new ActivitiException("Cannot change fixed value");
}
@Override
public String getExpressionText() {
return value.toString();
}
}
View on GitHub (pinned to d6d39ce1c6)