Class PersistenceParametersBatch
OptimaJet.Workflow.Core.Model.PersistenceParametersBatch
Represents a batch of serialized persistence operations for modified parameters of a ProcessInstance.
Namespace: OptimaJet.Workflow.Core.Model
public sealed class PersistenceParametersBatchProperties
public IReadOnlyList<SerializedParameter> Parameters { get; } #Gets the SerializedParameter instances that describe the persistence operations in this batch.
public Guid ProcessId { get; } #Gets the identifier of the ProcessInstance associated with this batch.
public string? TenantId { get; } #Gets the tenant identifier of the ProcessInstance associated with this batch, if any.
public bool IsEmpty { get; } #Gets a value indicating whether PersistenceParametersBatch.Parameters contains no persistence operations.
Methods
public void CommitFlags() #Updates the source parameters represented by PersistenceParametersBatch.Parameters to reflect successful persistence.
Remarks
Each source ParameterDefinitionWithValue is marked as unmodified. A SerializedParameter.PersistenceOperation.Delete operation marks the source parameter as absent from persistence; SerializedParameter.PersistenceOperation.Insert and SerializedParameter.PersistenceOperation.Update operations mark it as present. Call this method only after the persistence operation completes successfully.
public static PersistenceParametersBatch CreateFromProcessInstance(ProcessInstance processInstance) #Creates a batch by selecting and serializing modified parameters from
processInstance whose ParameterDefinitionWithValue.Purpose is ParameterPurpose.Persistence.Parameters
Name
Type
Description
Returns
Type
Description
PersistenceParametersBatchA batch containing the selected SerializedParameter instances, or a batch for which PersistenceParametersBatch.IsEmpty is true when no matching parameters are found.
Exceptions
Type
Description
ArgumentNullExceptionprocessInstance is null.public static PersistenceParametersBatch CreateForSingleParameter(ProcessInstance processInstance, string parameterName) #Creates a batch for the modified parameter named
parameterName in processInstance when its ParameterDefinitionWithValue.Purpose is ParameterPurpose.Persistence.Parameters
Name
Type
Description
parameterNameStringThe name of the process parameter to select.
Returns
Type
Description
PersistenceParametersBatchA batch containing a single SerializedParameter instance, or a batch for which PersistenceParametersBatch.IsEmpty is true when no parameter with the specified name exists, its ParameterDefinitionWithValue.Purpose is not ParameterPurpose.Persistence, or it has not been modified.
Exceptions
Remarks
Instances are created from a ProcessInstance by selecting modified parameters whose ParameterDefinitionWithValue.Purpose is ParameterPurpose.Persistence.