Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE formengine.io.

Interface IPersistenceProvider

Interface of a persistence provider, which provide storing of process's instance specific parameters and global parameters

Inherited Members

IApprovalProvider.DropWorkflowInboxAsync(Guid)

IApprovalProvider.InsertInboxAsync(List<InboxItem>)

IApprovalProvider.GetInboxCountByProcessIdAsync(Guid)

IApprovalProvider.GetInboxCountByIdentityIdAsync(string)

IApprovalProvider.GetInboxByProcessIdAsync(Guid, Paging, CultureInfo)

IApprovalProvider.GetInboxByIdentityIdAsync(string, Paging, CultureInfo)

IApprovalProvider.FillApprovalHistoryAsync(ApprovalHistoryItem)

IApprovalProvider.DropEmptyApprovalHistoryAsync(Guid)

IApprovalProvider.DropApprovalHistoryByProcessIdAsync(Guid)

IApprovalProvider.DropApprovalHistoryByIdentityIdAsync(string)

IApprovalProvider.GetApprovalHistoryCountByProcessIdAsync(Guid)

IApprovalProvider.GetApprovalHistoryCountByIdentityIdAsync(string)

IApprovalProvider.GetApprovalHistoryByProcessIdAsync(Guid, Paging)

IApprovalProvider.GetApprovalHistoryByIdentityIdAsync(string, Paging)

IApprovalProvider.GetOutboxCountByIdentityIdAsync(string)

IApprovalProvider.GetOutboxByIdentityIdAsync(string, Paging)

IAssignmentProvider.DeleteAssignmentAsync(Guid)

IAssignmentProvider.GetAssignmentsAsync(AssignmentFilter, List<(string parameterName, SortDirection sortDirection)>, Paging)

IAssignmentProvider.GetAssignmentCountAsync(AssignmentFilter)

IAssignmentProvider.CreateAssignmentAsync(Guid, AssignmentCreationForm)

IAssignmentProvider.GetAssignmentAsync(Guid)

IAssignmentProvider.UpdateAssignmentAsync(Assignment)

Namespace: OptimaJet.Workflow.Core.Persistence

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public interface IPersistenceProvider : IApprovalProvider, IAssignmentProvider

Methods

Init(WorkflowRuntime)

Init the provider

Declaration
void Init(WorkflowRuntime runtime)
Parameters
TypeNameDescription
WorkflowRuntimeruntimeWorkflow runtime instance which owned the provider

InitializeProcessAsync(ProcessInstance)

Initialize a process instance in persistence store

Declaration
Task InitializeProcessAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
Returns
TypeDescription
Task

FillProcessParametersAsync(ProcessInstance)

Fills system ParameterPurpose.System and persisted ParameterPurpose.Persistence parameters of the process

Declaration
Task FillProcessParametersAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
Returns
TypeDescription
Task

FillPersistedProcessParametersAsync(ProcessInstance)

Fills persisted ParameterPurpose.Persistence parameters of the process

Declaration
Task FillPersistedProcessParametersAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
Returns
TypeDescription
Task

FillPersistedProcessParameterAsync(ProcessInstance, string)

Fills persisted ParameterPurpose.Persistence parameter of the process

Declaration
Task FillPersistedProcessParameterAsync(ProcessInstance processInstance, string parameterName)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
stringparameterName
Returns
TypeDescription
Task

FillSystemProcessParametersAsync(ProcessInstance)

Fills system ParameterPurpose.System parameters of the process

Declaration
Task FillSystemProcessParametersAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
Returns
TypeDescription
Task

SavePersistenceParametersAsync(ProcessInstance)

Saves persisted ParameterPurpose.Persistence parameters of the process to store

Declaration
Task SavePersistenceParametersAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
Returns
TypeDescription
Task

SavePersistenceParameterAsync(ProcessInstance, string)

Save persisted ParameterPurpose.Persistence parameter of the process to store

Declaration
Task SavePersistenceParameterAsync(ProcessInstance processInstance, string parameterName)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
stringparameterNameName of parameter for save
Returns
TypeDescription
Task

RemoveParameterAsync(ProcessInstance, string)

Remove persisted ParameterPurpose.Persistence parameter of the process from store

Declaration
Task RemoveParameterAsync(ProcessInstance processInstance, string parameterName)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
stringparameterNameName of parameter for save
Returns
TypeDescription
Task

SetWorkflowInitializedAsync(ProcessInstance)

Set process instance status to ProcessStatus.Initialized

Declaration
Task SetWorkflowInitializedAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
Returns
TypeDescription
Task

SetWorkflowIdledAsync(ProcessInstance)

Set process instance status to ProcessStatus.Idled

Declaration
Task SetWorkflowIdledAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
Returns
TypeDescription
Task

