Workflow Engine .NET

Assembly: OptimaJet.Workflow.SQLite

Class WorkflowForm

OptimaJet.Workflow.SQLite.Models.WorkflowForm

Database object for workflow form storage and versioning operations.

public class WorkflowForm : DbObject<WorkflowFormEntity>

Inheritance

  • Object
  • DbObject<WorkflowFormEntity>

Constructors

public WorkflowForm(string schemaName, int commandTimeout) #
Initializes a new instance of WorkflowForm.

Parameters

Name
Type
Description
schemaName
String
The database schema name.
commandTimeout
Int32
The command timeout in seconds.

Methods

public Task<List<string>> GetFormNamesAsync(SqliteConnection connection, string tenantId = null) #
Gets the distinct list of form names accessible in the specified tenant scope.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
tenantId
String
The tenant identifier, or null for shared forms only.

Returns

Type
Description
Task<String>
A list of form names.
public Task<WorkflowFormEntity> GetFormAsync(SqliteConnection connection, string name, int? version = null, string tenantId = null) #
Gets a form entity by name and optional version within the specified tenant scope.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
name
String
The form name.
version
Nullable<Int32>
The form version, or null to get the latest version.
tenantId
String
The tenant identifier, or null for shared forms.

Returns

Type
Description
Task<WorkflowFormEntity>
The form entity if found; otherwise, null.
public Task<List<int>> GetFormVersionsAsync(SqliteConnection connection, string name, string tenantId = null) #
Gets the list of distinct form versions for the specified form name within the tenant scope.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
name
String
The form name.
tenantId
String
The tenant identifier, or null for shared forms.

Returns

Type
Description
Task<Int32>
A list of version numbers.
public Task<WorkflowFormEntity> CreateNewFormVersionAsync(SqliteConnection connection, DateTime creationDate, string name, string defaultDefinition, int? version = null, string tenantId = null) #
Creates a new version of the form. If version is specified, copies the definition from that version; otherwise copies from the latest version. Falls back to the shared form if the tenant-scoped form is not found.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
creationDate
DateTime
The creation date for the new version.
name
String
The form name.
defaultDefinition
String
The default definition to use if no source version is found.
version
Nullable<Int32>
The source version to copy from, or null to copy from the latest.
tenantId
String
The tenant identifier, or null for shared forms.

Returns

Type
Description
Task<WorkflowFormEntity>
The newly created form entity, or null if the specified source version was not found.
public Task<WorkflowFormEntity> CreateNewFormIfNotExistsAsync(SqliteConnection connection, DateTime creationDate, string name, string defaultDefinition, string tenantId = null) #
Creates a new form with version 0 if a form with the specified name does not already exist in the given tenant scope. Falls back to the shared form definition if the tenant-scoped form is not found.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
creationDate
DateTime
The creation date for the new form.
name
String
The form name.
defaultDefinition
String
The default definition to use if no shared form exists.
tenantId
String
The tenant identifier, or null for shared forms.

Returns

Type
Description
Task<WorkflowFormEntity>
The existing or newly created form entity.
public Task<int> UpdateFormAsync(SqliteConnection connection, string name, int version, long oldLock, long newLock, string definition, DateTime updatedDate, string tenantId = null) #
Updates the form definition with optimistic locking.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
name
String
The form name.
version
Int32
The form version to update.
oldLock
Int64
The current lock value for optimistic concurrency.
newLock
Int64
The new lock value to set.
definition
String
The new form definition.
updatedDate
DateTime
The update timestamp.
tenantId
String
The tenant identifier, or null for shared forms.

Returns

Type
Description
Task<Int32>
The new lock value if the update succeeded.
public Task DeleteFormVersionAsync(SqliteConnection connection, string name, int version, string tenantId = null) #
Deletes a specific version of the form within the specified tenant scope.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
name
String
The form name.
version
Int32
The version to delete.
tenantId
String
The tenant identifier, or null for shared forms.

Returns

Type
Description
Task
A task that represents the asynchronous operation.
public Task DeleteFormAsync(SqliteConnection connection, string name, string tenantId = null) #
Deletes all versions of the form within the specified tenant scope.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
name
String
The form name.
tenantId
String
The tenant identifier, or null for shared forms.

Returns

Type
Description
Task
A task that represents the asynchronous operation.