# Class ParameterDefinitionWithValue OptimaJet.Workflow.Core.Model.ParameterDefinitionWithValue Represents a process parameter by combining its definition with its current [ParameterDefinitionWithValue.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/). Namespace: [OptimaJet.Workflow.Core.Model](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/) ```csharp public sealed class ParameterDefinitionWithValue : ParameterDefinition ``` ## Type Hierarchy - [BaseDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/BaseDefinition/) - [ParameterDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinition/) - ParameterDefinitionWithValue Current type ## Properties `public override string Name { get; set; }` Gets or sets the name of the process parameter. `[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter))] public override ParameterPurpose Purpose { get; set; }` Gets or sets the [ParameterPurpose](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterPurpose/) that controls how Workflow Engine manages and stores the process parameter. `[JsonConverter(typeof(NewtonsoftStringTypeConverter))] [JsonConverter(typeof(SystemTextStringTypeConverter))] public override Type Type { get; set; }` Gets or sets the [Type](https://learn.microsoft.com/dotnet/api/system.type) used for [ParameterDefinitionWithValue.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/). `public object Value { get; set; }` Gets or sets the current value of the process parameter. ### Remarks When [ParameterDefinitionWithValue.IsImplicit](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/) is [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), assigning a non-[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) value also assigns the result of [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) to [ParameterDefinitionWithValue.Type](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/) if the underlying parameter definition accepts changes. Every assignment clears the cached dynamic representation and marks the process parameter as modified. `public bool IsImplicit { get; }` Gets a value indicating whether the parameter type is not defined in the process scheme. `public bool IsExternal { get; }` Gets a value indicating whether this instance represents an external parameter obtained from an [IWorkflowExternalParametersProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/IWorkflowExternalParametersProvider/). `public Type OriginalExternalParameterType { get; }` Gets the original [Type](https://learn.microsoft.com/dotnet/api/system.type) of an external parameter value supplied by an [IWorkflowExternalParametersProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/IWorkflowExternalParametersProvider/). ### Remarks Workflow Engine passes this type to [DynamicParameter.Restore(Type)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/DynamicParameter/) before writing a dynamically represented value through the [IWorkflowExternalParametersProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/IWorkflowExternalParametersProvider/). ## Methods `public ParameterDefinitionWithValue Clone()` Creates a copy of this process parameter. ### Returns | Type | Description | | --- | --- | | `ParameterDefinitionWithValue` | A new [ParameterDefinitionWithValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/) with the same [ParameterDefinitionWithValue.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/) reference and a cloned underlying parameter definition, if one is present. | ### Exceptions | Type | Description | | --- | --- | | `NullReferenceException` | [BaseDefinition.DesignerSettings](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/BaseDefinition/) is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) on this instance or on the underlying parameter definition. | ### Remarks The cached dynamic representation is not copied. The returned parameter is marked as modified and as not yet present in the persistence store. `public string SerializeValueToJson()` Returns the serialized representation of [ParameterDefinitionWithValue.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/). ### Returns | Type | Description | | --- | --- | | `String` | If [ParameterDefinitionWithValue.IsImplicit](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/) is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), the result of calling [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring) on [ParameterDefinitionWithValue.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/). Otherwise, the method returns the JSON produced by [ParametersSerializer.Serialize(object, Type)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/ParametersSerializer/), which is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when [ParameterDefinitionWithValue.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/) is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | ### Exceptions | Type | Description | | --- | --- | | `NullReferenceException` | [ParameterDefinitionWithValue.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/) is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) while [ParameterDefinitionWithValue.IsImplicit](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/) is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | `public object GetDynamicValue()` Gets [ParameterDefinitionWithValue.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/) in the runtime representation used for implicit parameter data. ### Returns | Type | Description | | --- | --- | | `Object` | [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when [ParameterDefinitionWithValue.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/) is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null); the result of [DynamicParameter.ParseJson(string)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/DynamicParameter/) when [ParameterDefinitionWithValue.IsImplicit](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/) is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool); otherwise, [ParameterDefinitionWithValue.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionWithValue/) unchanged. | [Previous ParameterDefinitionReference](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinitionReference/) [Next ParameterPurpose](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterPurpose/)