# Class SchemeFilePersistence OptimaJet.Workflow.Core.Persistence.SchemeFilePersistence Stores and retrieves unparsed source schemes, Scheme Inlining relationships, and scheme tags in the file system. Namespace: [OptimaJet.Workflow.Core.Persistence](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/) ```csharp public class SchemeFilePersistence ``` ## Constructors `public SchemeFilePersistence(string storePath, WorkflowRuntime runtime)` Creates a file-system scheme store backed by the specified directory. ### Parameters | Name | Type | Description | | --- | --- | --- | | `storePath` | `String` | The directory that contains source scheme XML files and scheme settings. | | `runtime` | `WorkflowRuntime` | The [WorkflowRuntime](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) used to parse schemes and update their tags. | ## Methods `public void AddSchemeTags(string schemeCode, IEnumerable tags)` Adds tags to the source scheme identified by `schemeCode`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code of the source scheme to update. | | `tags` | `IEnumerable` | The scheme tags to add. | ### Exceptions | Type | Description | | --- | --- | | `SchemeNotFoundException` | Thrown when no source scheme with `schemeCode` exists. | `public List GetInlinedSchemeCodes()` Gets the codes of schemes available for use as inlinable schemes. ### Returns | Type | Description | | --- | --- | | `List` | The inlinable scheme codes. | `public List GetRelatedByInliningSchemeCodes(string schemeCode)` Gets the codes of schemes that inline the specified scheme. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code of the inlinable scheme. | ### Returns | Type | Description | | --- | --- | | `List` | The codes of schemes that inline the scheme identified by `schemeCode`. | `public XElement GetScheme(string code)` Gets the unparsed source scheme identified by a scheme code. ### Parameters | Name | Type | Description | | --- | --- | --- | | `code` | `String` | The code of the source scheme to retrieve. | ### Returns | Type | Description | | --- | --- | | `XElement` | The [XElement](https://learn.microsoft.com/dotnet/api/system.xml.linq.xelement) that contains the unparsed source scheme. | ### Exceptions | Type | Description | | --- | --- | | `SchemeNotFoundException` | Thrown when no source scheme with `code` exists. | `public void RemoveSchemeTags(string schemeCode, IEnumerable tags)` Removes tags from the source scheme identified by `schemeCode`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code of the source scheme to update. | | `tags` | `IEnumerable` | The scheme tags to remove. | ### Exceptions | Type | Description | | --- | --- | | `SchemeNotFoundException` | Thrown when no source scheme with `schemeCode` exists. | `public void SaveScheme(string schemeCode, bool canBeInlined, List inlinedSchemes, string scheme, List tags)` Saves an unparsed source scheme together with its Scheme Inlining relationships and tags. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code under which the source scheme is stored. | | `canBeInlined` | `Boolean` | [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if the scheme can be inlined into another scheme; otherwise, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | | `inlinedSchemes` | `List` | The codes of the inlinable schemes referenced by this scheme. | | `scheme` | `String` | The serialized unparsed source scheme. | | `tags` | `List` | The scheme tags to store. | `public List SearchSchemesByTags(IEnumerable tags)` Gets the codes of schemes that match at least one specified tag. ### Parameters | Name | Type | Description | | --- | --- | --- | | `tags` | `IEnumerable` | The scheme tags to match. | ### Returns | Type | Description | | --- | --- | | `List` | The codes of schemes that match at least one tag in `tags`. | ### Exceptions | Type | Description | | --- | --- | | `ArgumentException` | Thrown when `tags` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) or empty. | `public void SetSchemeTags(string schemeCode, IEnumerable tags)` Replaces all tags on the source scheme identified by `schemeCode`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code of the source scheme to update. | | `tags` | `IEnumerable` | The replacement scheme tags; an empty collection removes all tags. | ### Exceptions | Type | Description | | --- | --- | | `SchemeNotFoundException` | Thrown when no source scheme with `schemeCode` exists. | `public List GetSchemeCodes()` Gets the codes of all source schemes in the store directory. ### Returns | Type | Description | | --- | --- | | `List` | The scheme codes derived from the source scheme XML file names. | `public void DeleteScheme(string schemeCode)` Deletes a source scheme and its associated settings from the store. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code of the source scheme to delete. | ### Exceptions | Type | Description | | --- | --- | | `SchemeNotFoundException` | Thrown when no source scheme with `schemeCode` exists. | [Previous ProcessStatus](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/ProcessStatus/) [Next SchemeItem](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/SchemeItem/)