SetWorkflowRunningAsync(ProcessInstance)

Set process instance status to ProcessStatus.Running

Declaration
Task SetWorkflowRunningAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
Returns
TypeDescription
Task

SetWorkflowFinalizedAsync(ProcessInstance)

Set process instance status to ProcessStatus.Finalized

Declaration
Task SetWorkflowFinalizedAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
Returns
TypeDescription
Task

SetProcessStatusAsync(Guid, ProcessStatus)

Set process instance status to newStatus

Declaration
Task SetProcessStatusAsync(Guid processId, ProcessStatus newStatus)
Parameters
TypeNameDescription
GuidprocessIdProcess id
ProcessStatusnewStatusNew process status
Returns
TypeDescription
Task

SetWorkflowTerminatedAsync(ProcessInstance)

Set process instance status to ProcessStatus.Terminated

Declaration
Task SetWorkflowTerminatedAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
Returns
TypeDescription
Task

WriteInitialRecordToHistoryAsync(ProcessInstance)

Write to table WorkflowProcessTransitionHistory initial record with first activity if can.

Declaration
Task WriteInitialRecordToHistoryAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
Returns
TypeDescription
Task

UpdatePersistenceStateAsync(ProcessInstance, TransitionDefinition)

Updates system parameters of the process in the store

Declaration
Task UpdatePersistenceStateAsync(ProcessInstance processInstance, TransitionDefinition transition)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process
TransitionDefinitiontransitionLast executed transition
Returns
TypeDescription
Task

IsProcessExistsAsync(Guid)

Checks existence of the process

Declaration
Task<bool> IsProcessExistsAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdId of the process
Returns
TypeDescription
Task<bool>

GetInstanceStatusAsync(Guid)

Returns status of the process ProcessStatus

Declaration
Task<ProcessStatus> GetInstanceStatusAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdId of the process
Returns
TypeDescription
Task<ProcessStatus>Status of the process

BindProcessToNewSchemeAsync(ProcessInstance)

Saves information about changed scheme to the store

Declaration
Task BindProcessToNewSchemeAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process with changed scheme <xref href="OptimaJet.Workflow.Core.Model.ProcessInstance.ProcessScheme" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
Task

BindProcessToNewSchemeAsync(ProcessInstance, bool)

Saves information about changed scheme to the store

Declaration
Task BindProcessToNewSchemeAsync(ProcessInstance processInstance, bool resetIsDeterminingParametersChanged)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance of the process with changed scheme <xref href="OptimaJet.Workflow.Core.Model.ProcessInstance.ProcessScheme" data-throw-if-not-resolved="false"></xref>
boolresetIsDeterminingParametersChangedTrue if required to reset IsDeterminingParametersChanged flag <xref href="OptimaJet.Workflow.Core.Model.ProcessInstance.IsDeterminingParametersChanged" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
Task

RegisterTimerAsync(Guid, Guid, string, DateTime, bool)

Register a new timer

Declaration
Task RegisterTimerAsync(Guid processId, Guid rootProcessId, string name, DateTime nextExecutionDateTime, bool notOverrideIfExists)
Parameters
TypeNameDescription
GuidprocessIdId of the process
GuidrootProcessIdId of the root process
stringnameTimer name <see cref="!:TimerDefinition.Name"></see>
DateTimenextExecutionDateTimeNext date and time of timer's execution
boolnotOverrideIfExistsIf true specifies that the existing timer with same name will not be overriden <xref href="OptimaJet.Workflow.Core.Model.TimerDefinition.NotOverrideIfExists" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
Task

ClearTimersAsync(Guid, List<string>)

Removes all timers from the store, exclude listed in ignore list

Declaration
Task ClearTimersAsync(Guid processId, List<string> timersIgnoreList)
Parameters
TypeNameDescription
GuidprocessIdId of the process
List<string>timersIgnoreListIgnore list
Returns
TypeDescription
Task

GetTimersForProcessAsync(Guid)

Get all timers of a process

Declaration
Task<List<ProcessTimer>> GetTimersForProcessAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdId of the process
Returns
TypeDescription
Task<List<ProcessTimer>>

DeleteProcessAsync(Guid)

Remove all information about the process from the store

Declaration
Task DeleteProcessAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdId of the process
Returns
TypeDescription
Task

DeleteProcessAsync(Guid[])

Remove all information about the process from the store

Declaration
Task DeleteProcessAsync(Guid[] processIds)
Parameters
TypeNameDescription
System.Guid[]processIdsList of ids of the process
Returns
TypeDescription
Task

SaveGlobalParameterAsync<T>(string, string, T)

Saves a global parameter value

Declaration
Task SaveGlobalParameterAsync<T>(string type, string name, T value)
Parameters
TypeNameDescription
stringtypeLogical type of the parameter
stringnameName of the parameter
{T}valueValue of the parameter
Returns
TypeDescription
Task

