Assembly: OptimaJet.Workflow.MySQL

Class MySQLProvider

OptimaJet.Workflow.MySQL.MySQLProvider

public class MySQLProvider : IWorkflowProvider, IPersistenceProvider, IApprovalProvider, IFormDataProvider, ISchemePersistenceProvider<XElement>, IWorkflowGenerator<XElement>, IMigratable

Type Hierarchy

Constructors

public MySQLProvider(string connectionString, bool writeToHistory = true, bool writeSubProcessToRoot = false) #

Parameters

Name
Type
Description
connectionString
String
writeToHistory
Boolean
writeSubProcessToRoot
Boolean
public MySQLProvider(PersistenceProviderOptions options) #

Parameters

Name
Type
Description
options
PersistenceProviderOptions

Properties

public string Id { get; } #
Gets the identifier of the persistence provider implementation.
public string SchemaName { get; } #
Database schema name for workflow persistence objects
public int GlobalCommandTimeout { get; } #
Global timeout for executing commands on the database
public string ConnectionString { get; } #
Connection string to the database
public WorkflowProcessInstance WorkflowProcessInstance { get; } #
public WorkflowProcessInstanceStatus WorkflowProcessInstanceStatus { get; } #
public WorkflowProcessInstancePersistence WorkflowProcessInstancePersistence { get; } #
public WorkflowProcessTransitionHistory WorkflowProcessTransitionHistory { get; } #
public WorkflowProcessTimer WorkflowProcessTimer { get; } #
public WorkflowInbox WorkflowInbox { get; } #
public WorkflowApprovalHistory WorkflowApprovalHistory { get; } #
public WorkflowGlobalParameter WorkflowGlobalParameter { get; } #
public WorkflowProcessScheme WorkflowProcessScheme { get; } #
public WorkflowRuntime WorkflowRuntime { get; } #
public WorkflowScheme WorkflowScheme { get; } #
public WorkflowSync WorkflowSync { get; } #
public ProcessInstanceTree ProcessInstanceTree { get; } #
public WorkflowForm WorkflowForm { get; } #
public bool IsBulkOperationsSupported { get; } #
Gets a value indicating whether the provider supports bulk process initialization.

Methods

public void Init(WorkflowRuntime runtime) #
Initializes the persistence provider for a WorkflowRuntime.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The WorkflowRuntime that uses this provider.
public MySqlConnection OpenConnection() #
Opens a new database connection

Returns

Type
Description
MySqlConnection
A new database connection
public virtual Task DeleteInactiveTimersByProcessIdAsync(Guid processId) #
Deletes timer registrations for a ProcessInstance that have been marked as ignored.

Parameters

Name
Type
Description
processId
Guid
The process identifier.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task DeleteTimerAsync(Guid timerId) #
Deletes a persisted timer registration.

Parameters

Name
Type
Description
timerId
Guid
The timer registration identifier.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task<List<Guid>> GetRunningProcessesAsync(string runtimeId = null) #
Gets the identifiers of ProcessInstance objects whose status is ProcessStatus.Running.

Parameters

Name
Type
Description
runtimeId
String
The optional runtime identifier used to filter the ProcessInstance objects, or null or an empty string to include all WorkflowRuntime instances.

Returns

Type
Description
Task<Guid>
The identifiers of the matching ProcessInstance objects.
public virtual Task<WorkflowRuntimeModel> CreateWorkflowRuntimeAsync(string runtimeId, RuntimeStatus status) #
Creates a persisted operational record for a WorkflowRuntime.

Parameters

Name
Type
Description
runtimeId
String
The runtime identifier.
status
RuntimeStatus
The initial RuntimeStatus.

Returns

Type
Description
Task<WorkflowRuntimeModel>
The created WorkflowRuntimeModel.
public virtual Task DeleteWorkflowRuntimeAsync(string name) #
Deletes a persisted WorkflowRuntime record.

Parameters

Name
Type
Description
name
String
The runtime identifier.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public Task DropUnusedWorkflowProcessSchemeAsync() #
Deletes obsolete compiled process schemes that are not referenced by persisted ProcessInstance records when the provider supports this cleanup operation.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
NotImplementedException
The provider does not support cleanup of unused compiled process schemes.
public Task<List<ProcessInstanceItem>> GetProcessInstancesAsync(List<(string parameterName, SortDirection sortDirection)> orderParameters = null, Paging paging = null) #
Gets persisted process instance records using optional ordering and paging.

Parameters

Name
Type
Description
orderParameters
List<String, SortDirection>
The ordered list of persisted field names and corresponding SortDirection values, or null to use the provider's default ordering.
paging
Paging
The optional Paging settings.

Returns

Type
Description
Task<ProcessInstanceItem>
The selected ProcessInstanceItem records.
public Task<int> GetProcessInstancesCountAsync() #
Gets the total number of persisted process instance records.

Returns

Type
Description
Task<Int32>
The number of persisted process instance records.
public Task<List<SchemeItem>> GetSchemesAsync(List<(string parameterName, SortDirection sortDirection)> orderParameters = null, Paging paging = null) #
Gets persisted workflow scheme records using the specified ordering and paging.

Parameters

Name
Type
Description
orderParameters
List<String, SortDirection>
The ordered list of persisted field names and corresponding SortDirection values.
paging
Paging
The Paging settings.

Returns

Type
Description
Task<SchemeItem>
The selected SchemeItem records.
public Task<int> GetSchemesCountAsync() #
Gets the total number of persisted workflow scheme records.

Returns

Type
Description
Task<Int32>
The number of persisted workflow scheme records.
public virtual Task<WorkflowRuntimeModel> UpdateWorkflowRuntimeStatusAsync(WorkflowRuntimeModel runtime, RuntimeStatus status) #
Updates the persisted status of a WorkflowRuntime using its concurrency token.

Parameters

Name
Type
Description
runtime
WorkflowRuntimeModel
The WorkflowRuntimeModel containing the current WorkflowRuntimeModel.Lock.
status
RuntimeStatus
The new RuntimeStatus.

