{"record":{"id":"3d7e3500e6b33430","repo":"flowable/flowable-engine","slug":"not-supported-to-get-execution-id","errorCode":null,"errorMessage":"Not supported to get execution id","messagePattern":"Not supported to get execution id","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java","lineNumber":477,"sourceCode":"        protected final JsonNode node;\n\n        public VariableValueJsonNodeValueFields(JsonNode node) {\n            this.node = node;\n        }\n\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","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java#L459-L495","documentation":"BatchDeleteProcessConfig creates a read-only, JSON-backed VariableScope implementation used only as a template for process-instance batch deletion. Most VariableScope accessors are deliberately stubbed with UnsupportedOperationException because they have no meaning during batch delete. Calling getExecutionId() therefore always throws; the library never intends this value to be read in the batch-delete path.","triggerScenarios":"Any code holding the BatchDeleteProcessConfig template scope and calling getExecutionId() on it — e.g. custom FlowableEventListener, custom batch part handler, or delegated code (expression/bean invoked during delete) that reads the execution id from the scope.","commonSituations":"Custom batch-delete extensions or listeners that assume the scope is a live execution; copying code that works on a normal DelegateExecution and reusing it against the batch-delete config; Flowable upgrades where a new internal code path starts querying the scope id fields.","solutions":["Stop calling getExecutionId() on the batch-delete scope; obtain the execution id from the process instance data or the batch part data instead","If execution context is needed, run the logic against a real ExecutionEntity fetched from RuntimeService before the batch is created","Wrap access in try-catch for UnsupportedOperationException only when probing capability of an unknown scope","Subclass/override the scope if you truly need an execution id in a custom delete flow"],"exampleFix":"// before\nString execId = batchScope.getExecutionId(); // throws\n// after\nProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(piId).singleResult();\nString execId = pi.getId();","handlingStrategy":"try-catch","validationCode":"// scope from batch-delete config is read-only; detect it before reading identity fields\nboolean safeToRead = !(scope instanceof org.flowable.engine.impl.delete.BatchDeleteProcessConfig.DeleteVariableScope);\n// or: never read execution/scope fields on scopes obtained from batch delete configurations","typeGuard":"boolean isLiveExecutionScope(VariableScope s) {\n    return s instanceof DelegateExecution || s instanceof ExecutionEntity;\n}","tryCatchPattern":"try {\n    String execId = scope.getExecutionId();\n} catch (UnsupportedOperationException e) {\n    // read-only template scope: resolve id from process-instance/batch data instead\n}","preventionTips":["Treat scopes returned by batch-delete configurations as read-only snapshots","Resolve execution/process ids from RuntimeService queries, not the delete template","Do not reuse code written for DelegateExecution against delete-config scopes","Check Flowable sources for stubbed methods before relying on a VariableScope implementation"],"tags":["unsupported-operation","flowable","batch-delete","execution-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"}