LoadGlobalParameterAsync<T>(string, string)

Returns a global parameter value

Declaration
Task<T> LoadGlobalParameterAsync<T>(string type, string name)
Parameters
TypeNameDescription
stringtypeLogical type of the parameter
stringnameName of the parameter
Returns
TypeDescription
Task<T>Value of the parameter

LoadGlobalParametersWithNamesAsync<T>(string, Sorting)

Returns a values and names of global parameters

Declaration
Task<Dictionary<string, T>> LoadGlobalParametersWithNamesAsync<T>(string type, Sorting sort = null)
Parameters
TypeNameDescription
stringtypeLogical type of the parameter
SortingsortField for sorting parameters
Returns
TypeDescription
Task<Dictionary<string, T>>Dictionary of parameter names and values

LoadGlobalParametersAsync<T>(string, Sorting)

Returns a global parameter values

Declaration
Task<List<T>> LoadGlobalParametersAsync<T>(string type, Sorting sort = null)
Parameters
TypeNameDescription
stringtypeLogical type of the parameter
SortingsortField for sorting parameters
Returns
TypeDescription
Task<List<T>>List of parameter values

LoadGlobalParametersWithPagingAsync<T>(string, Paging, string, Sorting)

Returns a global parameter values with paging and total quantity

Declaration
Task<PagedResponse<T>> LoadGlobalParametersWithPagingAsync<T>(string type, Paging paging, string name = null, Sorting sort = null)
Parameters
TypeNameDescription
stringtypeLogical type of the parameter
PagingpagingPaging settings
stringname[Nullable] Search by name
SortingsortField for sorting parameters
Returns
TypeDescription
Task<PagedResponse<T>>Returns a global parameter values with paging and total quantity

DeleteGlobalParametersAsync(string, string)

Deletes a global parameter

Declaration
Task DeleteGlobalParametersAsync(string type, string name = null)
Parameters
TypeNameDescription
stringtypeLogical type of the parameter
stringnameName of the parameter
Returns
TypeDescription
Task

GetProcessHistoryAsync(Guid, Paging)

Returns the history of process

Declaration
Task<List<ProcessHistoryItem>> GetProcessHistoryAsync(Guid processId, Paging paging = null)
Parameters
TypeNameDescription
GuidprocessIdId of the process
Pagingpaging
Returns
TypeDescription
Task<List<ProcessHistoryItem>>

GetProcessHistoryCountAsync(Guid)

Declaration
Task<int> GetProcessHistoryCountAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessId
Returns
TypeDescription
Task<int>

BulkInitProcessesAsync(List<ProcessInstance>, ProcessStatus, CancellationToken)

Declaration
Task BulkInitProcessesAsync(List<ProcessInstance> instances, ProcessStatus status, CancellationToken token)
Parameters
TypeNameDescription
List<ProcessInstance>instances
ProcessStatusstatus
CancellationTokentoken
Returns
TypeDescription
Task

BulkInitProcessesAsync(List<ProcessInstance>, List<TimerToRegister>, ProcessStatus, CancellationToken)

Declaration
Task BulkInitProcessesAsync(List<ProcessInstance> instances, List<TimerToRegister> timers, ProcessStatus status, CancellationToken token)
Parameters
TypeNameDescription
List<ProcessInstance>instances
List<TimerToRegister>timers
ProcessStatusstatus
CancellationTokentoken
Returns
TypeDescription
Task

GetProcessInstanceTreeAsync(Guid)

Declaration
Task<List<IProcessInstanceTreeItem>> GetProcessInstanceTreeAsync(Guid rootProcessId)
Parameters
TypeNameDescription
GuidrootProcessId
Returns
TypeDescription
Task<List<IProcessInstanceTreeItem>>

MultiServerRuntimesExistAsync()

Declaration
Task<bool> MultiServerRuntimesExistAsync()
Returns
TypeDescription
Task<bool>

CreateWorkflowRuntimeAsync(string, RuntimeStatus)

Declaration
Task<WorkflowRuntimeModel> CreateWorkflowRuntimeAsync(string runtimeId, RuntimeStatus status)
Parameters
TypeNameDescription
stringruntimeId
RuntimeStatusstatus
Returns
TypeDescription
Task<WorkflowRuntimeModel>

UpdateWorkflowRuntimeStatusAsync(WorkflowRuntimeModel, RuntimeStatus)

Declaration
Task<WorkflowRuntimeModel> UpdateWorkflowRuntimeStatusAsync(WorkflowRuntimeModel runtime, RuntimeStatus status)
Parameters
TypeNameDescription
WorkflowRuntimeModelruntime
RuntimeStatusstatus
Returns
TypeDescription
Task<WorkflowRuntimeModel>

