{"record":{"id":"4f39c5f9ea8361af","repo":"flowable/flowable-engine","slug":"not-supported-to-set-text-value2","errorCode":null,"errorMessage":"Not supported to set text value2","messagePattern":"Not supported to set text value2","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java","lineNumber":517,"sourceCode":"\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            }\n            return null;\n        }\n\n        @Override\n        public void setLongValue(Long longValue) {\n            throw new UnsupportedOperationException(\"Not supported to set long value\");\n        }\n\n        @Override\n        public Double getDoubleValue() {","sourceCodeStart":499,"sourceCodeEnd":535,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java#L499-L535","documentation":"Same immutable JSON-backed VariableScope in BatchDeleteProcessConfig: setTextValue2(String) is a deliberate unsupported stub. The template scope only reads variable data for batch-delete serialization; all setters throw.","triggerScenarios":"Calling setTextValue2 on the template scope, usually from generic variable-mutation utilities or code that second variable of a two-value variable type (e.g. query/enum variables) during batch delete.","commonSituations":"Reusable variable writer code applied to every VariableScope; attempts to normalize variable data while deleting instances; extension code assuming a writable scope.","solutions":["Never write variables via the delete template scope; mutate live instances with runtimeService.setVariable before scheduling deletion","Treat the scope as read-only and use the JSON-backed getters only","Add a defensive try-catch around variable writes on unknown scopes","Subclass with an overriding implementation if a custom delete flow truly needs writes"],"exampleFix":"// before\nbatchScope.setTextValue2(\"x\"); // throws\n// after\n// scope is read-only; write on a live instance if required\nruntimeService.setVariable(instanceId, \"myVar2\", \"x\");","handlingStrategy":"try-catch","validationCode":"if (scope instanceof org.flowable.engine.impl.delete.BatchDeleteProcessConfig.DeleteVariableScope) {\n    // setter unsupported; mutate via runtimeService instead\n}","typeGuard":null,"tryCatchPattern":"try {\n    scope.setTextValue2(value);\n} catch (UnsupportedOperationException e) {\n    runtimeService.setVariable(instanceId, varName, value);\n}","preventionTips":["Never reuse variable-writer utilities against delete-config scopes","Mutate variables on live process instances before batch deletion","Verify implemented vs stubbed methods in custom VariableScope implementations"],"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"}