Returns

Type
Description
Task<WorkflowRuntimeModel>
The updated WorkflowRuntimeModel.

Exceptions

Type
Description
ImpossibleToSetRuntimeStatusException
The WorkflowRuntimeModel cannot be updated with the supplied concurrency token.
public virtual Task<(bool Success, WorkflowRuntimeModel UpdatedModel)> UpdateWorkflowRuntimeRestorerAsync(WorkflowRuntimeModel runtime, string restorerId) #
Attempts to assign a WorkflowRuntime to restore processes associated with another WorkflowRuntime.

Parameters

Name
Type
Description
runtime
WorkflowRuntimeModel
The WorkflowRuntimeModel containing the current WorkflowRuntimeModel.Lock.
restorerId
String
The runtime identifier to store in WorkflowRuntimeModel.RestorerId.

Returns

Type
Description
Task<Boolean, WorkflowRuntimeModel>
A result that indicates whether the update succeeded and contains the updated WorkflowRuntimeModel when it did.
public virtual Task<bool> MultiServerRuntimesExistAsync() #
Determines whether persistence contains a multi-server WorkflowRuntime record whose status is neither RuntimeStatus.Dead nor RuntimeStatus.Terminated.

Returns

Type
Description
Task<Boolean>
true when such a WorkflowRuntime record exists; otherwise, false.
public virtual Task<int> ActiveMultiServerRuntimesCountAsync(string currentRuntimeId) #
Counts multi-server WorkflowRuntime records whose status is RuntimeStatus.Alive, RuntimeStatus.Restore, or RuntimeStatus.SelfRestore, excluding the specified runtime.

Parameters

Name
Type
Description
currentRuntimeId
String
The runtime identifier to exclude from the count.

Returns

Type
Description
Task<Int32>
The number of other active multi-server WorkflowRuntime records.
public virtual Task InitializeProcessAsync(ProcessInstance processInstance) #
Creates the persisted process instance record for a ProcessInstance.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance to persist.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
ProcessAlreadyExistsException
A persisted record already exists with the ProcessInstance.ProcessId of processInstance.
public virtual Task BindProcessToNewSchemeAsync(ProcessInstance processInstance) #
Updates a persisted ProcessInstance to reference its new process scheme.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose ProcessInstance.ProcessScheme has changed.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
ProcessNotFoundException
No persisted record exists with the ProcessInstance.ProcessId of processInstance.
[Obsolete("Use BindProcessToNewSchemeAsync(ProcessInstance processInstance) instead.")] public virtual Task BindProcessToNewSchemeAsync(ProcessInstance processInstance, bool resetIsDeterminingParametersChanged) Obsolete #

Parameters

Name
Type
Description
processInstance
ProcessInstance
resetIsDeterminingParametersChanged
Boolean

Returns

Type
Description
Task
public virtual Task FillProcessParametersAsync(ProcessInstance processInstance) #
Loads ParameterPurpose.System and ParameterPurpose.Persistence process parameters into a ProcessInstance.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance to populate.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task FillPersistedProcessParametersAsync(ProcessInstance processInstance) #
Loads all ParameterPurpose.Persistence process parameters into a ProcessInstance.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance to populate.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task FillPersistedProcessParameterAsync(ProcessInstance processInstance, string parameterName) #
Loads one ParameterPurpose.Persistence process parameter into a ProcessInstance.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance to populate.
parameterName
String
The parameter name.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task FillSystemProcessParametersAsync(ProcessInstance processInstance) #
Loads ParameterPurpose.System process parameters into a ProcessInstance.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance to populate.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task SavePersistenceParametersAsync(ProcessInstance processInstance) #
Saves changed process parameters whose purpose is ParameterPurpose.Persistence.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose parameters are saved.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
ArgumentNullException
processInstance is null.
public virtual Task SavePersistenceParameterAsync(ProcessInstance processInstance, string parameterName) #
Saves one modified process parameter whose purpose is ParameterPurpose.Persistence.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose parameter is saved.
parameterName
String
The parameter name.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
ArgumentNullException
processInstance is null.
ArgumentException
parameterName is null or empty.
InvalidOperationException
No modified ParameterPurpose.Persistence parameter named parameterName is available to save.
public virtual Task RemoveParameterAsync(ProcessInstance processInstance, string parameterName) #
Deletes the persisted value of a named process parameter.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose parameter value is deleted.
parameterName
String
The parameter name.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task SetProcessStatusAsync(Guid processId, ProcessStatus newStatus) #
Sets the ProcessStatus of a ProcessInstance.

Parameters

Name
Type
Description
processId
Guid
The process identifier.
newStatus
ProcessStatus
The ProcessStatus to persist.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
ImpossibleToSetStatusException
The ProcessStatus cannot be changed.
public virtual Task SetWorkflowInitializedAsync(ProcessInstance processInstance) #
Sets the process instance status to ProcessStatus.Initialized.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose status is set.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
ImpossibleToSetStatusException
The ProcessStatus cannot be changed.
public virtual Task SetWorkflowIdledAsync(ProcessInstance processInstance) #
Sets the process instance status to ProcessStatus.Idled.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose status is set.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
ImpossibleToSetStatusException
The ProcessStatus cannot be changed.
public virtual Task SetWorkflowRunningAsync(ProcessInstance processInstance) #
Sets the process instance status to ProcessStatus.Running.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose status is set.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
ImpossibleToSetStatusException
The ProcessStatus cannot be changed.
public virtual Task SetWorkflowFinalizedAsync(ProcessInstance processInstance) #
Sets the process instance status to ProcessStatus.Finalized.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose status is set.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
ImpossibleToSetStatusException
The ProcessStatus cannot be changed.
public virtual Task SetWorkflowTerminatedAsync(ProcessInstance processInstance) #
Sets the process instance status to ProcessStatus.Terminated.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose status is set.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
ImpossibleToSetStatusException
The ProcessStatus cannot be changed.
public Task WriteInitialRecordToHistoryAsync(ProcessInstance processInstance) #
Writes the initial transition history record for the current activity when transition history persistence is enabled.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose initial record is written.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task UpdatePersistenceStateAsync(ProcessInstance processInstance, TransitionDefinition transition) #
Updates persisted process activity, state, and transition history for an executed transition according to the destination activity's persistence settings.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance that completed the transition.
transition
TransitionDefinition
The executed TransitionDefinition.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Remarks

