# Class WorkflowProcessScheme OptimaJet.Workflow.SQLite.WorkflowProcessScheme Database object for workflow process scheme operations. Namespace: [OptimaJet.Workflow.SQLite](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite/) ```csharp public class WorkflowProcessScheme : DbObject ``` ## Type Hierarchy - [DbObject](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite/DbObject-TEntity/) - WorkflowProcessScheme Current type ## Constructors `public WorkflowProcessScheme(string schemaName, int commandTimeout)` Initializes a new instance of [WorkflowProcessScheme](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite/WorkflowProcessScheme/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemaName` | `String` | The database schema name. | | `commandTimeout` | `Int32` | The command timeout in seconds. | ## Methods `public Task SelectAsync(SqliteConnection connection, string schemeCode, string tenantId, bool? isObsolete, Guid? rootSchemeId)` Selects process scheme entities by scheme code with optional filters for tenant, obsolete status, and root scheme. ### Parameters | Name | Type | Description | | --- | --- | --- | | `connection` | `SqliteConnection` | The SQLite connection. | | `schemeCode` | `String` | The scheme code to search for. | | `tenantId` | `String` | The tenant identifier, or `null` for shared schemes. | | `isObsolete` | `Nullable` | Filter by obsolete status, or `null` to include all. | | `rootSchemeId` | `Nullable` | The root scheme identifier, or `null` for schemes without a root. | ### Returns | Type | Description | | --- | --- | | `Task` | An array of matching process scheme entities. | `public Task SetObsoleteAsync(SqliteConnection connection, string schemeCode, string tenantId)` Marks all schemes matching the specified scheme code (and optionally tenant) as obsolete. ### Parameters | Name | Type | Description | | --- | --- | --- | | `connection` | `SqliteConnection` | The SQLite connection. | | `schemeCode` | `String` | The scheme code to mark as obsolete. | | `tenantId` | `String` | The tenant identifier, or `null` for shared schemes. | ### Returns | Type | Description | | --- | --- | | `Task` | The number of rows affected. | `public Task DeleteUnusedAsync(SqliteConnection connection)` Deletes obsolete process schemes that are not referenced by any process instance. Rolls back and throws if orphaned scheme records are detected. ### Parameters | Name | Type | Description | | --- | --- | --- | | `connection` | `SqliteConnection` | The SQLite connection. | ### Returns | Type | Description | | --- | --- | | `Task` | A task that represents the asynchronous operation. | [Previous WorkflowProcessInstanceStatus](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite/WorkflowProcessInstanceStatus/) [Next WorkflowProcessTimer](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite/WorkflowProcessTimer/)