Interface IFormDataProvider
OptimaJet.Workflow.Core.Persistence.IFormDataProvider
Defines persistence operations for retrieving, creating, versioning, updating, and deleting WorkflowForm instances.
Namespace: OptimaJet.Workflow.Core.Persistence
public interface IFormDataProviderType Hierarchy
- IFormDataProvider Current type
- Derived interfaces
- Implementing types
Methods
Task<WorkflowForm> GetFormAsync(string name, int? version = null, string? tenantId = null) #Gets a form by name and optional version.
Parameters
Name
Type
Description
nameStringThe form name.
tenantIdStringThe 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.
Task<List<string>> GetFormNamesAsync(string? tenantId = null) #Gets the distinct form names available in the selected scope.
Parameters
Name
Type
Description
tenantIdStringThe 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.
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
nameStringThe form name.
tenantIdStringThe 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.
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
nameStringThe form name.
defaultDefinitionStringThe 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.versionNullable<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.
tenantIdStringThe 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.
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
nameStringThe form name.
defaultDefinitionStringThe definition to use for a newly created form when no shared form is available as a source.
tenantIdStringThe 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.
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
nameStringThe form name.
versionInt32The form version to update.
lockValueInt32The expected current lock value for optimistic concurrency.
definitionStringThe new form definition.
tenantIdStringThe 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.
Task DeleteFormVersionAsync(string name, int version, string? tenantId = null) #Deletes a specific version of a form from the selected scope.
Task DeleteFormAsync(string name, string? tenantId = null) #Deletes all versions of a form from the selected scope.