State and transition history persistence are controlled independently by ActivityDefinition.DisablePersistState and ActivityDefinition.DisablePersistTransitionHistory.
public virtual Task<bool> IsProcessExistsAsync(Guid processId) #
Determines whether a ProcessInstance exists in persistence.

Parameters

Name
Type
Description
processId
Guid
The process identifier.

Returns

Type
Description
Task<Boolean>
true if the ProcessInstance exists; otherwise, false.
public virtual Task<bool> IsProcessExistsAsync(Guid processId, string tenantId) #
Determines whether a ProcessInstance exists in persistence for a tenant.

Parameters

Name
Type
Description
processId
Guid
The process identifier.
tenantId
String
The tenant identifier.

Returns

Type
Description
Task<Boolean>
true if the ProcessInstance exists for the tenant; otherwise, false.
public virtual Task<ProcessStatus> GetInstanceStatusAsync(Guid processId) #
Gets the ProcessStatus of a ProcessInstance.

Parameters

Name
Type
Description
processId
Guid
The process identifier.

Returns

Type
Description
Task<ProcessStatus>
The persisted ProcessStatus, ProcessStatus.NotFound when the process has no status record, or ProcessStatus.Unknown when the persisted status is not recognized.
public virtual Task DeleteProcessAsync(Guid[] processIds) #
Deletes persisted process instance records and related records managed by the provider.

Parameters

Name
Type
Description
processIds
Guid[]
The process identifiers.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task SaveGlobalParameterAsync<T>(string type, string name, T value) #
Saves a global parameter value that is not scoped to a tenant.

Parameters

Name
Type
Description
type
String
The logical parameter type.
name
String
The parameter name.
value
{T}
The parameter value.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task SaveTenantGlobalParameterAsync<T>(TenantGlobalParameterKey key, T value) #
Saves a global parameter value in the tenant scope specified by a TenantGlobalParameterKey.

Parameters

Name
Type
Description
key
TenantGlobalParameterKey
The TenantGlobalParameterKey. Its TenantGlobalParameterKey.Name is required.
value
{T}
The parameter value.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task<T> LoadGlobalParameterAsync<T>(string type, string name) #
Loads a global parameter value that is not scoped to a tenant.

Parameters

Name
Type
Description
type
String
The logical parameter type.
name
String
The parameter name.

Returns

Type
Description
Task<T>
The parameter value, or the default value of T when no matching parameter exists.
public virtual Task<T> LoadTenantGlobalParameterAsync<T>(TenantGlobalParameterKey key) #
Loads a global parameter value from the tenant scope specified by a TenantGlobalParameterKey.

Parameters

Name
Type
Description
key
TenantGlobalParameterKey
The TenantGlobalParameterKey. Its TenantGlobalParameterKey.Name is required.

Returns

Type
Description
Task<T>
The parameter value, or the default value of T when no matching parameter exists.
public Task<Dictionary<string, T>> LoadGlobalParametersWithNamesAsync<T>(string type, Sorting sort = null) #
Loads the names and values of global parameters that have a logical type and are not scoped to a tenant.

Parameters

Name
Type
Description
type
String
The logical parameter type.
sort
Sorting
The optional Sorting settings.

Returns

Type
Description
Task<String, T>
A mapping from parameter names to values.
public Task<Dictionary<string, T>> LoadTenantGlobalParametersWithNamesAsync<T>(TenantGlobalParameterScope scope, Sorting sort = null) #
Loads global parameter names and values from a TenantGlobalParameterScope.

Parameters

Name
Type
Description
scope
TenantGlobalParameterScope
The TenantGlobalParameterScope to load.
sort
Sorting
The optional Sorting settings.

Returns

Type
Description
Task<String, T>
A mapping from parameter names to values.
public virtual Task<List<T>> LoadGlobalParametersAsync<T>(string type, Sorting sort = null) #
Loads the values of global parameters that have a logical type and are not scoped to a tenant.

Parameters

Name
Type
Description
type
String
The logical parameter type.
sort
Sorting
The optional Sorting settings.

Returns

Type
Description
Task<List<T>>
The parameter values.
public virtual Task<List<T>> LoadTenantGlobalParametersAsync<T>(TenantGlobalParameterScope scope, Sorting sort = null) #
Loads global parameter values from a TenantGlobalParameterScope.

Parameters

Name
Type
Description
scope
TenantGlobalParameterScope
The TenantGlobalParameterScope to load.
sort
Sorting
The optional Sorting settings.

Returns

Type
Description
Task<List<T>>
The parameter values.
public virtual Task<PagedResponse<T>> LoadGlobalParametersWithPagingAsync<T>(string type, Paging paging, string name = null, Sorting sort = null) #
Loads a page of global parameter values and the total matching count.

Parameters

Name
Type
Description
type
String
The logical parameter type.
paging
Paging
The Paging settings.
name
String
The optional parameter-name filter.
sort
Sorting
The optional Sorting settings.

Returns

Type
Description
Task<PagedResponse<T>>
A PagedResponse<T> containing the selected parameter values and total matching count.
public virtual Task<PagedResponse<T>> LoadTenantGlobalParametersWithPagingAsync<T>(TenantGlobalParameterScope scope, Paging paging, Sorting sort = null) #
Loads a page of global parameter values from a TenantGlobalParameterScope and the total matching count.

Parameters

Name
Type
Description
scope
TenantGlobalParameterScope
The TenantGlobalParameterScope to load.
paging
Paging
The Paging settings.
sort
Sorting
The optional Sorting settings.

Returns

