Class BulkTaskFinalizedEventArgs<TId, TResult>
OptimaJet.Workflow.Core.Runtime.Bulk.BulkTaskFinalizedEventArgs<TId, TResult>
Provides event data for the BulkAggregateTask<TId, TResult>.OnTaskFinalized event.
Namespace: OptimaJet.Workflow.Core.Runtime.Bulk
public class BulkTaskFinalizedEventArgs<TId, TResult> : EventArgsType Hierarchy
- EventArgs
- BulkTaskFinalizedEventArgs<TId, TResult> Current type
Constructors
public BulkTaskFinalizedEventArgs(Dictionary<TId, BulkTaskResult<TResult>> results, TId lastFinalizedTaskId) #Initializes a new instance of BulkTaskFinalizedEventArgs<TId, TResult>.
Parameters
Name
Type
Description
resultsDictionary<TId, BulkTaskResult<TResult>>A dictionary containing intermediate results for all tasks being tracked.
lastFinalizedTaskId{TId}The identifier of the last completed task.
Properties
public Dictionary<TId, BulkTaskResult<TResult>> Results { get; } #Gets the dictionary of task identifiers and their current BulkTaskResult<TResult> values.
Remarks
Values are initially BulkTaskResult<TResult>.Empty for each task; as processing continues, results and states are updated. When a task transitions from BulkTaskState.Created to BulkTaskState.Running, the result value is not replaced, by design, for performance reasons.
public TId LastFinalizedTaskId { get; } #The identifier of the last finalized task.
public BulkTaskResult<TResult> LastFinalizedTaskResult { get; } #Gets the BulkTaskResult<TResult> of the task identified by BulkTaskFinalizedEventArgs<TId, TResult>.LastFinalizedTaskId.
Exceptions
Type
Description
KeyNotFoundExceptionpublic int Count { get; } #Gets the total number of tracked tasks.
public int NotRanCount { get; } #Gets the number of tasks currently in the BulkTaskState.Created state.
public int CompletedCount { get; } #Gets the number of tasks currently in the BulkTaskState.Completed state.
public int FailedCount { get; } #Gets the number of tasks currently in the BulkTaskState.Failed state.
public int FinalizedCount { get; } #Gets the number of tasks in the finalized states: BulkTaskState.Completed or BulkTaskState.Failed.
public decimal Progress { get; } #Gets the proportion of tasks with finalized results (BulkTaskFinalizedEventArgs<TId, TResult>.FinalizedCount) out of all tasks (BulkTaskFinalizedEventArgs<TId, TResult>.Count).
Exceptions
Type
Description
DivideByZeroExceptionNo tasks are present, so BulkTaskFinalizedEventArgs<TId, TResult>.Count is zero.