Workflow Engine .NET

Assembly: OptimaJet.Workflow.Core

Interface IFormDataProvider

OptimaJet.Workflow.Core.Persistence.IFormDataProvider

Interface of a form data provider, which provide storing forms

public interface IFormDataProvider

Methods

Task<WorkflowForm> GetFormAsync(string name, int? version = null, string? tenantId = null) #
Gets the form by name and version.

Parameters

Name
Type
Description
name
String
The name of the form.
version
Nullable<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.
tenantId
String
The 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
tenantId
String
The 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
name
String
The name of the form.
tenantId
String
The 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
name
String
The name of the form.
defaultDefinition
String
Default form definition used when the target scope and shared bootstrap scope do not contain a source form.
version
Nullable<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.
tenantId
String
The 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
name
String
The name of the form to be created or checked for existence.
defaultDefinition
String
Default form definition.
tenantId
String
The 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
name
String
The name of the form.
version
Int32
The version of the form.
lockValue
Int32
The lock value to ensure concurrency.
definition
String
The definition of the form.
tenantId
String
The 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
name
String
The name of the form.
version
Int32
The version of the form to delete.
tenantId
String
The tenant identifier. Deletes are applied only within the specified tenant scope or the shared scope when null.

Returns

Type
Description
Task
A task that represents the asynchronous operation.
Task DeleteFormAsync(string name, string? tenantId = null) #
Deletes all versions of the form.

Parameters

Name
Type
Description
name
String
The name of the form.
tenantId
String
The tenant identifier. Deletes are applied only within the specified tenant scope or the shared scope when null.

Returns

Type
Description
Task
A task that represents the asynchronous operation.