UpdateWorkflowRuntimeRestorerAsync(WorkflowRuntimeModel, string)

Declaration
Task<(bool Success, WorkflowRuntimeModel UpdatedModel)> UpdateWorkflowRuntimeRestorerAsync(WorkflowRuntimeModel runtime, string restorerId)
Parameters
TypeNameDescription
WorkflowRuntimeModelruntime
stringrestorerId
Returns
TypeDescription
Task<(bool Success, WorkflowRuntimeModel UpdatedModel)>

GetRunningProcessesAsync(string)

Declaration
Task<List<Guid>> GetRunningProcessesAsync(string runtimeId = null)
Parameters
TypeNameDescription
stringruntimeId
Returns
TypeDescription
Task<List<Guid>>

GetActiveTimersForProcessAsync(Guid)

Declaration
Task<List<ProcessTimer>> GetActiveTimersForProcessAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessId
Returns
TypeDescription
Task<List<ProcessTimer>>

DeleteInactiveTimersByProcessIdAsync(Guid)

Declaration
Task DeleteInactiveTimersByProcessIdAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessId
Returns
TypeDescription
Task

DeleteTimerAsync(Guid)

Declaration
Task DeleteTimerAsync(Guid timerId)
Parameters
TypeNameDescription
GuidtimerId
Returns
TypeDescription
Task

GetTopTimersToExecuteAsync(int)

Declaration
Task<List<WorkflowTimer>> GetTopTimersToExecuteAsync(int top)
Parameters
TypeNameDescription
inttop
Returns
TypeDescription
Task<List<WorkflowTimer>>

SetTimerIgnoreAsync(Guid)

Declaration
Task<int> SetTimerIgnoreAsync(Guid id)
Parameters
TypeNameDescription
Guidid
Returns
TypeDescription
Task<int>

ActiveMultiServerRuntimesCountAsync(string)

Declaration
Task<int> ActiveMultiServerRuntimesCountAsync(string currentRuntimeId)
Parameters
TypeNameDescription
stringcurrentRuntimeId
Returns
TypeDescription
Task<int>

GetWorkflowRuntimeModelAsync(string)

Declaration
Task<WorkflowRuntimeModel> GetWorkflowRuntimeModelAsync(string runtimeId)
Parameters
TypeNameDescription
stringruntimeId
Returns
TypeDescription
Task<WorkflowRuntimeModel>

GetWorkflowRuntimesAsync()

Declaration
Task<List<WorkflowRuntimeModel>> GetWorkflowRuntimesAsync()
Returns
TypeDescription
Task<List<WorkflowRuntimeModel>>

SendRuntimeLastAliveSignalAsync()

Declaration
Task<int> SendRuntimeLastAliveSignalAsync()
Returns
TypeDescription
Task<int>

GetNextTimerDateAsync(TimerCategory, int)

Declaration
Task<DateTime?> GetNextTimerDateAsync(TimerCategory timerCategory, int timerInterval)
Parameters
TypeNameDescription
TimerCategorytimerCategory
inttimerInterval
Returns
TypeDescription
Task<DateTime?>

DeleteWorkflowRuntimeAsync(string)

Declaration
Task DeleteWorkflowRuntimeAsync(string name)
Parameters
TypeNameDescription
stringname
Returns
TypeDescription
Task

DropUnusedWorkflowProcessSchemeAsync()

Declaration
Task DropUnusedWorkflowProcessSchemeAsync()
Returns
TypeDescription
Task

GetProcessInstancesAsync(List<(string parameterName, SortDirection sortDirection)>, Paging)

Declaration
Task<List<ProcessInstanceItem>> GetProcessInstancesAsync(List<(string parameterName, SortDirection sortDirection)> orderParameters = null, Paging paging = null)
Parameters
TypeNameDescription
List<(string parameterName, SortDirection sortDirection)>orderParameters
Pagingpaging
Returns
TypeDescription
Task<List<ProcessInstanceItem>>

GetProcessInstancesCountAsync()

Declaration
Task<int> GetProcessInstancesCountAsync()
Returns
TypeDescription
Task<int>

GetSchemesAsync(List<(string parameterName, SortDirection sortDirection)>, Paging)

Declaration
Task<List<SchemeItem>> GetSchemesAsync(List<(string parameterName, SortDirection sortDirection)> orderParameters, Paging paging)
Parameters
TypeNameDescription
List<(string parameterName, SortDirection sortDirection)>orderParameters
Pagingpaging
Returns
TypeDescription
Task<List<SchemeItem>>

GetSchemesCountAsync()

Declaration
Task<int> GetSchemesCountAsync()
Returns
TypeDescription
Task<int>

Extension Methods

Stay in the know
Build Workflow Applications Faster
Star us on GitHub