flowable/flowable-engine · error · UnsupportedOperationException

Not supported to scope type

Error message

Not supported to scope type

What it means

getScopeType() on BatchDeleteProcessConfig's read-only VariableScope is a deliberate stub: batch deletion of process instances has no scope type semantics. Any call throws UnsupportedOperationException unconditionally.

Solutions

  1. Do not rely on scope type in batch-delete code paths; branch on the fact you are deleting process instances
  2. Obtain scope type from a real entity fetched through the task/execution services if needed
  3. Wrap speculative getScopeType() calls in try-catch for UnsupportedOperationException
  4. Implement a custom VariableScope returning a meaningful scope type for custom delete flows

Example fix

// before
String type = batchScope.getScopeType(); // throws
// after
if (ScopeTypes.BPMN.equals(realScope.getScopeType())) { ... } // use a real entity, not the delete template
Defensive patterns

Strategy: validation

Validate before calling

if (scope instanceof org.flowable.engine.impl.delete.BatchDeleteProcessConfig.DeleteVariableScope) {
    // batch-delete template: scope type is unavailable, do not dispatch on it
    return;
}
String type = scope.getScopeType();

Type guard

boolean hasScopeType(VariableScope s) {
    try { return s.getScopeType() != null; } catch (UnsupportedOperationException e) { return false; }
}

Try / catch

try {
    dispatch(scope.getScopeType());
} catch (UnsupportedOperationException e) {
    // batch delete context: handle as process-instance deletion
}

Prevention

When it happens

Trigger: Calling getScopeType() on the template scope, typically from generic scope-type dispatch code (e.g. handling ScopeTypes) reused during batch deletion.

Common situations: Scope-type routing logic shared with normal runtime paths; custom batch part handlers inspecting the scope; code migrated from a live-execution context where scopeType was set.

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/9ab986fd77963388. Report an issue: GitHub.

Appendix: source

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

        @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
        public void setTextValue(String textValue) {
            throw new UnsupportedOperationException("Not supported to set text value");
        }

        @Override

View on GitHub (pinned to d6d39ce1c6)