Type
Description
Task<PagedResponse<T>>
A PagedResponse<T> containing the selected parameter values and total matching count.
public virtual Task DeleteGlobalParametersAsync(string type, string name = null) #
Deletes global parameters that are not scoped to a tenant, optionally limiting the deletion by name.

Parameters

Name
Type
Description
type
String
The logical parameter type.
name
String
The parameter name to delete, or null to delete every parameter of the logical type.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task DeleteTenantGlobalParametersAsync(TenantGlobalParameterScope scope) #
Deletes all global parameters in a TenantGlobalParameterScope.

Parameters

Name
Type
Description
scope
TenantGlobalParameterScope
The TenantGlobalParameterScope to delete.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task DeleteTenantGlobalParameterAsync(TenantGlobalParameterKey key) #
Deletes one global parameter identified by a TenantGlobalParameterKey.

Parameters

Name
Type
Description
key
TenantGlobalParameterKey
The TenantGlobalParameterKey to delete.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task DeleteProcessAsync(Guid processId) #
Deletes the persisted process instance record and related records managed by the provider.

Parameters

Name
Type
Description
processId
Guid
The process identifier.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task RegisterTimerAsync(Guid processId, Guid rootProcessId, string name, DateTime nextExecutionDateTime, string tenantId, bool notOverrideIfExists) #
Creates or updates a persisted timer registration for a ProcessInstance.

Parameters

Name
Type
Description
processId
Guid
The identifier of the ProcessInstance that owns the timer.
rootProcessId
Guid
The identifier of the root process in the owning process tree.
name
String
The timer name.
nextExecutionDateTime
DateTime
The date and time when the timer becomes due.
tenantId
String
The tenant identifier, if any.
notOverrideIfExists
Boolean
true to retain an existing registration with the same process identifier and timer name; otherwise, false to update its execution time. This value corresponds to TimerDefinition.NotOverrideIfExists.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task ClearTimersAsync(Guid processId, List<string> timersIgnoreList) #
Deletes all persisted timer registrations for a ProcessInstance except timers whose names are retained.

Parameters

Name
Type
Description
processId
Guid
The process identifier.
timersIgnoreList
List<String>
The timer names to retain.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task<int> SetTimerIgnoreAsync(Guid timerId) #
Marks a persisted timer registration as ignored so it is not selected for execution.

Parameters

Name
Type
Description
timerId
Guid

Returns

Type
Description
Task<Int32>
The number of timer records changed.
public virtual Task<List<WorkflowTimer>> GetTopTimersToExecuteAsync(int top) #
Gets a limited set of due timer registrations that have not been marked as ignored.

Parameters

Name
Type
Description
top
Int32
The maximum number of timer registrations to return.

Returns

Type
Description
Task<WorkflowTimer>
The due WorkflowTimer objects in execution-time order.

Exceptions

Type
Description
ArgumentException
top is not greater than zero.
public virtual Task<List<ProcessHistoryItem>> GetProcessHistoryAsync(Guid processId, Paging paging = null) #
Gets persisted transition history for a ProcessInstance.

Parameters

Name
Type
Description
processId
Guid
The process identifier.
paging
Paging
The optional Paging settings.

Returns

Type
Description
Task<ProcessHistoryItem>
The persisted ProcessHistoryItem records.
public Task<int> GetProcessHistoryCountAsync(Guid processId) #
Gets the number of persisted transition history records for a ProcessInstance.

Parameters

Name
Type
Description
processId
Guid
The process identifier.

Returns

Type
Description
Task<Int32>
The number of persisted transition history records.
public virtual Task<List<ProcessTimer>> GetTimersForProcessAsync(Guid processId) #
Gets all persisted timer registrations for a ProcessInstance.

Parameters

Name
Type
Description
processId
Guid
The process identifier.

Returns

Type
Description
Task<ProcessTimer>
The ProcessTimer objects registered for the ProcessInstance.
public virtual Task<List<IProcessInstanceTreeItem>> GetProcessInstanceTreeAsync(Guid rootProcessId) #
Gets the persisted process instance tree for a root process.

Parameters

Name
Type
Description
rootProcessId
Guid
The root process identifier.

Returns

Type
Description
Task<IProcessInstanceTreeItem>
The IProcessInstanceTreeItem records in the process instance tree.
public virtual Task<List<ProcessTimer>> GetActiveTimersForProcessAsync(Guid processId) #
Gets the timer registrations for a ProcessInstance that have not been marked as ignored.

Parameters

Name
Type
Description
processId
Guid
The process identifier.

Returns

Type
Description
Task<ProcessTimer>
The active ProcessTimer objects registered for the ProcessInstance.
public virtual Task<WorkflowRuntimeModel> GetWorkflowRuntimeModelAsync(string runtimeId) #
Gets the persisted operational model for a WorkflowRuntime.

Parameters

Name
Type
Description
runtimeId
String
The runtime identifier.

Returns

Type
Description
Task<WorkflowRuntimeModel>
The persisted WorkflowRuntimeModel, or null when no matching runtime record exists.
public virtual Task<DateTime?> GetNextTimerDateAsync(TimerCategory timerCategory, int timerInterval) #
Attempts to reserve the next timer polling time for a TimerCategory in multi-server mode.

Parameters

Name
Type
Description
timerCategory
TimerCategory
The TimerCategory.Timer or TimerCategory.ServiceTimer category whose polling time is reserved.
timerInterval
Int32
The interval, in milliseconds, between polling times.

Returns

Type
Description
Task<DateTime>
The reserved polling date and time, or null when another WorkflowRuntime changed the coordination lock first.
public virtual Task<int> SendRuntimeLastAliveSignalAsync() #
Updates WorkflowRuntimeModel.LastAliveSignal for the current WorkflowRuntime when its status is RuntimeStatus.Alive or RuntimeStatus.SelfRestore.

Returns

Type
Description
Task<Int32>
The number of runtime records changed.
public virtual Task<List<WorkflowRuntimeModel>> GetWorkflowRuntimesAsync() #
Gets all persisted WorkflowRuntimeModel records.

