{"record":{"id":"8fdcb5720fedcaa5","repo":"flowable/flowable-engine","slug":"not-supported-to-set-text-value","errorCode":null,"errorMessage":"Not supported to set text value","messagePattern":"Not supported to set text value","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java","lineNumber":507,"sourceCode":"\n        @Override\n        public String getScopeType() {\n            throw new UnsupportedOperationException(\"Not supported to scope type\");\n        }\n\n        @Override\n        public String getTaskId() {\n            throw new UnsupportedOperationException(\"Not supported to get task id\");\n        }\n\n        @Override\n        public String getTextValue() {\n            return node.path(\"textValue\").stringValue(null);\n        }\n\n        @Override\n        public void setTextValue(String textValue) {\n            throw new UnsupportedOperationException(\"Not supported to set text value\");\n        }\n\n        @Override\n        public String getTextValue2() {\n            return node.path(\"textValues\").stringValue(null);\n        }\n\n        @Override\n        public void setTextValue2(String textValue2) {\n            throw new UnsupportedOperationException(\"Not supported to set text value2\");\n        }\n\n        @Override\n        public Long getLongValue() {\n            JsonNode longNode = node.path(\"longValue\");\n            if (longNode.isNumber()) {\n                return longNode.longValue();\n            }","sourceCodeStart":489,"sourceCodeEnd":525,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java#L489-L525","documentation":"BatchDeleteProcessConfig's VariableScope is a read-only, JSON-backed snapshot; variable values are only read from the backing JSON node. setTextValue() is a mutating setter that is intentionally unsupported and always throws UnsupportedOperationException.","triggerScenarios":"Calling setTextValue(String) on the template scope — e.g. custom batch part logic that tries to modify a string variable, or code reusing variable-writing utilities during batch delete.","commonSituations":"Variable-update code paths shared with normal execution; attempts to 'fix' variable data while deleting; accidental reuse of the delete template as a working variable scope.","solutions":["Do not mutate variables through this scope; perform variable changes via runtimeService.setVariable(...) on live instances before deletion","Treat the scope as strictly read-only — use the getters backed by the JSON node","Catch UnsupportedOperationException only when writing to an unknown VariableScope defensively","Create a separate writable VariableScope implementation for custom flows"],"exampleFix":"// before\nbatchScope.setTextValue(\"new\"); // throws\n// after\nruntimeService.setVariable(processInstanceId, \"myVar\", \"new\"); // on a live instance, before delete","handlingStrategy":"validation","validationCode":"// write variables only on live instances, never on the batch-delete template scope\nif (scope instanceof org.flowable.engine.impl.delete.BatchDeleteProcessConfig.DeleteVariableScope) {\n    throw new IllegalStateException(\"Scope is read-only; use runtimeService.setVariable\");\n}\nscope.setTextValue(value);","typeGuard":null,"tryCatchPattern":"try {\n    scope.setTextValue(value);\n} catch (UnsupportedOperationException e) {\n    runtimeService.setVariable(processInstanceId, varName, value); // fallback to live instance\n}","preventionTips":["Treat all setters on batch-delete template scopes as forbidden","Perform variable changes before scheduling deletion, on live instances","Document read-only scopes in any shared variable utility code"],"tags":["unsupported-operation","flowable","batch-delete","immutable-scope"],"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"}