flowable/flowable-engine · error · UnsupportedOperationException

Not supported to get bytes

Error message

Not supported to get bytes

What it means

getBytes() in BatchDeleteProcessConfig's VariableScope template throws UnsupportedOperationException because byte-array (bytea/blob) variables are not represented in the JSON-backed delete snapshot. It is a deliberate interface-compliance stub.

Solutions

  1. Read byte-array variables directly via runtimeService.getVariable(...) or VariableInstanceQuery before the batch deletion
  2. Skip binary variables when iterating the delete template scope (filter by type first)
  3. Catch UnsupportedOperationException as a signal the scope cannot supply byte content
  4. Extend the template scope with byte support if your batch flow must serialize binaries

Example fix

// before
byte[] data = batchScope.getBytes(); // throws
// after
Object v = runtimeService.getVariable(processInstanceId, varName);
byte[] data = (v instanceof byte[]) ? (byte[]) v : null;
Defensive patterns

Strategy: fallback

Validate before calling

// check variable type before reading binary content
Object v = runtimeService.getVariable(processInstanceId, varName);
if (v instanceof byte[]) { byte[] data = (byte[]) v; }

Type guard

byte[] safeGetBytes(VariableScope s) {
    try { return s.getBytes(); } catch (UnsupportedOperationException e) { return null; }
}

Try / catch

try {
    byte[] data = scope.getBytes();
} catch (UnsupportedOperationException e) {
    // template scope has no binary support; fetch via runtimeService.getVariable
}

Prevention

When it happens

Trigger: Calling getBytes() on the template scope — e.g. generic variable iteration code that reads all variable types, including byte-array content, during batch delete configuration.

Common situations: Export/backup tooling reading binary variable content while deleting instances; generic VariableScope readers that assume every getter works; debugging/inspection of the delete template scope.

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/217c7040940405d0. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java:550

        }

        @Override
        public Double getDoubleValue() {
            JsonNode doubleNode = node.path("doubleValue");
            if (doubleNode.isNumber()) {
                return doubleNode.doubleValue();
            }
            return null;
        }

        @Override
        public void setDoubleValue(Double doubleValue) {
            throw new UnsupportedOperationException("Not supported to set double value");
        }

        @Override
        public byte[] getBytes() {
            throw new UnsupportedOperationException("Not supported to get bytes");
        }

        @Override
        public void setBytes(byte[] bytes) {
            throw new UnsupportedOperationException("Not supported to set bytes");
        }

        @Override
        public Object getCachedValue() {
            throw new UnsupportedOperationException("Not supported to set get cached value");
        }

        @Override
        public void setCachedValue(Object cachedValue) {
            throw new UnsupportedOperationException("Not supported to set cached value");
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)