Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE formengine.io.

Class ParametersCollection

Represent a collection of process's parameters

Inheritance

↳ object

    ↳ ParametersCollection

Implements

IEnumerable<ParameterDefinitionWithValue>

IEnumerable

Inherited Members

Equals(object)

Equals(object, object)

GetHashCode()

GetType()

ReferenceEquals(object, object)

ToString()

Namespace: OptimaJet.Workflow.Core.Model

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public sealed class ParametersCollection : IEnumerable<ParameterDefinitionWithValue>, IEnumerable

Constructors

ParametersCollection(List<ParameterDefinitionWithValue>, ProcessInstance)

Declaration
public ParametersCollection(List<ParameterDefinitionWithValue> parameters, ProcessInstance owner)
Parameters
TypeNameDescription
List<ParameterDefinitionWithValue>parameters
ProcessInstanceowner

ParametersCollection(IEnumerable<ParameterDefinitionWithValue>, ProcessInstance)

Declaration
public ParametersCollection(IEnumerable<ParameterDefinitionWithValue> parameters, ProcessInstance owner)
Parameters
TypeNameDescription
IEnumerable<ParameterDefinitionWithValue>parameters
ProcessInstanceowner

ParametersCollection(ProcessInstance)

Declaration
public ParametersCollection(ProcessInstance owner)
Parameters
TypeNameDescription
ProcessInstanceowner

Methods

GetEnumerator()

Declaration
public IEnumerator<ParameterDefinitionWithValue> GetEnumerator()
Returns
TypeDescription
IEnumerator<ParameterDefinitionWithValue>

AddParameter(ParameterDefinitionWithValue)

Adds parameter to process parameters collection

Declaration
public void AddParameter(ParameterDefinitionWithValue parameter)
Parameters
TypeNameDescription
ParameterDefinitionWithValueparameterParameter with value <xref href="OptimaJet.Workflow.Core.Model.ParameterDefinitionWithValue" data-throw-if-not-resolved="false"></xref>

AddParameters(IEnumerable<ParameterDefinitionWithValue>)

Adds parameters to process parameters collection

Declaration
public void AddParameters(IEnumerable<ParameterDefinitionWithValue> parameters)
Parameters
TypeNameDescription
IEnumerable<ParameterDefinitionWithValue>parametersCollection of parameters with value <xref href="OptimaJet.Workflow.Core.Model.ParameterDefinitionWithValue" data-throw-if-not-resolved="false"></xref>

ReplaceParameters(List<ParameterDefinitionWithValue>)

Replace parameters collection by new value

Declaration
public void ReplaceParameters(List<ParameterDefinitionWithValue> parameters)
Parameters
TypeNameDescription
List<ParameterDefinitionWithValue>parameters>Collection of parameters with value <xref href="OptimaJet.Workflow.Core.Model.ParameterDefinitionWithValue" data-throw-if-not-resolved="false"></xref>

IsParameterExisting(string)

Checks that the parameter whether exists or not

Declaration
public bool IsParameterExisting(string name)
Parameters
TypeNameDescription
stringnameName of the parameter
Returns
TypeDescription
booltrue if exists

GetParameter(string)

Returns parameter with value ParameterDefinitionWithValue with specific name

Declaration
public ParameterDefinitionWithValue GetParameter(string name)
Parameters
TypeNameDescription
stringnameName of the parameter
Returns
TypeDescription
ParameterDefinitionWithValueParameter with value <xref href="OptimaJet.Workflow.Core.Model.ParameterDefinitionWithValue" data-throw-if-not-resolved="false"></xref>

GetParameterAsync(string)

Returns parameter with value ParameterDefinitionWithValue with specific name (Async version)

Declaration
public Task<ParameterDefinitionWithValue> GetParameterAsync(string name)
Parameters
TypeNameDescription
stringnameName of the parameter
Returns
TypeDescription
Task<ParameterDefinitionWithValue>Parameter with value <xref href="OptimaJet.Workflow.Core.Model.ParameterDefinitionWithValue" data-throw-if-not-resolved="false"></xref>

GetParameter<T>(string)

Returns parameter's value by specific name

Declaration
public T GetParameter<T>(string name)
Parameters
TypeNameDescription
stringnameName of the parameter
Returns
TypeDescription
{T}Value of the parameter

GetParameterAsync<T>(string)

Returns parameter's value by specific name (Async version)

Declaration
public Task<T> GetParameterAsync<T>(string name)
Parameters
TypeNameDescription
stringnameName of the parameter
Returns
TypeDescription
Task<T>Value of the parameter

SetParameter<T>(string, T, ParameterPurpose)

Set value of the parameter with specific name. If the definition of the parameter with specific name is absent in the scheme of the process ProcessDefinition.Parameters, there will be created Temporary parameter ParameterDefinition.Purpose with specified name

Declaration
public void SetParameter<T>(string name, T value, ParameterPurpose purposeIfMissing = ParameterPurpose.Temporary)
Parameters
TypeNameDescription
stringnameName of the parameter
{T}valueValue of the parameter
ParameterPurposepurposeIfMissingSet it to ParameterPurpose.Persistence if you want persist this parameter forcibly

SetParameterAsync<T>(string, T, ParameterPurpose)

Set value of the parameter with specific name. Async version If the definition of the parameter with specific name is absent in the scheme of the process ProcessDefinition.Parameters, there will be created Temporary parameter ParameterDefinition.Purpose with specified name.

Declaration
public Task SetParameterAsync<T>(string name, T value, ParameterPurpose purposeIfMissing = ParameterPurpose.Temporary)
Parameters
TypeNameDescription
stringnameName of the parameter
{T}valueValue of the parameter
ParameterPurposepurposeIfMissingSet it to ParameterPurpose.Persistence if you want persist this parameter forcibly
Returns
TypeDescription
Task

SetImplicitSerializedParameter(string, string, ParameterPurpose)

Sets implicit parameter using it's json serialized value

Declaration
public void SetImplicitSerializedParameter(string name, string value, ParameterPurpose purposeIfMissing = ParameterPurpose.Temporary)
Parameters
TypeNameDescription
stringnameName of the parameter
stringvalueJSON serialized value of implicit parameter
ParameterPurposepurposeIfMissingParameter purpose

RemoveParameter(string, bool)

Set null to process parameter value

Declaration
public void RemoveParameter(string name, bool removeFromCollection = false)
Parameters
TypeNameDescription
stringnameParameter name
boolremoveFromCollectionIf true physically remove <xref href="OptimaJet.Workflow.Core.Model.ParameterDefinitionWithValue" data-throw-if-not-resolved="false"></xref> from collection

InitPersistenceParametersFromScheme()

Declaration
public void InitPersistenceParametersFromScheme()

Extension Methods