Class ParameterDefinition
OptimaJet.Workflow.Core.Model.ParameterDefinition
Defines a process parameter declared in ProcessDefinition.Parameters.
Namespace: OptimaJet.Workflow.Core.Model
public class ParameterDefinition : BaseDefinitionType Hierarchy
- BaseDefinition
- ParameterDefinition Current type
Properties
[JsonConverter(typeof(NewtonsoftStringTypeConverter))] [JsonConverter(typeof(SystemTextStringTypeConverter))] public virtual Type Type { get; set; } #Gets or sets the CLR Type used for process parameter values.
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<ParameterPurpose>))] public virtual ParameterPurpose Purpose { get; set; } #Gets or sets the ParameterPurpose that controls how Workflow Engine manages and stores the process parameter.
public virtual string InitialValue { get; set; } #Gets or sets the stored representation of the process parameter's initial value. Workflow Engine uses this value when initializing a parameter whose ParameterDefinition.Purpose is ParameterPurpose.Persistence.
Methods
public static ParameterDefinition Create(string name, Type type, ParameterPurpose purpose, string initialValue = null) #Creates a ParameterDefinition with the specified settings.
Parameters
Name
Type
Description
nameStringThe process parameter name.
initialValueStringThe stored representation to assign to ParameterDefinition.InitialValue, or null if no initial value is specified.
Returns
Type
Description
ParameterDefinitionA new ParameterDefinition initialized with the specified settings.
public static ParameterDefinitionWithValue Create(ParameterDefinition parameterDefinition, object value) #Creates a ParameterDefinitionWithValue by associating a value with a parameter definition.
Parameters
Name
Type
Description
valueObjectThe current value to associate with
parameterDefinition.Returns
Type
Description
ParameterDefinitionWithValueA ParameterDefinitionWithValue containing the parameter definition and the resulting value.
Exceptions
Type
Description
InvalidParameterValueExceptionvalue is not assignable to ParameterDefinition.Type and cannot be converted to that type by Convert.ChangeType(object, Type).Remarks
Unless ParameterDefinition.Type is UnknownParameterType, the method passes a non-null
value that is not assignable to the declared type to Convert.ChangeType(object, Type). When ParameterDefinition.Purpose is ParameterPurpose.System, the returned object reuses parameterDefinition; otherwise, it contains the result of ParameterDefinition.Clone().public static ParameterDefinitionWithValue CreateFromPersistence(ParameterDefinition parameterDefinition, object value) #Creates a ParameterDefinitionWithValue for a value loaded from persistence. The returned parameter is marked as unmodified and as already existing in the persistence store.
Parameters
Name
Type
Description
parameterDefinitionParameterDefinitionThe ParameterDefinition that describes the persisted parameter.
valueObjectThe value loaded from the persistence store.
Returns
Type
Description
ParameterDefinitionWithValueA ParameterDefinitionWithValue containing the persisted value and its definition.
Exceptions
Type
Description
InvalidParameterValueExceptionvalue is not assignable to ParameterDefinition.Type and cannot be converted to that type by Convert.ChangeType(object, Type).public ParameterDefinition Clone() #Creates a copy of the current ParameterDefinition.
Returns
Type
Description
ParameterDefinitionA copy of the current ParameterDefinition.
Exceptions
Type
Description
NullReferenceExceptionRemarks
The operation uses BaseDefinition.Clone() and therefore performs a shallow copy except for BaseDefinition.DesignerSettings.
Remarks
The system parameter definitions exposed through DefaultDefinitions.DefaultParameters ignore assignments to ParameterDefinition.Type, ParameterDefinition.Purpose, and ParameterDefinition.InitialValue after they are initialized.