# Interface IApprovalProvider OptimaJet.Workflow.Core.Persistence.IApprovalProvider Defines persistence operations for the approval inbox, approval history, and approval outbox used by [ApprovalPlugin](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins/ApprovalPlugin/). Namespace: [OptimaJet.Workflow.Core.Persistence](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/) ```csharp public interface IApprovalProvider ``` ## Type Hierarchy - IApprovalProvider Current type - Derived interfaces - [IPersistenceProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/IPersistenceProvider/) - [IWorkflowProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/IWorkflowProvider/) - Implementing types - [MongoDBProvider](https://api.workflowengine.io/mongodb/OptimaJet.Workflow.MongoDB/MongoDBProvider/) - [MSSQLProvider](https://api.workflowengine.io/sql-server/OptimaJet.Workflow.DbPersistence/MSSQLProvider/) - [FileSchemePersistenceMSSQLProvider](https://api.workflowengine.io/sql-server/OptimaJet.Workflow.DbPersistence/FileSchemePersistenceMSSQLProvider/) - [MySQLProvider](https://api.workflowengine.io/mysql/OptimaJet.Workflow.MySQL/MySQLProvider/) - [OracleProvider](https://api.workflowengine.io/oracle/OptimaJet.Workflow.Oracle/OracleProvider/) - [FileSchemePersistenceOracleProvider](https://api.workflowengine.io/oracle/OptimaJet.Workflow.Oracle/FileSchemePersistenceOracleProvider/) - [PostgreSQLProvider](https://api.workflowengine.io/postgresql/OptimaJet.Workflow.PostgreSQL/PostgreSQLProvider/) - [FileSchemePersistencePostgreSQLProvider](https://api.workflowengine.io/postgresql/OptimaJet.Workflow.PostgreSQL/FileSchemePersistencePostgreSQLProvider/) - [SqliteProvider](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite/SqliteProvider/) - [FileSchemePersistenceSqliteProvider](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite/FileSchemePersistenceSqliteProvider/) ## Methods `Task DropWorkflowInboxAsync(Guid processId)` Removes all approval inbox entries associated with the specified process instance. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processId` | `Guid` | The identifier of the process instance whose inbox entries are removed. | ### Returns | Type | Description | | --- | --- | | `Task` | A task that represents the asynchronous operation. | `Task InsertInboxAsync(List inboxItems)` Adds approval inbox entries. ### Parameters | Name | Type | Description | | --- | --- | --- | | `inboxItems` | `List` | The [InboxItem](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/InboxItem/) objects to add. | ### Returns | Type | Description | | --- | --- | | `Task` | A task that represents the asynchronous operation. | `Task GetInboxCountByProcessIdAsync(Guid processId)` Gets the number of approval inbox entries associated with the specified process instance. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processId` | `Guid` | The identifier of the process instance whose inbox entries are counted. | ### Returns | Type | Description | | --- | --- | | `Task` | A task whose result is the number of matching inbox entries. | `Task GetInboxCountByIdentityIdAsync(string identityId)` Gets the number of approval inbox entries available to the specified workflow participant identity. ### Parameters | Name | Type | Description | | --- | --- | --- | | `identityId` | `String` | The workflow participant identity whose inbox entries are counted. | ### Returns | Type | Description | | --- | --- | | `Task` | A task whose result is the number of matching inbox entries. | `Task> GetInboxByProcessIdAsync(Guid processId, Paging paging = null, CultureInfo culture = null)` Gets approval inbox entries associated with the specified process instance. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processId` | `Guid` | The identifier of the process instance whose inbox entries are retrieved. | | `paging` | `Paging` | The optional [Paging](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/Paging/) settings that select a page of results. | | `culture` | `CultureInfo` | The [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo) used to localize the command names in [InboxItem.AvailableCommands](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/InboxItem/), or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) to use [CultureInfo.CurrentCulture](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.currentculture). | ### Returns | Type | Description | | --- | --- | | `Task` | A task whose result contains the matching [InboxItem](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/InboxItem/) objects. | `Task> GetInboxByIdentityIdAsync(string identityId, Paging paging = null, CultureInfo culture = null)` Gets approval inbox entries available to the specified workflow participant identity. ### Parameters | Name | Type | Description | | --- | --- | --- | | `identityId` | `String` | The workflow participant identity whose inbox entries are retrieved. | | `paging` | `Paging` | The optional [Paging](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/Paging/) settings that select a page of results. | | `culture` | `CultureInfo` | The [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo) used to localize the command names in [InboxItem.AvailableCommands](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/InboxItem/), or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) to use [CultureInfo.CurrentCulture](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.currentculture). | ### Returns | Type | Description | | --- | --- | | `Task` | A task whose result contains the matching [InboxItem](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/InboxItem/) objects. | `Task FillApprovalHistoryAsync(ApprovalHistoryItem approvalHistoryItem)` Adds `approvalHistoryItem` to approval history or updates a matching pending entry. ### Parameters | Name | Type | Description | | --- | --- | --- | | `approvalHistoryItem` | `ApprovalHistoryItem` | The [ApprovalHistoryItem](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/ApprovalHistoryItem/) containing the approval history data to add or apply. | ### Returns | Type | Description | | --- | --- | | `Task` | A task that represents the asynchronous operation. | `Task DropEmptyApprovalHistoryAsync(Guid processId)` Removes approval history entries that have no [ApprovalHistoryItem.TransitionTime](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/ApprovalHistoryItem/) and are associated with the specified process instance. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processId` | `Guid` | The identifier of the process instance whose pending entries are removed. | ### Returns | Type | Description | | --- | --- | | `Task` | A task that represents the asynchronous operation. | `Task DropApprovalHistoryByProcessIdAsync(Guid processId)` Removes all approval history entries associated with the specified process instance. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processId` | `Guid` | The identifier of the process instance whose approval history is removed. | ### Returns | Type | Description | | --- | --- | | `Task` | A task that represents the asynchronous operation. | `Task DropApprovalHistoryByIdentityIdAsync(string identityId)` Removes approval history entries recorded for the specified executor. ### Parameters | Name | Type | Description | | --- | --- | --- | | `identityId` | `String` | The workflow participant identity of the executor whose approval history entries are removed. | ### Returns | Type | Description | | --- | --- | | `Task` | A task that represents the asynchronous operation. | `Task GetApprovalHistoryCountByProcessIdAsync(Guid processId)` Gets the number of approval history entries associated with the specified process instance. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processId` | `Guid` | The identifier of the process instance whose approval history entries are counted. | ### Returns | Type | Description | | --- | --- | | `Task` | A task whose result is the number of matching approval history entries. | `Task GetApprovalHistoryCountByIdentityIdAsync(string identityId)` Gets the number of approval history entries recorded for the specified executor. ### Parameters | Name | Type | Description | | --- | --- | --- | | `identityId` | `String` | The workflow participant identity of the executor whose approval history entries are counted. | ### Returns | Type | Description | | --- | --- | | `Task` | A task whose result is the number of matching approval history entries. | `Task> GetApprovalHistoryByProcessIdAsync(Guid processId, Paging paging = null)` Gets approval history entries associated with the specified process instance. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processId` | `Guid` | The identifier of the process instance whose approval history is retrieved. | | `paging` | `Paging` | The optional [Paging](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/Paging/) settings that select a page of results. | ### Returns | Type | Description | | --- | --- | | `Task` | A task whose result contains the matching [ApprovalHistoryItem](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/ApprovalHistoryItem/) objects. | `Task> GetApprovalHistoryByIdentityIdAsync(string identityId, Paging paging = null)` Gets approval history entries recorded for the specified executor. ### Parameters | Name | Type | Description | | --- | --- | --- | | `identityId` | `String` | The workflow participant identity of the executor whose approval history is retrieved. | | `paging` | `Paging` | The optional [Paging](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/Paging/) settings that select a page of results. | ### Returns | Type | Description | | --- | --- | | `Task` | A task whose result contains the matching [ApprovalHistoryItem](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/ApprovalHistoryItem/) objects. | `Task GetOutboxCountByIdentityIdAsync(string identityId)` Gets the number of process-specific [OutboxItem](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/OutboxItem/) summaries for the specified executor. ### Parameters | Name | Type | Description | | --- | --- | --- | | `identityId` | `String` | The workflow participant identity of the executor whose approval history is summarized. | ### Returns | Type | Description | | --- | --- | | `Task` | A task whose result is the number of process-specific approval summaries. | `Task> GetOutboxByIdentityIdAsync(string identityId, Paging paging = null)` Gets process-specific [OutboxItem](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/OutboxItem/) summaries of approvals performed by the specified executor. ### Parameters | Name | Type | Description | | --- | --- | --- | | `identityId` | `String` | The workflow participant identity of the executor whose approval history is summarized. | | `paging` | `Paging` | The optional [Paging](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/Paging/) settings that select a page of results. | ### Returns | Type | Description | | --- | --- | | `Task` | A task whose result contains the matching [OutboxItem](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/OutboxItem/) objects. | [Previous CommandWithClassifier](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/CommandWithClassifier/) [Next IFormDataProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/IFormDataProvider/)