protected internal virtual void DeletePropagate(ExecutionEntity processInstance, string deleteReason, bool skipCustomListeners, bool skipIoMappings) { ExecutionEntity topmostDeletableExecution = processInstance; ExecutionEntity parentScopeExecution = (ExecutionEntity)topmostDeletableExecution.GetParentScopeExecution(true); while (parentScopeExecution != null && (parentScopeExecution.NonEventScopeExecutions.Count <= 1)) { topmostDeletableExecution = parentScopeExecution; parentScopeExecution = (ExecutionEntity)topmostDeletableExecution.GetParentScopeExecution(true); } topmostDeletableExecution.DeleteCascade(deleteReason, skipCustomListeners, skipIoMappings, false); }