# Class RestoreDecision OptimaJet.Workflow.Core.Runtime.ProcessRestoring.RestoreDecision Represents a decision that controls how a process is restored. Namespace: [OptimaJet.Workflow.Core.Runtime.ProcessRestoring](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/) ```csharp public class RestoreDecision ``` ## Properties `public RestoreDecisionTypes Type { get; }` Gets the restore decision type. `public IDictionary ProcessParameters { get; }` Gets the process parameters that should be assigned during restore. `public List Persist { get; }` Gets the names of restore parameters marked for persistence. `public ActivityDefinition Activity { get; }` Gets the activity used by [RestoreDecision.RunFromNewActivity(ActivityDefinition)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecision/) or [RestoreDecision.ResumeFromNewActivity(ActivityDefinition)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecision/) instead of the process's current activity. `public static RestoreDecision Default { get; }` Gets the default restore decision. `public static RestoreDecision RunFromCurrentActivity { get; }` Gets a decision that executes the process's current activity again during restore and then continues the process according to the normal activity execution flow. ### Remarks The current activity itself is executed. Use [RestoreDecision.ResumeFromCurrentActivity](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecision/) when its repeated execution should be skipped. `public static RestoreDecision ResumeFromCurrentActivity { get; }` Gets a decision that does not execute the process's current activity again during restore and instead attempts to continue the process through that activity's automatic outgoing transitions. ### Remarks The current activity itself is not executed. Use [RestoreDecision.RunFromCurrentActivity](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecision/) when it should be executed again before the process continues. `public static RestoreDecision Delete { get; }` Gets a decision that deletes the process during restore. ## Methods `public RestoreDecision AddPersistentParameter(string name, object value)` Adds a process parameter that should be persisted. ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The parameter name. | | `value` | `Object` | The parameter value. | ### Returns | Type | Description | | --- | --- | | `RestoreDecision` | The current restore decision. | ### Remarks The parameter is added to [RestoreDecision.ProcessParameters](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecision/) and its name is added to [RestoreDecision.Persist](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecision/). `public RestoreDecision AddTemporaryParameter(string name, object value)` Adds a process parameter that should not be marked for persistence. ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The parameter name. | | `value` | `Object` | The parameter value. | ### Returns | Type | Description | | --- | --- | | `RestoreDecision` | The current restore decision. | ### Remarks The parameter is added to [RestoreDecision.ProcessParameters](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecision/) only. `public static RestoreDecision RunFromNewActivity(ActivityDefinition activityDefinition)` Creates a decision that executes the specified activity during restore and then continues the process according to the normal activity execution flow. ### Parameters | Name | Type | Description | | --- | --- | --- | | `activityDefinition` | `ActivityDefinition` | The activity to execute instead of the process's current activity. | ### Returns | Type | Description | | --- | --- | | `RestoreDecision` | A restore decision with [RestoreDecision.Type](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecision/) set to [RestoreDecisionTypes.RunFromNewActivity](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecisionTypes/). | ### Exceptions | Type | Description | | --- | --- | | `ArgumentNullException` | Thrown when `activityDefinition` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | ### Remarks The specified activity itself is executed. Use [RestoreDecision.ResumeFromNewActivity(ActivityDefinition)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecision/) when its execution should be skipped. `public static RestoreDecision ResumeFromNewActivity(ActivityDefinition activityDefinition)` Creates a decision that does not execute the specified activity during restore and instead attempts to continue the process through that activity's automatic outgoing transitions. ### Parameters | Name | Type | Description | | --- | --- | --- | | `activityDefinition` | `ActivityDefinition` | The activity after which process execution should continue. | ### Returns | Type | Description | | --- | --- | | `RestoreDecision` | A restore decision with [RestoreDecision.Type](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecision/) set to [RestoreDecisionTypes.ResumeFromNewActivity](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecisionTypes/). | ### Exceptions | Type | Description | | --- | --- | | `ArgumentNullException` | Thrown when `activityDefinition` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | ### Remarks The specified activity itself is not executed. Use [RestoreDecision.RunFromNewActivity(ActivityDefinition)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecision/) when it should be executed before the process continues. [Previous IProcessRestorer](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/IProcessRestorer/) [Next RestoreDecisionTypes](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.ProcessRestoring/RestoreDecisionTypes/)