Returns

Type
Description
Task<WorkflowRuntimeModel>
The persisted WorkflowRuntimeModel objects.
public void ConfigureMigrations(IMigrationRunnerBuilder builder, Assembly assembly) #
Configures FluentMigrator to run the migration from the provided assembly.

Parameters

Name
Type
Description
builder
IMigrationRunnerBuilder
The instance of the interface for configuring migration runner services.
assembly
Assembly
The assembly with migrations.
public virtual Task<SchemeDefinition<XElement>> GetProcessSchemeByProcessIdAsync(Guid processId) #
Gets the stored built scheme version assigned to a process instance.

Parameters

Name
Type
Description
processId
Guid
The identifier of the process instance whose assigned scheme is retrieved.

Returns

Type
Description
Task<XElement>
The SchemeDefinition<T> assigned to the process instance.

Exceptions

Type
Description
ProcessNotFoundException
Thrown when no process instance exists with processId.
SchemeNotFoundException
Thrown when the process instance has no assigned scheme or its stored built scheme version cannot be found.
public virtual Task<SchemeDefinition<XElement>> GetProcessSchemeBySchemeIdAsync(Guid schemeId) #
Gets a stored built scheme version by its scheme ID.

Parameters

Name
Type
Description
schemeId
Guid
The scheme ID of the stored built scheme version.

Returns

Type
Description
Task<XElement>
The requested SchemeDefinition<T>.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no stored built scheme version exists with schemeId.
public virtual Task<SchemeDefinition<XElement>> GetProcessSchemeWithParametersAsync(string schemeCode, Guid? rootSchemeId, bool ignoreObsolete, string tenantId = null) #
Gets a stored built scheme version that matches a scheme code, root scheme ID, obsolete-version filter, and tenant scope.

Parameters

Name
Type
Description
schemeCode
String
The code of the stored built scheme version to retrieve.
rootSchemeId
Nullable<Guid>
The root scheme ID for a subprocess scheme, or null to select versions without a root scheme.
ignoreObsolete
Boolean
true to exclude obsolete versions; false to include obsolete and non-obsolete versions.
tenantId
String
The tenant identifier that defines the exact search scope, or null to search shared schemes.

Returns

Type
Description
Task<XElement>
The matching SchemeDefinition<T>.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no stored built scheme version matches the supplied criteria.
public virtual Task SetSchemeIsObsoleteAsync(string schemeCode, string tenantId = null) #
Marks stored built scheme versions associated with a scheme code as obsolete.

Parameters

Name
Type
Description
schemeCode
String
The scheme code whose stored built versions are marked obsolete.
tenantId
String
The tenant identifier to target, or null to target matching versions in every tenant scope.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task<SchemeDefinition<XElement>> SaveSchemeAsync(SchemeDefinition<XElement> scheme) #
Stores a built scheme version if no matching version is already persisted.

Parameters

Name
Type
Description
scheme
SchemeDefinition<XElement>
The SchemeDefinition<T> containing the built scheme and stored-version metadata to persist.

Returns

Type
Description
Task<XElement>
The stored SchemeDefinition<T>, either newly inserted or an existing matching version.
public virtual Task UpsertSchemeAsync(SchemeDefinition<XElement> scheme) #
Inserts or updates a stored built scheme version.

Parameters

Name
Type
Description
scheme
SchemeDefinition<XElement>
The SchemeDefinition<T> containing the built scheme and stored-version metadata to insert or update.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task SaveSchemeAsync(string schemaCode, bool canBeInlined, List<string> inlinedSchemes, string scheme, List<string> tags, string tenantId = null) #
Saves an unparsed source scheme together with its Scheme Inlining relationships and tags.

Parameters

Name
Type
Description
schemaCode
String
canBeInlined
Boolean
true if the scheme can be inlined into another scheme; otherwise, false.
inlinedSchemes
List<String>
The codes of the inlinable schemes referenced by this scheme.
scheme
String
The serialized unparsed source scheme.
tags
List<String>
The scheme tags to store.
tenantId
String
The tenant identifier that defines the exact storage scope, or null for a shared scheme.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public virtual Task<XElement> GetSchemeAsync(string code, string tenantId = null) #
Gets the unparsed source scheme identified by a scheme code.

Parameters

Name
Type
Description
code
String
The code of the source scheme to retrieve.
tenantId
String
The tenant identifier used to prefer a tenant-specific scheme over a shared scheme, or null to search only shared schemes.

Returns

Type
Description
Task<XElement>
The unparsed source scheme represented by XElement.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no source scheme with code is available in the requested scope.
public virtual Task<List<string>> GetInlinedSchemeCodesAsync(string tenantId = null) #
Gets the distinct codes of schemes available for use as inlinable schemes.

Parameters

Name
Type
Description
tenantId
String
The tenant identifier. When specified, the result includes shared schemes and schemes in that tenant scope; when null, the result includes only shared schemes.

Returns

Type
Description
Task<String>
The distinct inlinable scheme codes.
public virtual Task<List<string>> GetRelatedByInliningSchemeCodesAsync(string schemeCode, string tenantId = null) #
Gets the distinct codes of schemes that inline the specified scheme.

Parameters

Name
Type
Description
schemeCode
String
The code of the inlinable scheme.
tenantId
String
The tenant identifier of the parent schemes to search. When specified, only that tenant scope is searched; when null, shared schemes and all tenant scopes are searched.

Returns

Type
Description
Task<String>
The distinct codes of schemes that inline the specified scheme.
public virtual Task<List<string>> SearchSchemesByTagsAsync(params string[] tags) #
Gets the codes of shared schemes that match at least one specified tag.

Parameters

Name
Type
Description
tags
String[]
The tags to match. If the array is null or empty, all shared scheme codes are returned.

Returns

Type
Description
Task<String>
The matching shared scheme codes.
public virtual Task<List<string>> SearchSchemesByTagsAsync(IEnumerable<string> tags) #
Gets the codes of shared schemes that match at least one specified tag.

Parameters

