flowable/flowable-engine · error · FlowableException

Cannot change fixed value with

Error message

Cannot change fixed value with 

What it means

FixedValue is a read-only EL value expression wrapper (e.g. used for a literal in a variable mapping). Its setValue() is intentionally unimplemented: assigning to a fixed value is not a supported operation, so it always throws this FlowableException naming the VariableContainer that attempted the write.

Source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/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 FlowableException("Cannot change fixed value with " + variableContainer);
    }

    @Override
    public String getExpressionText() {
        return value.toString();
    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Use a writable expression (a variable reference like ${myVar}) instead of a literal FixedValue where assignment happens
  2. Guard writes: only call setValue on expressions that are actually variable references
  3. Fix the BPMN XML so the literal appears only on the source/read side of a mapping
  4. If you own the code, remove the setValue call or wrap FixedValue in a read-only check via isReadOnly() before writing

Example fix

// before
expression.setValue(newValue, variableContainer); // throws
// after
if (!expression.isReadOnly(variableContainer)) {
    expression.setValue(newValue, variableContainer);
}
Defensive patterns

Strategy: type-guard

Validate before calling

// before writing through an expression
if (expression instanceof FixedValue) {
    throw new IllegalArgumentException("Cannot assign to a fixed/literal expression");
}
// or check writability first
boolean writable = !expression.isReadOnly(variableContainer);

Type guard

boolean isWritable = (expr instanceof FixedValue) == false;
if (!isWritable) { /* skip write or fail fast */ }

Try / catch

try {
    expression.setValue(newValue, variableContainer);
} catch (FlowableException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("Cannot change fixed value")) {
        logger.warn("Attempted write to a fixed value expression; ignoring");
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Expression language or Flowable's variable-scope code attempts to write through a ValueExpression backed by FixedValue, e.g. ${'literal'} used as a writable expression in an activity field, task variable mapping, or delegate code calling setValue() on it.

Common situations: Misconfigured process XML where a literal expression is placed in a destination/writable slot (task assignee write-back, out-mapping); delegate code unconditionally calling expression.setValue(...) without checking writability; copy-pasted setValue boilerplate on 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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/5515afef31a90d75. Report an issue: GitHub.