# Class RestorerBase OptimaJet.Workflow.Core.Runtime.ServiceRunners.RestorerBase Provides shared logic for creating asynchronous restore operations for workflow process instances. Namespace: [OptimaJet.Workflow.Core.Runtime.ServiceRunners](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ServiceRunners/) ```csharp public abstract class RestorerBase ``` ## Type Hierarchy - RestorerBase Current type - [MultiServerRestorer](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ServiceRunners/MultiServerRestorer/) - [SingleServerRestorer](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ServiceRunners/SingleServerRestorer/) ## Constructors `protected RestorerBase(WorkflowRuntime runtimeOwner, bool isMultiServer, CancellationToken token)` Initializes a new instance of the [RestorerBase](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ServiceRunners/RestorerBase/) class. ### Parameters | Name | Type | Description | | --- | --- | --- | | `runtimeOwner` | `WorkflowRuntime` | The runtime that owns the restore process. | | `isMultiServer` | `Boolean` | Indicates whether multi-server lock validation should be performed. | | `token` | `CancellationToken` | A token that can cancel restore execution before it starts. | ## Methods `protected Func GetRestorerAsyncAction(Guid processId, string runtimeId = null, bool isSelfRestore = false, Guid runtimeLock = default)` Creates an asynchronous function that restores a workflow process based on its current status. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processId` | `Guid` | Identifier of the process instance to restore. | | `runtimeId` | `String` | Runtime identifier used when checking lock ownership in multi-server mode. | | `isSelfRestore` | `Boolean` | True when restore is initiated by the same runtime that owns the process lock. | | `runtimeLock` | `Guid` | Expected lock identifier to compare with the current runtime lock. | ### Returns | Type | Description | | --- | --- | | `Func` | An awaitable delegate that executes the restore routine. | ### Exceptions | Type | Description | | --- | --- | | `SelfRestoreConcurrencyException` | Thrown when the runtime lock changes during a self restore attempt. | | `OperationCanceledException` | Thrown when the provided cancellation token is canceled. | ### Remarks The delegate runs through custom [IProcessRestorer](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/IProcessRestorer/) decisions when available, or performs default status and timer restoration when no custom decision applies. ## Remarks Implementations of this class execute a restore action through [RestorerBase.GetRestorerAsyncAction(Guid, string, bool, Guid)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ServiceRunners/RestorerBase/) and can host custom and default recovery behavior. [Previous MultiServerServiceRunner](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ServiceRunners/MultiServerServiceRunner/) [Next SingleServerRestorer](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ServiceRunners/SingleServerRestorer/)