Name
Type
Description
tags
IEnumerable<String>
The tags to match, or null to return all shared scheme codes. An empty collection also returns all shared scheme codes.

Returns

Type
Description
Task<String>
The matching shared scheme codes.
public virtual Task<List<string>> SearchSchemesByTagsAsync(string tenantId, IEnumerable<string> tags) #
Gets the codes of schemes in an exact tenant scope that match at least one specified tag.

Parameters

Name
Type
Description
tenantId
String
The tenant identifier that defines the exact search scope, or null to search shared schemes.
tags
IEnumerable<String>
The tags to match, or null to return every scheme code in the selected scope. An empty collection also returns every scheme code in that scope.

Returns

Type
Description
Task<String>
The matching scheme codes in the selected scope.
public virtual Task<List<string>> SearchSchemesByTagsInTenantAsync(string tenantId, params string[] tags) #
Gets the codes of schemes in a specified tenant that match at least one specified tag.

Parameters

Name
Type
Description
tenantId
String
The tenant identifier that defines the exact search scope.
tags
String[]
The tags to match. If the array is null or empty, every scheme code in the tenant scope is returned.

Returns

Type
Description
Task<String>
The matching scheme codes in the specified tenant.
public virtual Task AddSchemeTagsAsync(string schemeCode, params string[] tags) #
Adds tags to a source scheme in the shared scope.

Parameters

Name
Type
Description
schemeCode
String
The code of the shared source scheme.
tags
String[]
The scheme tags to add.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when the shared source scheme identified by schemeCode does not exist.
public virtual Task AddSchemeTagsAsync(string schemeCode, IEnumerable<string> tags) #
Adds tags to a source scheme in the shared scope.

Parameters

Name
Type
Description
schemeCode
String
The code of the shared source scheme.
tags
IEnumerable<String>
The scheme tags to add.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when the shared source scheme identified by schemeCode does not exist.
public virtual Task AddSchemeTagsAsync(string schemeCode, string tenantId, IEnumerable<string> tags) #
Adds tags to a source scheme in an exact tenant scope.

Parameters

Name
Type
Description
schemeCode
String
The source scheme code.
tenantId
String
The tenant identifier that defines the exact scope, or null for the shared scope.
tags
IEnumerable<String>
The scheme tags to add.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no source scheme with schemeCode exists in the scope selected by tenantId.
public virtual Task AddSchemeTagsInTenantAsync(string schemeCode, string tenantId, params string[] tags) #
Adds tags to a source scheme in a specified tenant.

Parameters

Name
Type
Description
schemeCode
String
The source scheme code.
tenantId
String
The tenant identifier that defines the exact scope.
tags
String[]
The scheme tags to add.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no source scheme with schemeCode exists in the scope selected by tenantId.
public virtual Task RemoveSchemeTagsAsync(string schemeCode, params string[] tags) #
Removes tags from a source scheme in the shared scope.

Parameters

Name
Type
Description
schemeCode
String
The code of the shared source scheme.
tags
String[]
The scheme tags to remove.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when the shared source scheme identified by schemeCode does not exist.
public virtual Task RemoveSchemeTagsAsync(string schemeCode, IEnumerable<string> tags) #
Removes tags from a source scheme in the shared scope.

Parameters

Name
Type
Description
schemeCode
String
The code of the shared source scheme.
tags
IEnumerable<String>
The scheme tags to remove.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when the shared source scheme identified by schemeCode does not exist.
public virtual Task RemoveSchemeTagsAsync(string schemeCode, string tenantId, IEnumerable<string> tags) #
Removes tags from a source scheme in an exact tenant scope.

Parameters

Name
Type
Description
schemeCode
String
The source scheme code.
tenantId
String
The tenant identifier that defines the exact scope, or null for the shared scope.
tags
IEnumerable<String>
The scheme tags to remove.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no source scheme with schemeCode exists in the scope selected by tenantId.
public virtual Task RemoveSchemeTagsInTenantAsync(string schemeCode, string tenantId, params string[] tags) #
Removes tags from a source scheme in a specified tenant.

Parameters

Name
Type
Description
schemeCode
String
The source scheme code.
tenantId
String
The tenant identifier that defines the exact scope.
tags
String[]
The scheme tags to remove.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no source scheme with schemeCode exists in the scope selected by tenantId.
public virtual Task SetSchemeTagsAsync(string schemeCode, params string[] tags) #
Replaces all tags on a source scheme in the shared scope.

Parameters

Name
Type
Description
schemeCode
String
The code of the shared source scheme.
tags
String[]
The replacement scheme tags; an empty array removes all tags.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when the shared source scheme identified by schemeCode does not exist.
public virtual Task SetSchemeTagsAsync(string schemeCode, IEnumerable<string> tags) #
Replaces all tags on a source scheme in the shared scope.

Parameters

Name
Type
Description
schemeCode
String
The code of the shared source scheme.
tags
IEnumerable<String>
The replacement scheme tags; an empty collection removes all tags.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when the shared source scheme identified by schemeCode does not exist.
public virtual Task SetSchemeTagsAsync(string schemeCode, string tenantId, IEnumerable<string> tags) #
Replaces all tags on a source scheme in an exact tenant scope.

Parameters

Name
Type
Description
schemeCode
String
The source scheme code.
tenantId
String
The tenant identifier that defines the exact scope, or null for the shared scope.
tags
IEnumerable<String>
The replacement scheme tags; an empty collection removes all tags.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no source scheme with schemeCode exists in the scope selected by tenantId.
public virtual Task SetSchemeTagsInTenantAsync(string schemeCode, string tenantId, params string[] tags) #
Replaces all tags on a source scheme in a specified tenant.

Parameters

Name
Type
Description
schemeCode
String
The source scheme code.
tenantId
String
The tenant identifier that defines the exact scope.
tags
String[]
The replacement scheme tags; an empty array removes all tags.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
SchemeNotFoundException
Thrown when no source scheme with schemeCode exists in the scope selected by tenantId.
public virtual Task<XElement> GenerateAsync(string schemeCode, string tenantId = null) #
Asynchronously generates the source process scheme identified by schemeCode in the tenant scope specified by tenantId.

