Assembly: OptimaJet.Workflow.Core

Class RestorerBase

OptimaJet.Workflow.Core.Runtime.ServiceRunners.RestorerBase

Provides shared logic for creating asynchronous restore operations for workflow process instances.

public abstract class RestorerBase

Type Hierarchy

Constructors

protected RestorerBase(WorkflowRuntime runtimeOwner, bool isMultiServer, CancellationToken token) #
Initializes a new instance of the 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<Task> 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<Task>
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 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) and can host custom and default recovery behavior.