flowable/flowable-engine · error · UnsupportedOperationException
Setting localized name is not supported for read only delega
Error message
Setting localized name is not supported for read only delegate execution
What it means
ReadOnlyDelegatePlanItemInstance forbids all state mutation; setLocalizedName throws UnsupportedOperationException because changing the localized display name would modify case model state during a read-only delegate execution.
Source
Thrown at modules/flowable-cmmn-api/src/main/java/org/flowable/cmmn/api/delegate/ReadOnlyDelegatePlanItemInstance.java:48
return planItem.getPlanItemDefinition();
}
return null;
}
@Override
default void setVariable(String variableName, Object variableValue) {
throw new UnsupportedOperationException("Setting variable is not supported for read only delegate execution");
}
@Override
default void setTransientVariable(String variableName, Object variableValue) {
throw new UnsupportedOperationException("Setting transient variable is not supported for read only delegate execution");
}
@Override
default void setLocalizedName(String localizedName) {
throw new UnsupportedOperationException("Setting localized name is not supported for read only delegate execution");
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Remove the setLocalizedName call in read-only contexts
- Guard the write with an instanceof ReadOnlyDelegatePlanItemInstance check
- Set the localized name at design time in the CMMN model or via a writable delegate context
Example fix
// before
planItemInstance.setLocalizedName("My Task " + suffix);
// after
if (!(planItemInstance instanceof ReadOnlyDelegatePlanItemInstance)) {
planItemInstance.setLocalizedName("My Task " + suffix);
} Defensive patterns
Strategy: type-guard
Validate before calling
boolean canRename = !(planItemInstance instanceof ReadOnlyDelegatePlanItemInstance);
Type guard
if (planItemInstance instanceof ReadOnlyDelegatePlanItemInstance) return; // no mutation allowed
Try / catch
try { planItemInstance.setLocalizedName(name); } catch (UnsupportedOperationException e) { log.warn("Cannot set localized name in read-only context"); } Prevention
- Set localized names at design time in the CMMN model
- Check the delegate interface docs to confirm which methods are read-only
- Avoid reusing writable-delegate code in read-only listener contexts
When it happens
Trigger: Calling setLocalizedName(...) on the DelegatePlanItemInstance inside a read-only delegate execution (e.g. lifecycle/audit listeners that receive read-only plan item instances).
Common situations: Attempting dynamic renaming of a plan item from a listener; porting code that customized names in a writable context to a read-only listener.
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
- Setting transient variable is not supported for read only de
- org.flowable.cdi.impl.ProcessVariableMap.size() is not suppo
- org.flowable.cdi.impl.ProcessVariableMap.isEmpty() is not su
- org.flowable.cdi.impl.ProcessVariableMap.containsKey() is no
- org.flowable.cdi.impl.ProcessVariableMap.containsValue() is
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/533aaf1f840eff7f.
Report an issue: GitHub.