Parameters

Name
Type
Description
schemeCode
String
The code of the process scheme to generate.
tenantId
String
The tenant identifier that scopes generation, or null for generation without a tenant scope.

Returns

Type
Description
Task<XElement>
A Task<TResult> whose result is the generated source process scheme.
public virtual Task BulkInitProcessesAsync(List<ProcessInstance> instances, ProcessStatus status, CancellationToken token) #
When bulk operations are supported, persists multiple ProcessInstance objects, their persistent parameters, and their initial status.

Parameters

Name
Type
Description
instances
List<ProcessInstance>
The ProcessInstance objects to persist.
status
ProcessStatus
The ProcessStatus to assign to each ProcessInstance.
token
CancellationToken
The CancellationToken that can cancel the operation.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Remarks

Check IPersistenceProvider.IsBulkOperationsSupported before calling this method.
public virtual Task BulkInitProcessesAsync(List<ProcessInstance> instances, List<TimerToRegister> timers, ProcessStatus status, CancellationToken token) #
When bulk operations are supported, persists multiple ProcessInstance objects, their persistent parameters, timer registrations, and their initial status.

Parameters

Name
Type
Description
instances
List<ProcessInstance>
The ProcessInstance objects to persist.
timers
List<TimerToRegister>
The TimerToRegister objects to persist.
status
ProcessStatus
The ProcessStatus to assign to each ProcessInstance.
token
CancellationToken
The CancellationToken that can cancel the operation.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Remarks

Check IPersistenceProvider.IsBulkOperationsSupported before calling this method.
public virtual Task DropWorkflowInboxAsync(Guid processId) #
Removes all approval inbox entries associated with the specified process instance.

Parameters

Name
Type
Description
processId
Guid
The identifier of the process instance whose inbox entries are removed.

Returns

Type
Description
Task
A task that represents the asynchronous operation.
public virtual Task InsertInboxAsync(List<InboxItem> newActors) #
Adds approval inbox entries.

Parameters

Name
Type
Description
newActors
List<InboxItem>

Returns

Type
Description
Task
A task that represents the asynchronous operation.
public Task<int> GetInboxCountByProcessIdAsync(Guid processId) #
Gets the number of approval inbox entries associated with the specified process instance.

Parameters

Name
Type
Description
processId
Guid
The identifier of the process instance whose inbox entries are counted.

Returns

Type
Description
Task<Int32>
A task whose result is the number of matching inbox entries.
public Task<int> GetInboxCountByIdentityIdAsync(string identityId) #
Gets the number of approval inbox entries available to the specified workflow participant identity.

Parameters

Name
Type
Description
identityId
String
The workflow participant identity whose inbox entries are counted.

Returns

Type
Description
Task<Int32>
A task whose result is the number of matching inbox entries.
public Task<List<InboxItem>> GetInboxByProcessIdAsync(Guid processId, Paging paging = null, CultureInfo culture = null) #
Gets approval inbox entries associated with the specified process instance.

Parameters

Name
Type
Description
processId
Guid
The identifier of the process instance whose inbox entries are retrieved.
paging
Paging
The optional Paging settings that select a page of results.
culture
CultureInfo
The CultureInfo used to localize the command names in InboxItem.AvailableCommands, or null to use CultureInfo.CurrentCulture.

Returns

Type
Description
Task<InboxItem>
A task whose result contains the matching InboxItem objects.
public Task<List<InboxItem>> GetInboxByIdentityIdAsync(string identityId, Paging paging = null, CultureInfo culture = null) #
Gets approval inbox entries available to the specified workflow participant identity.

Parameters

Name
Type
Description
identityId
String
The workflow participant identity whose inbox entries are retrieved.
paging
Paging
The optional Paging settings that select a page of results.
culture
CultureInfo
The CultureInfo used to localize the command names in InboxItem.AvailableCommands, or null to use CultureInfo.CurrentCulture.

Returns

Type
Description
Task<InboxItem>
A task whose result contains the matching InboxItem objects.
public Task FillApprovalHistoryAsync(ApprovalHistoryItem approvalHistoryItem) #
Adds approvalHistoryItem to approval history or updates a matching pending entry.

Parameters

Name
Type
Description
approvalHistoryItem
ApprovalHistoryItem
The ApprovalHistoryItem containing the approval history data to add or apply.

Returns

Type
Description
Task
A task that represents the asynchronous operation.
public Task<int> GetApprovalHistoryCountByIdentityIdAsync(string identityId) #
Gets the number of approval history entries recorded for the specified executor.

Parameters

Name
Type
Description
identityId
String
The workflow participant identity of the executor whose approval history entries are counted.

Returns

Type
Description
Task<Int32>
A task whose result is the number of matching approval history entries.
public virtual Task<List<ApprovalHistoryItem>> GetApprovalHistoryByProcessIdAsync(Guid processId, Paging paging = null) #
Gets approval history entries associated with the specified process instance.

Parameters

Name
Type
Description
processId
Guid
The identifier of the process instance whose approval history is retrieved.
paging
Paging
The optional Paging settings that select a page of results.

Returns

Type
Description
Task<ApprovalHistoryItem>
A task whose result contains the matching ApprovalHistoryItem objects.
public virtual Task<List<ApprovalHistoryItem>> GetApprovalHistoryByIdentityIdAsync(string identityId, Paging paging = null) #
Gets approval history entries recorded for the specified executor.

Parameters

Name
Type
Description
identityId
String
The workflow participant identity of the executor whose approval history is retrieved.
paging
Paging
The optional Paging settings that select a page of results.

Returns

Type
Description
Task<ApprovalHistoryItem>
A task whose result contains the matching ApprovalHistoryItem objects.
public Task<int> GetOutboxCountByIdentityIdAsync(string identityId) #
Gets the number of process-specific OutboxItem summaries for the specified executor.

Parameters

