Workflow Engine .NET

Assembly: OptimaJet.Workflow.SQLite

Class WorkflowScheme

OptimaJet.Workflow.SQLite.WorkflowScheme

Database object for workflow scheme storage, querying, and tag management operations.

public class WorkflowScheme : DbObject<SchemeEntity>

Inheritance

  • Object
  • DbObject<SchemeEntity>

Constructors

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

Parameters

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

Methods

public Task<SchemeEntity> SelectByCodeAsync(SqliteConnection connection, string code, string tenantId) #
Selects a scheme by code, preferring the tenant-specific scheme over the shared one if both exist.

Parameters

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

Returns

Type
Description
Task<SchemeEntity>
The matching scheme entity, or null if not found.
public Task<SchemeEntity> SelectByCodeExactAsync(SqliteConnection connection, string code, string tenantId) #
Selects a scheme by code in the exact tenant scope without fallback to shared schemes.

Parameters

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

Returns

Type
Description
Task<SchemeEntity>
The matching scheme entity, or null if not found.
public override Task<int> UpsertAsync(SqliteConnection connection, SchemeEntity entity, SqliteTransaction transaction = null) #
Inserts or updates a scheme entity using an update-then-insert strategy within a transaction.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
entity
SchemeEntity
The scheme entity to upsert.
transaction
SqliteTransaction
An optional transaction. If null, an internal transaction is created.

Returns

Type
Description
Task<Int32>
The number of rows affected.
public Task<SchemeEntity[]> SelectAllWorkflowSchemesWithPagingAsync(SqliteConnection connection, List<(string parameterName, SortDirection sortDirection)> orderParameters, Paging paging) #
Selects all workflow schemes with optional sorting and paging.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
orderParameters
List<String, SortDirection>
The sorting parameters.
paging
Paging
The paging settings, or null to return all schemes.

Returns

Type
Description
Task<SchemeEntity[]>
An array of scheme entities.
public Task<List<string>> GetInlinedSchemeCodesAsync(SqliteConnection connection, string tenantId = null) #
Returns the distinct codes of schemes that can be inlined into other schemes.

Parameters

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

Returns

Type
Description
Task<String>
A list of inlinable scheme codes.
public Task<List<string>> GetRelatedSchemeCodesAsync(SqliteConnection connection, string schemeCode, string tenantId = null) #
Returns the codes of schemes that have the specified scheme inlined into them.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
schemeCode
String
The scheme code to search for in inlined scheme references.
tenantId
String
The tenant identifier, or null for shared schemes.

Returns

Type
Description
Task<String>
A list of related scheme codes.
public Task<List<string>> GetSchemeCodesByTagsAsync(SqliteConnection connection, string tenantId, IEnumerable<string> tags) #
Returns the codes of schemes matching any of the specified tags within the tenant scope.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
tenantId
String
The tenant identifier, or null for shared schemes.
tags
IEnumerable<String>
The tags to match.

Returns

Type
Description
Task<String>
A list of matching scheme codes.
public Task AddSchemeTagsAsync(SqliteConnection connection, string schemeCode, string tenantId, IEnumerable<string> tags, IWorkflowBuilder builder) #
Adds tags to a scheme and updates the scheme definition via the builder.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
schemeCode
String
The scheme code.
tenantId
String
The tenant identifier, or null for shared schemes.
tags
IEnumerable<String>
The tags to add.
builder
IWorkflowBuilder
The workflow builder for updating tag references in the scheme definition.

Returns

Type
Description
Task
A task that represents the asynchronous operation.
public Task RemoveSchemeTagsAsync(SqliteConnection connection, string schemeCode, string tenantId, IEnumerable<string> tags, IWorkflowBuilder builder) #
Removes tags from a scheme and updates the scheme definition via the builder.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
schemeCode
String
The scheme code.
tenantId
String
The tenant identifier, or null for shared schemes.
tags
IEnumerable<String>
The tags to remove.
builder
IWorkflowBuilder
The workflow builder for updating tag references in the scheme definition.

Returns

Type
Description
Task
A task that represents the asynchronous operation.
public Task SetSchemeTagsAsync(SqliteConnection connection, string schemeCode, string tenantId, IEnumerable<string> tags, IWorkflowBuilder builder) #
Sets the tags on a scheme, replacing all existing tags, and updates the scheme definition via the builder.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
schemeCode
String
The scheme code.
tenantId
String
The tenant identifier, or null for shared schemes.
tags
IEnumerable<String>
The new tags to set.
builder
IWorkflowBuilder
The workflow builder for updating tag references in the scheme definition.

Returns

Type
Description
Task
A task that represents the asynchronous operation.