flowable/flowable-engine · error · UnsupportedOperationException

Not supported to set cached value

Error message

Not supported to set cached value

What it means

The inner entity of BatchDeleteProcessConfig implements setCachedValue(Object) by throwing UnsupportedOperationException. The batch-delete configuration object participates in no entity cache, so writing a cached value is unsupported by design. Any call to setCachedValue on this instance throws.

Solutions

  1. Do not call setCachedValue on the batch-delete configuration entity.
  2. Guard cache writes with an instanceof check for a cacheable entity type.
  3. Pass a persistent variable entity to code expecting cached-value support.

Example fix

// before
entity.setCachedValue(value);
// after
if (entity instanceof VariableInstanceEntity) {
    ((VariableInstanceEntity) entity).setCachedValue(value);
}
Defensive patterns

Strategy: validation

Validate before calling

if (entity instanceof VariableInstanceEntity) {
    ((VariableInstanceEntity) entity).setCachedValue(value);
}

Type guard

boolean acceptsCachedValue = (entity instanceof VariableInstanceEntity);

Prevention

When it happens

Trigger: Calling setCachedValue(...) on the inner entity in BatchDeleteProcessConfig (BatchDeleteProcessConfig.java:565), typically from cache-update code that sets cached values on all variable entities.

Common situations: Cache synchronization after transaction commit; bulk variable update utilities blindly writing cached values; reusing a variable entity wrapper where a config object was passed instead.

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/410198a33da906c2. Report an issue: GitHub.

Appendix: source

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

        @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)