Name
Type
Description
identityId
String
The workflow participant identity of the executor whose approval history is summarized.

Returns

Type
Description
Task<Int32>
A task whose result is the number of process-specific approval summaries.
public virtual Task DropEmptyApprovalHistoryAsync(Guid processId) #
Removes approval history entries that have no ApprovalHistoryItem.TransitionTime and are associated with the specified process instance.

Parameters

Name
Type
Description
processId
Guid
The identifier of the process instance whose pending entries are removed.

Returns

Type
Description
Task
A task that represents the asynchronous operation.
public Task DropApprovalHistoryByProcessIdAsync(Guid processId) #
Removes all approval history entries associated with the specified process instance.

Parameters

Name
Type
Description
processId
Guid
The identifier of the process instance whose approval history is removed.

Returns

Type
Description
Task
A task that represents the asynchronous operation.
public Task DropApprovalHistoryByIdentityIdAsync(string identityId) #
Removes approval history entries recorded for the specified executor.

Parameters

Name
Type
Description
identityId
String
The workflow participant identity of the executor whose approval history entries are removed.

Returns

Type
Description
Task
A task that represents the asynchronous operation.
public Task<int> GetApprovalHistoryCountByProcessIdAsync(Guid processId) #
Gets the number of approval history entries associated with the specified process instance.

Parameters

Name
Type
Description
processId
Guid
The identifier of the process instance whose approval history entries are counted.

Returns

Type
Description
Task<Int32>
A task whose result is the number of matching approval history entries.
public virtual Task<List<OutboxItem>> GetOutboxByIdentityIdAsync(string identityId, Paging paging = null) #
Gets process-specific OutboxItem summaries of approvals performed by the specified executor.

Parameters

Name
Type
Description
identityId
String
The workflow participant identity of the executor whose approval history is summarized.
paging
Paging
The optional Paging settings that select a page of results.

Returns

Type
Description
Task<OutboxItem>
A task whose result contains the matching OutboxItem objects.
public Task<WorkflowForm> GetFormAsync(string name, int? version = null, string tenantId = null) #
Gets a form by name and optional version.

Parameters

Name
Type
Description
name
String
The form name.
version
Nullable<Int32>
The form version, or null to retrieve the latest available version.
tenantId
String
The tenant identifier, or null to read from the shared scope. When specified, latest-version reads prefer the tenant scope and use the shared scope only when the tenant scope contains no forms with the specified name. Version-specific reads use the shared scope only when the tenant scope contains no versions of the form.

Returns

Type
Description
Task<WorkflowForm>
A Task<TResult> whose result contains the matching WorkflowForm, or null when no matching form is found.
public Task<List<string>> GetFormNamesAsync(string tenantId = null) #
Gets the distinct form names available in the selected scope.

Parameters

Name
Type
Description
tenantId
String
The tenant identifier, or null to read from the shared scope. When specified, the result combines names from the tenant and shared scopes.

Returns

Type
Description
Task<String>
A Task<TResult> whose result contains the distinct form names available in the selected scope.
public Task<List<int>> GetFormVersionsAsync(string name, string tenantId = null) #
Gets the distinct versions of a form available in the selected scope.

Parameters

Name
Type
Description
name
String
The form name.
tenantId
String
The tenant identifier, or null to read from the shared scope. When specified, the result contains tenant-scoped versions when the tenant scope contains the form; otherwise it contains shared versions.

Returns

Type
Description
Task<Int32>
A Task<TResult> whose result contains the distinct form version numbers available in the selected scope.
public Task<WorkflowForm> CreateNewFormVersionAsync(string name, string defaultDefinition, int? version = null, string tenantId = null) #
Creates a new version of a form in the selected scope.

Parameters

Name
Type
Description
name
String
The form name.
defaultDefinition
String
The form definition to use when version is null and no source form is available in the target scope or, when initializing a tenant scope, the shared scope.
version
Nullable<Int32>
The source form version whose definition is copied, or null to use the latest source form. A specified version must exist in the target scope, or in the shared scope when initializing an empty tenant scope.
tenantId
String
The tenant identifier, or null to create the version in the shared scope. When creating the first version in a tenant scope, the definition may be copied from the shared scope.

Returns

Type
Description
Task<WorkflowForm>
A Task<TResult> whose result contains the newly created WorkflowForm.
public Task<WorkflowForm> CreateNewFormIfNotExistsAsync(string name, string defaultDefinition, string tenantId = null) #
Gets the latest form in the selected scope, or creates version 0 when the scope contains no form with the specified name.

Parameters

Name
Type
Description
name
String
The form name.
defaultDefinition
String
The definition to use for a newly created form when no shared form is available as a source.
tenantId
String
The tenant identifier, or null to use the shared scope. A new tenant-scoped form uses the shared form definition when one is available.

Returns

Type
Description
Task<WorkflowForm>
A Task<TResult> whose result contains the existing or newly created WorkflowForm.
public Task<int> UpdateFormAsync(string name, int version, int lockValue, string definition, string tenantId = null) #
Updates a form version's definition using optimistic concurrency.

Parameters

Name
Type
Description
name
String
The form name.
version
Int32
The form version to update.
lockValue
Int32
The expected current lock value for optimistic concurrency.
definition
String
The new form definition.
tenantId
String
The tenant identifier, or null to update the shared scope. The update is limited to the selected scope.

Returns

Type
Description
Task<Int32>
A Task<TResult> whose result contains the new lock value.
public Task DeleteFormVersionAsync(string name, int version, string tenantId = null) #
Deletes a specific version of a form from the selected scope.

Parameters

Name
Type
Description
name
String
The form name.
version
Int32
The form version to delete.
tenantId
String
The tenant identifier, or null to delete from the shared scope. The deletion is limited to the selected scope.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.
public Task DeleteFormAsync(string name, string tenantId = null) #
Deletes all versions of a form from the selected scope.

Parameters

Name
Type
Description
name
String
The form name.
tenantId
String
The tenant identifier, or null to delete from the shared scope. The deletion is limited to the selected scope.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.