Interface IFormDataProvider
OptimaJet.Workflow.Core.Persistence.IFormDataProvider
Interface of a form data provider, which provide storing forms
Namespace: OptimaJet.Workflow.Core.Persistence
public interface IFormDataProviderMethods
Task<WorkflowForm> GetFormAsync(string name, int? version = null, string? tenantId = null) #Gets the form by name and version.
Parameters
Name
Type
Description
nameStringThe name of the form.
versionNullable<Int32>The version of the form. If null, the latest version is retrieved from the tenant scope when it exists; otherwise the latest shared version is returned.
tenantIdStringThe tenant identifier. When specified, latest-form reads prefer the tenant scope and fall back to shared only when the tenant scope is empty. Version-specific reads fall back to shared only when the tenant scope for the form is empty.
Returns
Type
Description
Task<WorkflowForm>A task that represents the asynchronous operation. The task result contains the form.
Task<List<string>> GetFormNamesAsync(string? tenantId = null) #Gets the list of form names.
Parameters
Name
Type
Description
tenantIdStringThe tenant identifier. When specified, the provider returns distinct names from the tenant and shared scopes.
Returns
Type
Description
Task<String>A task that represents the asynchronous operation. The task result contains the list of form names.
Task<List<int>> GetFormVersionsAsync(string name, string? tenantId = null) #Gets the list of form versions by form name.
Parameters
Name
Type
Description
nameStringThe name of the form.
tenantIdStringThe tenant identifier. When specified, the provider returns tenant-scoped versions when tenant rows exist; otherwise it falls back to shared versions.
Returns
Type
Description
Task<Int32>A task that represents the asynchronous operation. The task result contains the list of form versions.
Task<WorkflowForm> CreateNewFormVersionAsync(string name, string defaultDefinition, int? version = null, string? tenantId = null) #Creates a new version of the form.
Parameters
Name
Type
Description
nameStringThe name of the form.
defaultDefinitionStringDefault form definition used when the target scope and shared bootstrap scope do not contain a source form.
versionNullable<Int32>The source version to copy the definition from. If null, the latest version is used from the target scope, or from the shared scope when bootstrapping an empty tenant.
tenantIdStringThe tenant identifier. New versions are always created in the specified tenant scope or in the shared scope when null. When creating the first tenant version, the provider may copy the definition from the shared scope.
Returns
Type
Description
Task<WorkflowForm>A task that represents the asynchronous operation. The task result contains the new form version.
Task<WorkflowForm> CreateNewFormIfNotExistsAsync(string name, string defaultDefinition, string? tenantId = null) #Creates a new form with the specified name if it does not already exist.
Parameters
Name
Type
Description
nameStringThe name of the form to be created or checked for existence.
defaultDefinitionStringDefault form definition.
tenantIdStringThe tenant identifier. New forms are created in the specified tenant scope or in the shared scope when null.
Returns
Type
Description
Task<WorkflowForm>The result contains the created form or the existing form if one with the specified name already exists.
Task<int> UpdateFormAsync(string name, int version, int lockValue, string definition, string? tenantId = null) #Updates the form.
Parameters
Name
Type
Description
nameStringThe name of the form.
versionInt32The version of the form.
lockValueInt32The lock value to ensure concurrency.
definitionStringThe definition of the form.
tenantIdStringThe tenant identifier. Updates are applied only within the specified tenant scope or the shared scope when null.
Returns
Type
Description
Task<Int32>A task that represents the asynchronous operation. The task result contains the new lock value.
Task DeleteFormVersionAsync(string name, int version, string? tenantId = null) #Deletes a specific version of the form.
Parameters
Name
Type
Description
nameStringThe name of the form.
versionInt32The version of the form to delete.
tenantIdStringThe tenant identifier. Deletes are applied only within the specified tenant scope or the shared scope when null.
Returns
Type
Description
TaskA task that represents the asynchronous operation.
Task DeleteFormAsync(string name, string? tenantId = null) #Deletes all versions of the form.
Parameters
Name
Type
Description
nameStringThe name of the form.
tenantIdStringThe tenant identifier. Deletes are applied only within the specified tenant scope or the shared scope when null.
Returns
Type
Description
TaskA task that represents the asynchronous operation.