{"record":{"id":"533aaf1f840eff7f","repo":"flowable/flowable-engine","slug":"setting-localized-name-is-not-supported-for-read-o","errorCode":null,"errorMessage":"Setting localized name is not supported for read only delegate execution","messagePattern":"Setting localized name is not supported for read only delegate execution","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-api/src/main/java/org/flowable/cmmn/api/delegate/ReadOnlyDelegatePlanItemInstance.java","lineNumber":48,"sourceCode":"            return planItem.getPlanItemDefinition();\n        }\n\n        return null;\n    }\n\n    @Override\n    default void setVariable(String variableName, Object variableValue) {\n        throw new UnsupportedOperationException(\"Setting variable is not supported for read only delegate execution\");\n    }\n\n    @Override\n    default void setTransientVariable(String variableName, Object variableValue) {\n        throw new UnsupportedOperationException(\"Setting transient variable is not supported for read only delegate execution\");\n    }\n\n    @Override\n    default void setLocalizedName(String localizedName) {\n        throw new UnsupportedOperationException(\"Setting localized name is not supported for read only delegate execution\");\n    }\n}\n","sourceCodeStart":30,"sourceCodeEnd":51,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-api/src/main/java/org/flowable/cmmn/api/delegate/ReadOnlyDelegatePlanItemInstance.java#L30-L51","documentation":"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.","triggerScenarios":"Calling setLocalizedName(...) on the DelegatePlanItemInstance inside a read-only delegate execution (e.g. lifecycle/audit listeners that receive read-only plan item instances).","commonSituations":"Attempting dynamic renaming of a plan item from a listener; porting code that customized names in a writable context to a read-only listener.","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"],"exampleFix":"// before\nplanItemInstance.setLocalizedName(\"My Task \" + suffix);\n// after\nif (!(planItemInstance instanceof ReadOnlyDelegatePlanItemInstance)) {\n    planItemInstance.setLocalizedName(\"My Task \" + suffix);\n}","handlingStrategy":"type-guard","validationCode":"boolean canRename = !(planItemInstance instanceof ReadOnlyDelegatePlanItemInstance);","typeGuard":"if (planItemInstance instanceof ReadOnlyDelegatePlanItemInstance) return; // no mutation allowed","tryCatchPattern":"try { planItemInstance.setLocalizedName(name); } catch (UnsupportedOperationException e) { log.warn(\"Cannot set localized name in read-only context\"); }","preventionTips":["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"],"tags":["java","cmmn","read-only","unsupported-operation"],"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"}