flowable/flowable-engine · error · UnsupportedOperationException

Not supported to get scope id

Error message

Not supported to get scope id

What it means

Same read-only template scope in BatchDeleteProcessConfig: getScopeId() is intentionally unimplemented because batch delete works on whole process instances, not scopes. The method exists only to satisfy the VariableScope interface and always throws UnsupportedOperationException.

Solutions

  1. Do not call getScopeId() on this template scope; use the process instance id supplied to the batch delete configuration
  2. Fetch the real scope from RuntimeService.createExecutionQuery() if scope information is required
  3. Catch UnsupportedOperationException when introspecting unknown VariableScope implementations
  4. Override the method in a custom scope subclass if the information is genuinely needed

Example fix

// before
String scopeId = batchScope.getScopeId(); // throws
// after
String scopeId = processInstanceId; // batch delete operates per process instance
Defensive patterns

Strategy: type-guard

Validate before calling

boolean hasScopeId = !(scope instanceof org.flowable.engine.impl.delete.BatchDeleteProcessConfig.DeleteVariableScope);

Type guard

boolean supportsScopeId(VariableScope s) {
    try { s.getScopeId(); return true; } catch (UnsupportedOperationException e) { return false; }
}

Try / catch

try {
    String scopeId = scope.getScopeId();
} catch (UnsupportedOperationException e) {
    String scopeId = processInstanceId; // fallback for batch-delete template scope
}

Prevention

When it happens

Trigger: Calling getScopeId() on the scope returned by BatchDeleteProcessConfig, e.g. from a custom variable-scope consumer, batch part handler, or expression evaluated during batch deletion.

Common situations: Custom delete/teardown code that treats every VariableScope as a live scope; reusable utility methods that read scopeId generically; listeners attached during batch removal.

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/90e25fdc96e20870. Report an issue: GitHub.

Appendix: source

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

        @Override
        public String getName() {
            return node.path("name").stringValue();
        }

        @Override
        public String getProcessInstanceId() {
            throw new UnsupportedOperationException("Not supported to get process instance id");
        }

        @Override
        public String getExecutionId() {
            throw new UnsupportedOperationException("Not supported to get execution id");
        }

        @Override
        public String getScopeId() {
            throw new UnsupportedOperationException("Not supported to get scope id");
        }

        @Override
        public String getSubScopeId() {
            throw new UnsupportedOperationException("Not supported to get sub scope id");
        }

        @Override
        public String getScopeType() {
            throw new UnsupportedOperationException("Not supported to scope type");
        }

        @Override
        public String getTaskId() {
            throw new UnsupportedOperationException("Not supported to get task id");
        }

        @Override

View on GitHub (pinned to d6d39ce1c6)