Skip to main content

Class BulkTaskResult<TResult>

A record that stores details about the result of task execution. For tasks that have not completed yet, OptimaJet.Workflow.Core.Runtime.Bulk.BulkTaskResult%601.Empty is used.

Inheritance

↳ object

    BulkTaskResult<TResult>

Implements

IEquatable<BulkTaskResult<TResult>>

Inherited Members

Equals(object)

Equals(object, object)

GetHashCode()

GetType()

MemberwiseClone()

ReferenceEquals(object, object)

ToString()

Namespace: OptimaJet.Workflow.Core.Runtime.Bulk

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public record BulkTaskResult<TResult> : IEquatable<BulkTaskResult<TResult>>

Constructors

BulkTaskResult(BulkTaskState, TResult?, Exception?, DateTimeOffset?, DateTimeOffset?)

A record that stores details about the result of task execution. For tasks that have not completed yet, OptimaJet.Workflow.Core.Runtime.Bulk.BulkTaskResult%601.Empty is used.

Declaration
public BulkTaskResult(BulkTaskState State, TResult? Result = default, Exception? Exception = null, DateTimeOffset? StartedAt = null, DateTimeOffset? FinalizedAt = null)
Parameters
TypeNameDescription
BulkTaskStateStateThe state of the task.
{TResult}ResultIf the task has completed with the status <xref href="OptimaJet.Workflow.Core.Runtime.Bulk.BulkTaskState.Completed" data-throw-if-not-resolved="false"></xref>,
the result will be stored here; otherwise, it will be null.
ExceptionExceptionIf the task has completed with the status <xref href="OptimaJet.Workflow.Core.Runtime.Bulk.BulkTaskState.Failed" data-throw-if-not-resolved="false"></xref>,
the exception will be stored here; otherwise, it will be null.
DateTimeOffset?StartedAtThe time recorded immediately after changing the task status to <xref href="OptimaJet.Workflow.Core.Runtime.Bulk.BulkTaskState.Running" data-throw-if-not-resolved="false"></xref>
and before the start of the task execution.
DateTimeOffset?FinalizedAtThe time recorded before generating and returning the result of the task execution,
after changing the state to <xref href="OptimaJet.Workflow.Core.Runtime.Bulk.BulkTaskState.Completed" data-throw-if-not-resolved="false"></xref> or <xref href="OptimaJet.Workflow.Core.Runtime.Bulk.BulkTaskState.Failed" data-throw-if-not-resolved="false"></xref>.

Properties

State

The state of the task.

Declaration
public BulkTaskState State { get; init; }
Property value
TypeDescription
BulkTaskState

Result

If the task has completed with the status BulkTaskState.Completed, the result will be stored here; otherwise, it will be null.

Declaration
public TResult? Result { get; init; }
Property value
TypeDescription
{TResult}

Exception

If the task has completed with the status BulkTaskState.Failed, the exception will be stored here; otherwise, it will be null.

Declaration
public Exception? Exception { get; init; }
Property value
TypeDescription
Exception

StartedAt

The time recorded immediately after changing the task status to BulkTaskState.Running and before the start of the task execution.

Declaration
public DateTimeOffset? StartedAt { get; init; }
Property value
TypeDescription
DateTimeOffset?

FinalizedAt

The time recorded before generating and returning the result of the task execution, after changing the state to BulkTaskState.Completed or BulkTaskState.Failed.

Declaration
public DateTimeOffset? FinalizedAt { get; init; }
Property value
TypeDescription
DateTimeOffset?

Empty

The result used for an incomplete task.

Declaration
public static BulkTaskResult<TResult> Empty { get; }
Property value
TypeDescription
BulkTaskResult<<TResult>>

Duration

The duration of task execution.

Declaration
public TimeSpan? Duration { get; }
Property value
TypeDescription
TimeSpan?

Extension Methods