Assembly: OptimaJet.Workflow.Core

Interface IFormDataProvider

OptimaJet.Workflow.Core.Persistence.IFormDataProvider

Defines persistence operations for retrieving, creating, versioning, updating, and deleting WorkflowForm instances.

public interface IFormDataProvider

Type Hierarchy

Methods

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.
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.
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.
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.
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.
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.
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.
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.