flowable/flowable-engine · error · UnsupportedOperationException

Not supported to get sub scope id

Error message

Not supported to get sub scope id

What it means

The VariableScope stub inside BatchDeleteProcessConfig throws for getSubScopeId() because sub-scope identity is irrelevant to batch process-instance deletion. This is an intentional interface-compliance stub, not a recoverable failure.

Solutions

  1. Avoid reading subScopeId from the template scope; delete config needs only process instance ids
  2. Query the actual entity (ExecutionEntity/TaskEntity) via the services when sub-scope data is required
  3. Guard generic VariableScope consumers with a capability check or catch UnsupportedOperationException
  4. Provide your own VariableScope implementation if batch-delete extension requires these fields

Example fix

// before
String sub = batchScope.getSubScopeId(); // throws
// after
ExecutionEntity exec = (ExecutionEntity) runtimeService.createExecutionQuery().executionId(execId).singleResult();
String sub = exec.getSubScopeId();
Defensive patterns

Strategy: try-catch

Validate before calling

// only read subScopeId from real executions fetched via RuntimeService

Type guard

String safeGetSubScopeId(VariableScope s, String fallback) {
    try { return s.getSubScopeId(); } catch (UnsupportedOperationException e) { return fallback; }
}

Try / catch

try {
    String sub = scope.getSubScopeId();
} catch (UnsupportedOperationException e) {
    // batch-delete template: fetch ExecutionEntity from RuntimeService if truly needed
}

Prevention

When it happens

Trigger: Invoking getSubScopeId() on the batch-delete template scope from custom batch part logic, listeners, or generic VariableScope utility code.

Common situations: Code shared between normal execution handling and batch delete; hierarchical scope walkers that assume subScopeId is always available; custom delete configurations extending the default one.

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/3ba15dbe7ebd6922. Report an issue: GitHub.

Appendix: source

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

        @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
        public String getTextValue() {
            return node.path("textValue").stringValue(null);
        }

        @Override

View on GitHub (pinned to d6d39ce1c6)