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
Type | Name | Description |
---|
WorkflowRuntime | runtime | Workflow runtime instance which owned the provider |
InitializeProcessAsync(ProcessInstance)
Initialize a process instance in persistence store
Declaration
Task InitializeProcessAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
Returns
FillProcessParametersAsync(ProcessInstance)
Fills system ParameterPurpose.System and persisted ParameterPurpose.Persistence parameters of the process
Declaration
Task FillProcessParametersAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
Returns
FillPersistedProcessParametersAsync(ProcessInstance)
Fills persisted ParameterPurpose.Persistence parameters of the process
Declaration
Task FillPersistedProcessParametersAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
Returns
FillPersistedProcessParameterAsync(ProcessInstance, string)
Fills persisted ParameterPurpose.Persistence parameter of the process
Declaration
Task FillPersistedProcessParameterAsync(ProcessInstance processInstance, string parameterName)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
string | parameterName | |
Returns
FillSystemProcessParametersAsync(ProcessInstance)
Fills system ParameterPurpose.System parameters of the process
Declaration
Task FillSystemProcessParametersAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
Returns
SavePersistenceParametersAsync(ProcessInstance)
Saves persisted ParameterPurpose.Persistence parameters of the process to store
Declaration
Task SavePersistenceParametersAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
Returns
SavePersistenceParameterAsync(ProcessInstance, string)
Save persisted ParameterPurpose.Persistence parameter of the process to store
Declaration
Task SavePersistenceParameterAsync(ProcessInstance processInstance, string parameterName)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
string | parameterName | Name of parameter for save |
Returns
RemoveParameterAsync(ProcessInstance, string)
Remove persisted ParameterPurpose.Persistence parameter of the process from store
Declaration
Task RemoveParameterAsync(ProcessInstance processInstance, string parameterName)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
string | parameterName | Name of parameter for save |
Returns
SetWorkflowInitializedAsync(ProcessInstance)
Set process instance status to ProcessStatus.Initialized
Declaration
Task SetWorkflowInitializedAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
Returns
SetWorkflowIdledAsync(ProcessInstance)
Set process instance status to ProcessStatus.Idled
Declaration
Task SetWorkflowIdledAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
Returns
SetWorkflowRunningAsync(ProcessInstance)
Set process instance status to ProcessStatus.Running
Declaration
Task SetWorkflowRunningAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
Returns
SetWorkflowFinalizedAsync(ProcessInstance)
Set process instance status to ProcessStatus.Finalized
Declaration
Task SetWorkflowFinalizedAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
Returns
SetProcessStatusAsync(Guid, ProcessStatus)
Set process instance status to newStatus
Declaration
Task SetProcessStatusAsync(Guid processId, ProcessStatus newStatus)
Parameters
Type | Name | Description |
---|
Guid | processId | Process id |
ProcessStatus | newStatus | New process status |
Returns
SetWorkflowTerminatedAsync(ProcessInstance)
Set process instance status to ProcessStatus.Terminated
Declaration
Task SetWorkflowTerminatedAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
Returns
WriteInitialRecordToHistoryAsync(ProcessInstance)
Write to table WorkflowProcessTransitionHistory initial record with first activity if can.
Declaration
Task WriteInitialRecordToHistoryAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
Returns
UpdatePersistenceStateAsync(ProcessInstance, TransitionDefinition)
Updates system parameters of the process in the store
Declaration
Task UpdatePersistenceStateAsync(ProcessInstance processInstance, TransitionDefinition transition)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process |
TransitionDefinition | transition | Last executed transition |
Returns
IsProcessExistsAsync(Guid)
Checks existence of the process
Declaration
Task<bool> IsProcessExistsAsync(Guid processId)
Parameters
Type | Name | Description |
---|
Guid | processId | Id of the process |
Returns
Type | Description |
---|
Task<bool> | |
GetInstanceStatusAsync(Guid)
Returns status of the process ProcessStatus
Declaration
Task<ProcessStatus> GetInstanceStatusAsync(Guid processId)
Parameters
Type | Name | Description |
---|
Guid | processId | Id of the process |
Returns
Type | Description |
---|
Task<ProcessStatus> | Status of the process |
BindProcessToNewSchemeAsync(ProcessInstance)
Saves information about changed scheme to the store
Declaration
Task BindProcessToNewSchemeAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process with changed scheme <xref href="OptimaJet.Workflow.Core.Model.ProcessInstance.ProcessScheme" data-throw-if-not-resolved="false"></xref> |
Returns
BindProcessToNewSchemeAsync(ProcessInstance, bool)
Saves information about changed scheme to the store
Declaration
Task BindProcessToNewSchemeAsync(ProcessInstance processInstance, bool resetIsDeterminingParametersChanged)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Instance of the process with changed scheme <xref href="OptimaJet.Workflow.Core.Model.ProcessInstance.ProcessScheme" data-throw-if-not-resolved="false"></xref> |
bool | resetIsDeterminingParametersChanged | True if required to reset IsDeterminingParametersChanged flag <xref href="OptimaJet.Workflow.Core.Model.ProcessInstance.IsDeterminingParametersChanged" data-throw-if-not-resolved="false"></xref> |
Returns
RegisterTimerAsync(Guid, Guid, string, DateTime, bool)
Register a new timer
Declaration
Task RegisterTimerAsync(Guid processId, Guid rootProcessId, string name, DateTime nextExecutionDateTime, bool notOverrideIfExists)
Parameters
Type | Name | Description |
---|
Guid | processId | Id of the process |
Guid | rootProcessId | Id of the root process |
string | name | Timer name <see cref="!:TimerDefinition.Name"></see> |
DateTime | nextExecutionDateTime | Next date and time of timer's execution |
bool | notOverrideIfExists | If 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
ClearTimersAsync(Guid, List<string>)
Removes all timers from the store, exclude listed in ignore list
Declaration
Task ClearTimersAsync(Guid processId, List<string> timersIgnoreList)
Parameters
Type | Name | Description |
---|
Guid | processId | Id of the process |
List<string> | timersIgnoreList | Ignore list |
Returns
GetTimersForProcessAsync(Guid)
Get all timers of a process
Declaration
Task<List<ProcessTimer>> GetTimersForProcessAsync(Guid processId)
Parameters
Type | Name | Description |
---|
Guid | processId | Id of the process |
Returns
Type | Description |
---|
Task<List<ProcessTimer>> | |
DeleteProcessAsync(Guid)
Remove all information about the process from the store
Declaration
Task DeleteProcessAsync(Guid processId)
Parameters
Type | Name | Description |
---|
Guid | processId | Id of the process |
Returns
DeleteProcessAsync(Guid[])
Remove all information about the process from the store
Declaration
Task DeleteProcessAsync(Guid[] processIds)
Parameters
Type | Name | Description |
---|
System.Guid[] | processIds | List of ids of the process |
Returns
SaveGlobalParameterAsync<T>(string, string, T)
Saves a global parameter value
Declaration
Task SaveGlobalParameterAsync<T>(string type, string name, T value)
Parameters
Type | Name | Description |
---|
string | type | Logical type of the parameter |
string | name | Name of the parameter |
{T} | value | Value of the parameter |
Returns
LoadGlobalParameterAsync<T>(string, string)
Returns a global parameter value
Declaration
Task<T> LoadGlobalParameterAsync<T>(string type, string name)
Parameters
Type | Name | Description |
---|
string | type | Logical type of the parameter |
string | name | Name of the parameter |
Returns
Type | Description |
---|
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
Type | Name | Description |
---|
string | type | Logical type of the parameter |
Sorting | sort | Field for sorting parameters |
Returns
Type | Description |
---|
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
Type | Name | Description |
---|
string | type | Logical type of the parameter |
Sorting | sort | Field for sorting parameters |
Returns
Type | Description |
---|
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
Type | Name | Description |
---|
string | type | Logical type of the parameter |
Paging | paging | Paging settings |
string | name | [Nullable] Search by name |
Sorting | sort | Field for sorting parameters |
Returns
Type | Description |
---|
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
Type | Name | Description |
---|
string | type | Logical type of the parameter |
string | name | Name of the parameter |
Returns
GetProcessHistoryAsync(Guid, Paging)
Returns the history of process
Declaration
Task<List<ProcessHistoryItem>> GetProcessHistoryAsync(Guid processId, Paging paging = null)
Parameters
Type | Name | Description |
---|
Guid | processId | Id of the process |
Paging | paging | |
Returns
Type | Description |
---|
Task<List<ProcessHistoryItem>> | |
GetProcessHistoryCountAsync(Guid)
Declaration
Task<int> GetProcessHistoryCountAsync(Guid processId)
Parameters
Type | Name | Description |
---|
Guid | processId | |
Returns
BulkInitProcessesAsync(List<ProcessInstance>, ProcessStatus, CancellationToken)
Declaration
Task BulkInitProcessesAsync(List<ProcessInstance> instances, ProcessStatus status, CancellationToken token)
Parameters
Type | Name | Description |
---|
List<ProcessInstance> | instances | |
ProcessStatus | status | |
CancellationToken | token | |
Returns
BulkInitProcessesAsync(List<ProcessInstance>, List<TimerToRegister>, ProcessStatus, CancellationToken)
Declaration
Task BulkInitProcessesAsync(List<ProcessInstance> instances, List<TimerToRegister> timers, ProcessStatus status, CancellationToken token)
Parameters
Type | Name | Description |
---|
List<ProcessInstance> | instances | |
List<TimerToRegister> | timers | |
ProcessStatus | status | |
CancellationToken | token | |
Returns
GetProcessInstanceTreeAsync(Guid)
Declaration
Task<List<IProcessInstanceTreeItem>> GetProcessInstanceTreeAsync(Guid rootProcessId)
Parameters
Type | Name | Description |
---|
Guid | rootProcessId | |
Returns
Type | Description |
---|
Task<List<IProcessInstanceTreeItem>> | |
MultiServerRuntimesExistAsync()
Declaration
Task<bool> MultiServerRuntimesExistAsync()
Returns
Type | Description |
---|
Task<bool> | |
CreateWorkflowRuntimeAsync(string, RuntimeStatus)
Declaration
Task<WorkflowRuntimeModel> CreateWorkflowRuntimeAsync(string runtimeId, RuntimeStatus status)
Parameters
Type | Name | Description |
---|
string | runtimeId | |
RuntimeStatus | status | |
Returns
Type | Description |
---|
Task<WorkflowRuntimeModel> | |
UpdateWorkflowRuntimeStatusAsync(WorkflowRuntimeModel, RuntimeStatus)
Declaration
Task<WorkflowRuntimeModel> UpdateWorkflowRuntimeStatusAsync(WorkflowRuntimeModel runtime, RuntimeStatus status)
Parameters
Type | Name | Description |
---|
WorkflowRuntimeModel | runtime | |
RuntimeStatus | status | |
Returns
Type | Description |
---|
Task<WorkflowRuntimeModel> | |
UpdateWorkflowRuntimeRestorerAsync(WorkflowRuntimeModel, string)
Declaration
Task<(bool Success, WorkflowRuntimeModel UpdatedModel)> UpdateWorkflowRuntimeRestorerAsync(WorkflowRuntimeModel runtime, string restorerId)
Parameters
Type | Name | Description |
---|
WorkflowRuntimeModel | runtime | |
string | restorerId | |
Returns
Type | Description |
---|
Task<(bool Success, WorkflowRuntimeModel UpdatedModel)> | |
GetRunningProcessesAsync(string)
Declaration
Task<List<Guid>> GetRunningProcessesAsync(string runtimeId = null)
Parameters
Type | Name | Description |
---|
string | runtimeId | |
Returns
Type | Description |
---|
Task<List<Guid>> | |
GetActiveTimersForProcessAsync(Guid)
Declaration
Task<List<ProcessTimer>> GetActiveTimersForProcessAsync(Guid processId)
Parameters
Type | Name | Description |
---|
Guid | processId | |
Returns
Type | Description |
---|
Task<List<ProcessTimer>> | |
DeleteInactiveTimersByProcessIdAsync(Guid)
Declaration
Task DeleteInactiveTimersByProcessIdAsync(Guid processId)
Parameters
Type | Name | Description |
---|
Guid | processId | |
Returns
DeleteTimerAsync(Guid)
Declaration
Task DeleteTimerAsync(Guid timerId)
Parameters
Type | Name | Description |
---|
Guid | timerId | |
Returns
GetTopTimersToExecuteAsync(int)
Declaration
Task<List<WorkflowTimer>> GetTopTimersToExecuteAsync(int top)
Parameters
Type | Name | Description |
---|
int | top | |
Returns
Type | Description |
---|
Task<List<WorkflowTimer>> | |
SetTimerIgnoreAsync(Guid)
Declaration
Task<int> SetTimerIgnoreAsync(Guid id)
Parameters
Type | Name | Description |
---|
Guid | id | |
Returns
ActiveMultiServerRuntimesCountAsync(string)
Declaration
Task<int> ActiveMultiServerRuntimesCountAsync(string currentRuntimeId)
Parameters
Type | Name | Description |
---|
string | currentRuntimeId | |
Returns
GetWorkflowRuntimeModelAsync(string)
Declaration
Task<WorkflowRuntimeModel> GetWorkflowRuntimeModelAsync(string runtimeId)
Parameters
Type | Name | Description |
---|
string | runtimeId | |
Returns
Type | Description |
---|
Task<WorkflowRuntimeModel> | |
GetWorkflowRuntimesAsync()
Declaration
Task<List<WorkflowRuntimeModel>> GetWorkflowRuntimesAsync()
Returns
Type | Description |
---|
Task<List<WorkflowRuntimeModel>> | |
SendRuntimeLastAliveSignalAsync()
Declaration
Task<int> SendRuntimeLastAliveSignalAsync()
Returns
GetNextTimerDateAsync(TimerCategory, int)
Declaration
Task<DateTime?> GetNextTimerDateAsync(TimerCategory timerCategory, int timerInterval)
Parameters
Type | Name | Description |
---|
TimerCategory | timerCategory | |
int | timerInterval | |
Returns
Type | Description |
---|
Task<DateTime?> | |
DeleteWorkflowRuntimeAsync(string)
Declaration
Task DeleteWorkflowRuntimeAsync(string name)
Parameters
Type | Name | Description |
---|
string | name | |
Returns
DropUnusedWorkflowProcessSchemeAsync()
Declaration
Task DropUnusedWorkflowProcessSchemeAsync()
Returns
GetProcessInstancesAsync(List<(string parameterName, SortDirection sortDirection)>, Paging)
Declaration
Task<List<ProcessInstanceItem>> GetProcessInstancesAsync(List<(string parameterName, SortDirection sortDirection)> orderParameters = null, Paging paging = null)
Parameters
Type | Name | Description |
---|
List<(string parameterName, SortDirection sortDirection)> | orderParameters | |
Paging | paging | |
Returns
Type | Description |
---|
Task<List<ProcessInstanceItem>> | |
GetProcessInstancesCountAsync()
Declaration
Task<int> GetProcessInstancesCountAsync()
Returns
GetSchemesAsync(List<(string parameterName, SortDirection sortDirection)>, Paging)
Declaration
Task<List<SchemeItem>> GetSchemesAsync(List<(string parameterName, SortDirection sortDirection)> orderParameters, Paging paging)
Parameters
Type | Name | Description |
---|
List<(string parameterName, SortDirection sortDirection)> | orderParameters | |
Paging | paging | |
Returns
Type | Description |
---|
Task<List<SchemeItem>> | |
GetSchemesCountAsync()
Declaration
Task<int> GetSchemesCountAsync()
Returns
Extension Methods