# Class ProcessInstanceEntity OptimaJet.Workflow.Core.Entities.ProcessInstanceEntity Represents a persistence entity used to store system data for a [ProcessInstance](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). Namespace: [OptimaJet.Workflow.Core.Entities](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Entities/) ```csharp public class ProcessInstanceEntity : IEntity ``` ## Type Hierarchy - ProcessInstanceEntity Current type - Implemented interfaces - [IEntity](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Entities/IEntity/) ## Properties `public string ActivityName { get; set; }` Gets or sets the persisted value exposed by [ProcessInstance.CurrentActivityName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). `public Guid Id { get; set; }` Gets or sets the persisted value exposed by [ProcessInstance.ProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). `public string PreviousActivity { get; set; }` Gets or sets the persisted value exposed by [ProcessInstance.PreviousActivityName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). `public string PreviousActivityForDirect { get; set; }` Gets or sets the persisted value exposed by [ProcessInstance.PreviousActivityForDirectName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/), which records the source activity of the most recent transition classified as [TransitionClassifier.Direct](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionClassifier/). `public string PreviousActivityForReverse { get; set; }` Gets or sets the persisted value exposed by [ProcessInstance.PreviousActivityForReverseName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/), which records the source activity of the most recent transition classified as [TransitionClassifier.Reverse](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionClassifier/). `public string PreviousState { get; set; }` Gets or sets the persisted value exposed by [ProcessInstance.PreviousState](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). `public string PreviousStateForDirect { get; set; }` Gets or sets the persisted value exposed by [ProcessInstance.PreviousStateForDirect](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/), which records the source state of the most recent transition classified as [TransitionClassifier.Direct](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionClassifier/). `public string PreviousStateForReverse { get; set; }` Gets or sets the persisted value exposed by [ProcessInstance.PreviousStateForReverse](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/), which records the source state of the most recent transition classified as [TransitionClassifier.Reverse](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionClassifier/). `public Guid? SchemeId { get; set; }` Gets or sets the process scheme identifier exposed by [ProcessInstance.SchemeId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). `public string StateName { get; set; }` Gets or sets the persisted value exposed by [ProcessInstance.CurrentState](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). `public Guid? ParentProcessId { get; set; }` Gets or sets the identifier of the parent process instance exposed by [ProcessInstance.ParentProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). `public Guid RootProcessId { get; set; }` Gets or sets the identifier of the root process instance exposed by [ProcessInstance.RootProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). `public string TenantId { get; set; }` Gets or sets the tenant identifier exposed by [ProcessInstance.TenantId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). `public string StartingTransition { get; set; }` Gets or sets the name of the transition that started the subprocess, as recorded by [ProcessDefinition.StartingTransition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). `public string SubprocessName { get; set; }` Gets or sets the persisted value exposed by [ProcessInstance.SubprocessName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). `public DateTime CreationDate { get; set; }` Gets or sets the persisted value exposed by [ProcessInstance.CreationDate](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). `public DateTime? LastTransitionDate { get; set; }` Gets or sets the persisted value exposed by [ProcessInstance.LastTransitionDate](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). `public string CalendarName { get; set; }` Gets or sets the name of the work calendar exposed by [ProcessInstance.CalendarName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). ## Methods `public object GetValue(string key)` Gets the value of the property identified by the specified key. ### Parameters | Name | Type | Description | | --- | --- | --- | | `key` | `String` | The name of a supported public property declared by [ProcessInstanceEntity](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Entities/ProcessInstanceEntity/). | ### Returns | Type | Description | | --- | --- | | `Object` | The property value identified by `key`. | ### Exceptions | Type | Description | | --- | --- | | `ColumnNotExistsException` | `key` does not identify a supported property. | `public void SetValue(string key, object value)` Sets the value of the property identified by the specified key. ### Parameters | Name | Type | Description | | --- | --- | --- | | `key` | `String` | The name of a supported public property declared by [ProcessInstanceEntity](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Entities/ProcessInstanceEntity/). | | `value` | `Object` | The value to assign to the property identified by `key`. | ### Exceptions | Type | Description | | --- | --- | | `ColumnNotExistsException` | `key` does not identify a supported property. | [Previous ProcessAssignmentEntity](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Entities/ProcessAssignmentEntity/) [Next ProcessInstancePersistenceEntity](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Entities/ProcessInstancePersistenceEntity/)