# Class SchemeDefinition OptimaJet.Workflow.Core.Model.SchemeDefinition Carries an unparsed scheme together with its scheme code and stored-version metadata. Namespace: [OptimaJet.Workflow.Core.Model](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/) ```csharp public class SchemeDefinition where T : class ``` ## Constructors `public SchemeDefinition(Guid id, Guid? rootSchemeId, string schemeCode, string rootSchemeCode, T scheme, bool isObsolete, List allowedActivities, string startingTransition, string tenantId = null)` Initializes a new instance of the [SchemeDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/SchemeDefinition-T/) class with an unparsed scheme and stored-version data. ### Parameters | Name | Type | Description | | --- | --- | --- | | `id` | `Guid` | The identifier of the stored scheme version. | | `rootSchemeId` | `Nullable` | The identifier of the root process scheme version for a subprocess scheme, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when no root scheme version is assigned. | | `schemeCode` | `String` | The code that identifies the family of stored scheme versions. | | `rootSchemeCode` | `String` | The code of the root process scheme for a subprocess scheme, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when no separate root scheme is assigned. | | `scheme` | `{T}` | The unparsed scheme. | | `isObsolete` | `Boolean` | [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) when the stored scheme version is obsolete; otherwise, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | | `allowedActivities` | `List` | The names of parent-process activities during which the subprocess may remain active. | | `startingTransition` | `String` | The name of the transition that started the subprocess represented by this scheme. | | `tenantId` | `String` | The tenant identifier that scopes the stored scheme version, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) for a shared scheme. | `public SchemeDefinition(ProcessDefinition processDefinition, IWorkflowParser parser, string tenantId = null)` Initializes a new instance of the [SchemeDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/SchemeDefinition-T/) class by serializing the supplied [ProcessDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) and copying its scheme code and stored-version metadata. The tenant is supplied separately through `tenantId`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processDefinition` | `ProcessDefinition` | The parsed and built scheme to serialize and copy stored-version metadata from. | | `parser` | `IWorkflowParser` | The [IWorkflowParser](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Parser/IWorkflowParser-TSchemeMedium/) used to serialize `processDefinition` through [IWorkflowParser.SerializeToSchemeMedium(ProcessDefinition)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Parser/IWorkflowParser-TSchemeMedium/). | | `tenantId` | `String` | The tenant identifier that scopes the stored scheme version, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) for a shared scheme. | ## Properties `public T Scheme { get; }` Gets the unparsed scheme. `public string SchemeCode { get; set; }` Gets or sets the scheme code that identifies the family of stored scheme versions. `public string RootSchemeCode { get; set; }` Gets or sets the scheme code of the root process for a subprocess scheme, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the scheme does not identify a separate root scheme. `public Guid Id { get; }` Gets the identifier of this stored scheme version. `public Guid? RootSchemeId { get; }` Gets the identifier of the root process scheme version for a subprocess scheme, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when no root scheme version is assigned. `public string TenantId { get; }` Gets the tenant identifier that scopes this stored scheme version, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) for a shared scheme. `public List AllowedActivities { get; set; }` Gets or sets the names of parent-process activities during which this subprocess may remain active. `public string StartingTransition { get; set; }` Gets or sets the name of the transition that started the subprocess represented by this scheme. `public bool IsObsolete { get; }` Gets a value indicating whether this stored scheme version is obsolete. [Previous RuntimeStatus](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RuntimeStatus/) [Next SerializedParameter](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/SerializedParameter/)