{"record":{"id":"9ab986fd77963388","repo":"flowable/flowable-engine","slug":"not-supported-to-scope-type","errorCode":null,"errorMessage":"Not supported to scope type","messagePattern":"Not supported to scope type","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java","lineNumber":492,"sourceCode":"\n        @Override\n        public String getExecutionId() {\n            throw new UnsupportedOperationException(\"Not supported to get execution id\");\n        }\n\n        @Override\n        public String getScopeId() {\n            throw new UnsupportedOperationException(\"Not supported to get scope id\");\n        }\n\n        @Override\n        public String getSubScopeId() {\n            throw new UnsupportedOperationException(\"Not supported to get sub scope id\");\n        }\n\n        @Override\n        public String getScopeType() {\n            throw new UnsupportedOperationException(\"Not supported to scope type\");\n        }\n\n        @Override\n        public String getTaskId() {\n            throw new UnsupportedOperationException(\"Not supported to get task id\");\n        }\n\n        @Override\n        public String getTextValue() {\n            return node.path(\"textValue\").stringValue(null);\n        }\n\n        @Override\n        public void setTextValue(String textValue) {\n            throw new UnsupportedOperationException(\"Not supported to set text value\");\n        }\n\n        @Override","sourceCodeStart":474,"sourceCodeEnd":510,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java#L474-L510","documentation":"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.","triggerScenarios":"Calling getScopeType() on the template scope, typically from generic scope-type dispatch code (e.g. handling ScopeTypes) reused during batch deletion.","commonSituations":"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.","solutions":["Do not rely on scope type in batch-delete code paths; branch on the fact you are deleting process instances","Obtain scope type from a real entity fetched through the task/execution services if needed","Wrap speculative getScopeType() calls in try-catch for UnsupportedOperationException","Implement a custom VariableScope returning a meaningful scope type for custom delete flows"],"exampleFix":"// before\nString type = batchScope.getScopeType(); // throws\n// after\nif (ScopeTypes.BPMN.equals(realScope.getScopeType())) { ... } // use a real entity, not the delete template","handlingStrategy":"validation","validationCode":"if (scope instanceof org.flowable.engine.impl.delete.BatchDeleteProcessConfig.DeleteVariableScope) {\n    // batch-delete template: scope type is unavailable, do not dispatch on it\n    return;\n}\nString type = scope.getScopeType();","typeGuard":"boolean hasScopeType(VariableScope s) {\n    try { return s.getScopeType() != null; } catch (UnsupportedOperationException e) { return false; }\n}","tryCatchPattern":"try {\n    dispatch(scope.getScopeType());\n} catch (UnsupportedOperationException e) {\n    // batch delete context: handle as process-instance deletion\n}","preventionTips":["Branch on 'this is a process-instance batch delete' instead of scope type","Avoid scope-type routing code in delete configurations","Test custom batch part handlers against the template scope"],"tags":["unsupported-operation","flowable","batch-delete","scope-type"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}