Interface IPersistenceProvider
OptimaJet.Workflow.Core.Persistence.IPersistenceProvider
Interface of a persistence provider, which provide storing of process's instance specific parameters and global parameters
Namespace: OptimaJet.Workflow.Core.Persistence
public interface IPersistenceProvider : IApprovalProvider, IFormDataProviderProperties
Name
Type
Id #StringUnique identifier of the persistence provider implementation
ConnectionString #StringConnection string of the persistence provider
IsBulkOperationsSupported #BooleanMethods
void Init(WorkflowRuntime runtime) #Init the provider
Parameters
Name
Type
Description
runtimeWorkflowRuntimeWorkflow runtime instance which owned the provider
Task InitializeProcessAsync(ProcessInstance processInstance) #Initialize a process instance in persistence store
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
Returns
Type
Description
TaskTask FillProcessParametersAsync(ProcessInstance processInstance) #Fills system ParameterPurpose.System and persisted ParameterPurpose.Persistence parameters of the process
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
Returns
Type
Description
TaskTask FillPersistedProcessParametersAsync(ProcessInstance processInstance) #Fills persisted ParameterPurpose.Persistence parameters of the process
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
Returns
Type
Description
TaskTask FillPersistedProcessParameterAsync(ProcessInstance processInstance, string parameterName) #Fills persisted ParameterPurpose.Persistence parameter of the process
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
parameterNameStringReturns
Type
Description
TaskTask FillSystemProcessParametersAsync(ProcessInstance processInstance) #Fills system ParameterPurpose.System parameters of the process
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
Returns
Type
Description
TaskTask SavePersistenceParametersAsync(ProcessInstance processInstance) #Saves persisted ParameterPurpose.Persistence parameters of the process to store
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
Returns
Type
Description
TaskTask SavePersistenceParameterAsync(ProcessInstance processInstance, string parameterName) #Save persisted ParameterPurpose.Persistence parameter of the process to store
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
parameterNameStringName of parameter for save
Returns
Type
Description
TaskTask RemoveParameterAsync(ProcessInstance processInstance, string parameterName) #Remove persisted ParameterPurpose.Persistence parameter of the process from store
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
parameterNameStringName of parameter for save
Returns
Type
Description
TaskTask SetWorkflowInitializedAsync(ProcessInstance processInstance) #Set process instance status to ProcessStatus.Initialized
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
Returns
Type
Description
TaskTask SetWorkflowIdledAsync(ProcessInstance processInstance) #Set process instance status to ProcessStatus.Idled
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
Returns
Type
Description
TaskTask SetWorkflowRunningAsync(ProcessInstance processInstance) #Set process instance status to ProcessStatus.Running
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
Returns
Type
Description
TaskTask SetWorkflowFinalizedAsync(ProcessInstance processInstance) #Set process instance status to ProcessStatus.Finalized
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
Returns
Type
Description
TaskTask SetProcessStatusAsync(Guid processId, ProcessStatus newStatus) #Set process instance status to newStatus
Parameters
Name
Type
Description
processIdGuidProcess id
newStatusProcessStatusNew process status
Returns
Type
Description
TaskTask SetWorkflowTerminatedAsync(ProcessInstance processInstance) #Set process instance status to ProcessStatus.Terminated
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
Returns
Type
Description
TaskTask WriteInitialRecordToHistoryAsync(ProcessInstance processInstance) #Write to table WorkflowProcessTransitionHistory initial record with first activity if can.
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
Returns
Type
Description
TaskTask UpdatePersistenceStateAsync(ProcessInstance processInstance, TransitionDefinition transition) #Updates system parameters of the process in the store
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process
transitionTransitionDefinitionLast executed transition
Returns
Type
Description
TaskTask<bool> IsProcessExistsAsync(Guid processId) #Checks existence of the process
Parameters
Name
Type
Description
processIdGuidId of the process
Returns
Type
Description
Task<Boolean>Task<bool> IsProcessExistsAsync(Guid processId, string tenantId) #Checks existence of the process in the specified tenant
Parameters
Name
Type
Description
processIdGuidId of the process
tenantIdStringTenant id of the process
Returns
Type
Description
Task<Boolean>Task<ProcessStatus> GetInstanceStatusAsync(Guid processId) #Returns status of the process ProcessStatus
Parameters
Name
Type
Description
processIdGuidId of the process
Returns
Type
Description
Task<ProcessStatus>Status of the process
Task BindProcessToNewSchemeAsync(ProcessInstance processInstance) #Saves information about changed scheme to the store
Parameters
Name
Type
Description
processInstanceProcessInstanceInstance of the process with changed scheme ProcessInstance.ProcessScheme
Returns
Type
Description
TaskTask RegisterTimerAsync(Guid processId, Guid rootProcessId, string name, DateTime nextExecutionDateTime, string tenantId, bool notOverrideIfExists) #Register a new timer
Parameters
Name
Type
Description
processIdGuidId of the process
rootProcessIdGuidId of the root process
nameStringTimer name TimerDefinition.Name
nextExecutionDateTimeDateTimeNext date and time of timer's execution
tenantIdStringTenant's identifier (if exist)
notOverrideIfExistsBooleanIf true specifies that the existing timer with same name will not be overriden TimerDefinition.NotOverrideIfExists
Returns
Type
Description
TaskTask ClearTimersAsync(Guid processId, List<string> timersIgnoreList) #Removes all timers from the store, exclude listed in ignore list
Parameters
Name
Type
Description
processIdGuidId of the process
timersIgnoreListList<String>Ignore list
Returns
Type
Description
TaskTask<List<ProcessTimer>> GetTimersForProcessAsync(Guid processId) #Get all timers of a process
Parameters
Name
Type
Description
processIdGuidId of the process
Returns
Type
Description
Task<ProcessTimer>Task DeleteProcessAsync(Guid processId) #Remove all information about the process from the store
Parameters
Name
Type
Description
processIdGuidId of the process
Returns
Type
Description
TaskTask DeleteProcessAsync(Guid[] processIds) #Remove all information about the process from the store
Parameters
Name
Type
Description
processIdsGuid[]List of ids of the process
Returns
Type
Description
TaskTask SaveGlobalParameterAsync<T>(string type, string name, T value) #Saves a global parameter value
Parameters
Name
Type
Description
typeStringLogical type of the parameter
nameStringName of the parameter
value{T}Value of the parameter
Returns
Type
Description
TaskTask<T> LoadGlobalParameterAsync<T>(string type, string name) #Returns a global parameter value
Parameters
Name
Type
Description
typeStringLogical type of the parameter
nameStringName of the parameter
Returns
Type
Description
Task<T>Value of the parameter
Task<Dictionary<string, T>> LoadGlobalParametersWithNamesAsync<T>(string type, Sorting sort = null) #Returns a values and names of global parameters
Parameters
Name
Type
Description
typeStringLogical type of the parameter
sortSortingField for sorting parameters
Returns
Type
Description
Task<String,{T>Dictionary of parameter names and values
Task<List<T>> LoadGlobalParametersAsync<T>(string type, Sorting sort = null) #Returns a global parameter values
Parameters
Name
Type
Description
typeStringLogical type of the parameter
sortSortingField for sorting parameters
Returns
Type
Description
Task<List<T>>List of parameter values
Task<PagedResponse<T>> LoadGlobalParametersWithPagingAsync<T>(string type, Paging paging, string name = null, Sorting sort = null) #Returns a global parameter values with paging and total quantity
Parameters
Name
Type
Description
typeStringLogical type of the parameter
pagingPagingPaging settings
nameString[Nullable] Search by name
sortSortingField for sorting parameters
Returns
Type
Description
Task<PagedResponse<T>>Returns a global parameter values with paging and total quantity
Task DeleteGlobalParametersAsync(string type, string name = null) #Deletes a global parameter
Parameters
Name
Type
Description
typeStringLogical type of the parameter
nameStringName of the parameter
Returns
Type
Description
TaskTask SaveTenantGlobalParameterAsync<T>(TenantGlobalParameterKey key, T value) #Saves a tenant-scoped global parameter value
Parameters
Name
Type
Description
value{T}Value of the parameter
Returns
Type
Description
TaskTask<T> LoadTenantGlobalParameterAsync<T>(TenantGlobalParameterKey key) #Returns a tenant-scoped global parameter value
Parameters
Name
Type
Description
Returns
Type
Description
Task<T>Value of the parameter
Task<Dictionary<string, T>> LoadTenantGlobalParametersWithNamesAsync<T>(TenantGlobalParameterScope scope, Sorting sort = null) #Returns values and names of tenant-scoped global parameters
Parameters
Name
Type
Description
scopeTenantGlobalParameterScopeGlobal parameter scope.
sortSortingField for sorting parameters
Returns
Type
Description
Task<String,{T>Dictionary of parameter names and values
Task<List<T>> LoadTenantGlobalParametersAsync<T>(TenantGlobalParameterScope scope, Sorting sort = null) #Returns tenant-scoped global parameter values
Parameters
Name
Type
Description
scopeTenantGlobalParameterScopeGlobal parameter scope.
sortSortingField for sorting parameters
Returns
Type
Description
Task<List<T>>List of parameter values
Task<PagedResponse<T>> LoadTenantGlobalParametersWithPagingAsync<T>(TenantGlobalParameterScope scope, Paging paging, Sorting sort = null) #Returns tenant-scoped global parameter values with paging and total quantity
Parameters
Name
Type
Description
scopeTenantGlobalParameterScopeGlobal parameter scope.
pagingPagingPaging settings
sortSortingField for sorting parameters
Returns
Type
Description
Task<PagedResponse<T>>Returns tenant-scoped global parameter values with paging and total quantity
Task DeleteTenantGlobalParametersAsync(TenantGlobalParameterScope scope) #Deletes tenant-scoped global parameters
Parameters
Name
Type
Description
scopeTenantGlobalParameterScopeGlobal parameter scope.
Returns
Type
Description
TaskTask DeleteTenantGlobalParameterAsync(TenantGlobalParameterKey key) #Deletes a tenant-scoped global parameter
Parameters
Name
Type
Description
keyTenantGlobalParameterKeyGlobal parameter key.
Returns
Type
Description
TaskTask<List<ProcessHistoryItem>> GetProcessHistoryAsync(Guid processId, Paging paging = null) #Returns the history of process
Parameters
Name
Type
Description
processIdGuidId of the process
pagingPagingReturns
Type
Description
Task<ProcessHistoryItem>Task<int> GetProcessHistoryCountAsync(Guid processId) #Parameters
Name
Type
Description
processIdGuidReturns
Type
Description
Task<Int32>Task BulkInitProcessesAsync(List<ProcessInstance> instances, ProcessStatus status, CancellationToken token) #Parameters
Name
Type
Description
instancesList<ProcessInstance>statusProcessStatustokenCancellationTokenReturns
Type
Description
TaskTask BulkInitProcessesAsync(List<ProcessInstance> instances, List<TimerToRegister> timers, ProcessStatus status, CancellationToken token) #Parameters
Name
Type
Description
instancesList<ProcessInstance>timersList<TimerToRegister>statusProcessStatustokenCancellationTokenReturns
Type
Description
TaskTask<List<IProcessInstanceTreeItem>> GetProcessInstanceTreeAsync(Guid rootProcessId) #Parameters
Name
Type
Description
rootProcessIdGuidReturns
Type
Description
Task<IProcessInstanceTreeItem>Task<bool> MultiServerRuntimesExistAsync() #Returns
Type
Description
Task<Boolean>Task<WorkflowRuntimeModel> CreateWorkflowRuntimeAsync(string runtimeId, RuntimeStatus status) #Parameters
Name
Type
Description
runtimeIdStringstatusRuntimeStatusReturns
Type
Description
Task<WorkflowRuntimeModel>Task<WorkflowRuntimeModel> UpdateWorkflowRuntimeStatusAsync(WorkflowRuntimeModel runtime, RuntimeStatus status) #Parameters
Name
Type
Description
runtimeWorkflowRuntimeModelstatusRuntimeStatusReturns
Type
Description
Task<WorkflowRuntimeModel>Task<(bool Success, WorkflowRuntimeModel UpdatedModel)> UpdateWorkflowRuntimeRestorerAsync(WorkflowRuntimeModel runtime, string restorerId) #Parameters
Name
Type
Description
runtimeWorkflowRuntimeModelrestorerIdStringReturns
Type
Description
Task<WorkflowRuntimeModel>Task<List<Guid>> GetRunningProcessesAsync(string runtimeId = null) #Parameters
Name
Type
Description
runtimeIdStringReturns
Type
Description
Task<Guid>Task<List<ProcessTimer>> GetActiveTimersForProcessAsync(Guid processId) #Parameters
Name
Type
Description
processIdGuidReturns
Type
Description
Task<ProcessTimer>Task DeleteInactiveTimersByProcessIdAsync(Guid processId) #Parameters
Name
Type
Description
processIdGuidReturns
Type
Description
TaskTask DeleteTimerAsync(Guid timerId) #Parameters
Name
Type
Description
timerIdGuidReturns
Type
Description
TaskTask<List<WorkflowTimer>> GetTopTimersToExecuteAsync(int top) #Parameters
Name
Type
Description
topInt32Returns
Type
Description
Task<WorkflowTimer>Task<int> SetTimerIgnoreAsync(Guid id) #Parameters
Name
Type
Description
idGuidReturns
Type
Description
Task<Int32>Task<int> ActiveMultiServerRuntimesCountAsync(string currentRuntimeId) #Parameters
Name
Type
Description
currentRuntimeIdStringReturns
Type
Description
Task<Int32>Task<WorkflowRuntimeModel> GetWorkflowRuntimeModelAsync(string runtimeId) #Parameters
Name
Type
Description
runtimeIdStringReturns
Type
Description
Task<WorkflowRuntimeModel>Task<List<WorkflowRuntimeModel>> GetWorkflowRuntimesAsync() #Returns
Type
Description
Task<WorkflowRuntimeModel>Task<int> SendRuntimeLastAliveSignalAsync() #Returns
Type
Description
Task<Int32>Task<DateTime?> GetNextTimerDateAsync(TimerCategory timerCategory, int timerInterval) #Parameters
Name
Type
Description
timerCategoryTimerCategorytimerIntervalInt32Returns
Type
Description
Task<DateTime>Task DeleteWorkflowRuntimeAsync(string name) #Parameters
Name
Type
Description
nameStringReturns
Type
Description
TaskTask DropUnusedWorkflowProcessSchemeAsync() #Returns
Type
Description
TaskTask<List<ProcessInstanceItem>> GetProcessInstancesAsync(List<(string parameterName, SortDirection sortDirection)> orderParameters = null, Paging paging = null) #Parameters
Name
Type
Description
orderParametersList<SortDirection>pagingPagingReturns
Type
Description
Task<ProcessInstanceItem>Task<int> GetProcessInstancesCountAsync() #Returns
Type
Description
Task<Int32>Task<List<SchemeItem>> GetSchemesAsync(List<(string parameterName, SortDirection sortDirection)> orderParameters, Paging paging) #Parameters
Name
Type
Description
orderParametersList<SortDirection>pagingPagingReturns
Type
Description
Task<SchemeItem>Task<int> GetSchemesCountAsync() #Returns
Type
Description
Task<Int32>