{"record":{"id":"3ba15dbe7ebd6922","repo":"flowable/flowable-engine","slug":"not-supported-to-get-sub-scope-id","errorCode":null,"errorMessage":"Not supported to get sub scope id","messagePattern":"Not supported to get sub 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":487,"sourceCode":"\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\n        public String getTextValue() {\n            return node.path(\"textValue\").stringValue(null);\n        }\n\n        @Override","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java#L469-L505","documentation":"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.","triggerScenarios":"Invoking getSubScopeId() on the batch-delete template scope from custom batch part logic, listeners, or generic VariableScope utility code.","commonSituations":"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.","solutions":["Avoid reading subScopeId from the template scope; delete config needs only process instance ids","Query the actual entity (ExecutionEntity/TaskEntity) via the services when sub-scope data is required","Guard generic VariableScope consumers with a capability check or catch UnsupportedOperationException","Provide your own VariableScope implementation if batch-delete extension requires these fields"],"exampleFix":"// before\nString sub = batchScope.getSubScopeId(); // throws\n// after\nExecutionEntity exec = (ExecutionEntity) runtimeService.createExecutionQuery().executionId(execId).singleResult();\nString sub = exec.getSubScopeId();","handlingStrategy":"try-catch","validationCode":"// only read subScopeId from real executions fetched via RuntimeService","typeGuard":"String safeGetSubScopeId(VariableScope s, String fallback) {\n    try { return s.getSubScopeId(); } catch (UnsupportedOperationException e) { return fallback; }\n}","tryCatchPattern":"try {\n    String sub = scope.getSubScopeId();\n} catch (UnsupportedOperationException e) {\n    // batch-delete template: fetch ExecutionEntity from RuntimeService if truly needed\n}","preventionTips":["Query ExecutionEntity for hierarchical scope data instead of the delete template","Keep batch-delete code free of scope-tree walking logic","Centralize scope access in helpers that handle unsupported getters"],"tags":["unsupported-operation","flowable","batch-delete","sub-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"}