{"record":{"id":"d182645ca4a0125e","repo":"flowable/flowable-engine","slug":"not-supported-to-set-bytes","errorCode":null,"errorMessage":"Not supported to set bytes","messagePattern":"Not supported to set bytes","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java","lineNumber":555,"sourceCode":"            if (doubleNode.isNumber()) {\n                return doubleNode.doubleValue();\n            }\n            return null;\n        }\n\n        @Override\n        public void setDoubleValue(Double doubleValue) {\n            throw new UnsupportedOperationException(\"Not supported to set double value\");\n        }\n\n        @Override\n        public byte[] getBytes() {\n            throw new UnsupportedOperationException(\"Not supported to get bytes\");\n        }\n\n        @Override\n        public void setBytes(byte[] bytes) {\n            throw new UnsupportedOperationException(\"Not supported to set bytes\");\n        }\n\n        @Override\n        public Object getCachedValue() {\n            throw new UnsupportedOperationException(\"Not supported to set get cached value\");\n        }\n\n        @Override\n        public void setCachedValue(Object cachedValue) {\n            throw new UnsupportedOperationException(\"Not supported to set cached value\");\n        }\n    }\n}\n","sourceCodeStart":537,"sourceCodeEnd":569,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java#L537-L569","documentation":"BatchDeleteProcessConfig contains an inner entity class whose setBytes(byte[]) is deliberately implemented to throw UnsupportedOperationException. This configuration object never carries binary variable data, so mutating bytes on it is unsupported by design. Calling any bytes mutation on this entity always throws.","triggerScenarios":"Calling setBytes(...) on the inner variable/entity instance created inside BatchDeleteProcessConfig (BatchDeleteProcessConfig.java:555), e.g. via generic entity serialization or variable persistence code that iterates all Entity properties.","commonSituations":"Generic persistence/bulk-update frameworks reflectively calling setBytes on all variable entities; code written against a different entity type being reused with the batch-delete configuration; copy/merge utilities that blanket-copy field values.","solutions":["Do not call setBytes on the batch-delete configuration entity; it is unsupported by design.","Check the entity type before calling setBytes (only real variable entities support byte persistence).","If binary data must be carried, use a persistent variable entity (e.g. VariableInstanceEntity) instead of this config object."],"exampleFix":"// before\nentity.setBytes(newBytes);\n// after\nif (entity instanceof VariableInstanceEntity) {\n    ((VariableInstanceEntity) entity).setBytes(newBytes);\n}","handlingStrategy":"validation","validationCode":"if (entity instanceof VariableInstanceEntity) {\n    entity.setBytes(bytes);\n} else {\n    throw new IllegalStateException(\"setBytes not supported on \" + entity.getClass());\n}","typeGuard":"boolean supportsBytes = (entity instanceof VariableInstanceEntity);","tryCatchPattern":null,"preventionTips":["Treat BatchDeleteProcessConfig's inner entity as a read-only configuration holder.","Only mutate bytes on persistent variable entities obtained from variable services."],"tags":["unsupported-operation","batch-delete","flowable"],"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"}