{"record":{"id":"90e25fdc96e20870","repo":"flowable/flowable-engine","slug":"not-supported-to-get-scope-id","errorCode":null,"errorMessage":"Not supported to get scope id","messagePattern":"Not supported to get scope id","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java","lineNumber":482,"sourceCode":"\n        @Override\n        public String getName() {\n            return node.path(\"name\").stringValue();\n        }\n\n        @Override\n        public String getProcessInstanceId() {\n            throw new UnsupportedOperationException(\"Not supported to get process instance id\");\n        }\n\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","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java#L464-L500","documentation":"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.","triggerScenarios":"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.","commonSituations":"Custom delete/teardown code that treats every VariableScope as a live scope; reusable utility methods that read scopeId generically; listeners attached during batch removal.","solutions":["Do not call getScopeId() on this template scope; use the process instance id supplied to the batch delete configuration","Fetch the real scope from RuntimeService.createExecutionQuery() if scope information is required","Catch UnsupportedOperationException when introspecting unknown VariableScope implementations","Override the method in a custom scope subclass if the information is genuinely needed"],"exampleFix":"// before\nString scopeId = batchScope.getScopeId(); // throws\n// after\nString scopeId = processInstanceId; // batch delete operates per process instance","handlingStrategy":"type-guard","validationCode":"boolean hasScopeId = !(scope instanceof org.flowable.engine.impl.delete.BatchDeleteProcessConfig.DeleteVariableScope);","typeGuard":"boolean supportsScopeId(VariableScope s) {\n    try { s.getScopeId(); return true; } catch (UnsupportedOperationException e) { return false; }\n}","tryCatchPattern":"try {\n    String scopeId = scope.getScopeId();\n} catch (UnsupportedOperationException e) {\n    String scopeId = processInstanceId; // fallback for batch-delete template scope\n}","preventionTips":["Use the process instance id as the scope identity in batch-delete flows","Guard generic VariableScope utilities with capability probes","Never assume every VariableScope has live scope metadata"],"tags":["unsupported-operation","flowable","batch-delete","scope-id"],"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"}