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