Class WorkflowScheme
OptimaJet.Workflow.SQLite.WorkflowScheme
Database object for workflow scheme storage, querying, and tag management operations.
Namespace: OptimaJet.Workflow.SQLite
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
schemaNameStringThe database schema name.
commandTimeoutInt32The 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
connectionSqliteConnectionThe SQLite connection.
codeStringThe scheme code.
tenantIdStringThe 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
connectionSqliteConnectionThe SQLite connection.
codeStringThe scheme code.
tenantIdStringThe 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
connectionSqliteConnectionThe SQLite connection.
entitySchemeEntityThe scheme entity to upsert.
transactionSqliteTransactionAn 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
connectionSqliteConnectionThe SQLite connection.
orderParametersList<String, SortDirection>The sorting parameters.
pagingPagingThe 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
connectionSqliteConnectionThe SQLite connection.
tenantIdStringThe tenant identifier, or
null for shared schemes.Returns
Type
Description
Task<String>A list of inlinable 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
connectionSqliteConnectionThe SQLite connection.
tenantIdStringThe tenant identifier, or
null for shared schemes.tagsIEnumerable<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
connectionSqliteConnectionThe SQLite connection.
schemeCodeStringThe scheme code.
tenantIdStringThe tenant identifier, or
null for shared schemes.tagsIEnumerable<String>The tags to add.
builderIWorkflowBuilderThe workflow builder for updating tag references in the scheme definition.
Returns
Type
Description
TaskA 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
connectionSqliteConnectionThe SQLite connection.
schemeCodeStringThe scheme code.
tenantIdStringThe tenant identifier, or
null for shared schemes.tagsIEnumerable<String>The tags to remove.
builderIWorkflowBuilderThe workflow builder for updating tag references in the scheme definition.
Returns
Type
Description
TaskA 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
connectionSqliteConnectionThe SQLite connection.
schemeCodeStringThe scheme code.
tenantIdStringThe tenant identifier, or
null for shared schemes.tagsIEnumerable<String>The new tags to set.
builderIWorkflowBuilderThe workflow builder for updating tag references in the scheme definition.
Returns
Type
Description
TaskA task that represents the asynchronous operation.