Show / Hide Table of Contents

Interface IExecutionContext

The execution context represents the unique combination of an IComputationalWork processing a particular item of input data.

Inherited Members
IVariableContainer.Variables
IVariableContainer.Item[String]
IVariableContainer.IsAssigned(String, Boolean)
Namespace: DNVGL.One.Compute.WorkExecution.ExecutionModel
Assembly: DNVGL.One.Compute.WorkExecution.dll
Syntax
public interface IExecutionContext : IVariableContainer

Properties

View Source

CancellationToken

Gets the cancellation token.

Declaration
CancellationToken CancellationToken { get; }
Property Value
Type Description
CancellationToken

The cancellation token.

View Source

Exception

Gets the exception if an exception occurred while executing the ExecutableWork.

Declaration
Exception Exception { get; }
Property Value
Type Description
Exception

The exception.

View Source

Message

Gets the message.

Declaration
string Message { get; }
Property Value
Type Description
System.String

The message.

View Source

Progress

Gets the progress as a fraction between 0 (no progress) and 1 (complete).

Declaration
double Progress { get; }
Property Value
Type Description
System.Double

The progress as a fraction between 0 and 1.

View Source

Result

Gets the result.

Declaration
object Result { get; }
Property Value
Type Description
System.Object

The result.

View Source

Status

Gets the work status.

Declaration
WorkStatus Status { get; }
Property Value
Type Description
WorkStatus

The status.

Methods

View Source

Abort(String)

Aborts the work.

Declaration
void Abort(string message = null)
Parameters
Type Name Description
System.String message

The message.

View Source

Complete(Object, String)

Completes the work.

Declaration
void Complete(object result, string message = null)
Parameters
Type Name Description
System.Object result

The result.

System.String message

The message.

View Source

Derive(IComputationalWork)

Derives a child context for a particular combination of work and input.

Declaration
IExecutionContext Derive(IComputationalWork work)
Parameters
Type Name Description
IComputationalWork work

The work.

Returns
Type Description
IExecutionContext

A child context.

Remarks

This is used when a composite IComputationalWork executes by executing each constituent part. In that case a dedicated context must be derived for each part.

View Source

Fail(String, Exception)

Report that the work failed.

Declaration
void Fail(string message, Exception e = null)
Parameters
Type Name Description
System.String message

The message.

Exception e

An optional exception, if caught.

View Source

UpdateProgress(Double, String)

Updates the progress.

Declaration
void UpdateProgress(double progress, string message = null)
Parameters
Type Name Description
System.Double progress

The progress.

System.String message

The message.

Events

View Source

WorkEvent

Occurs when the status or progress of a work item changes.

Declaration
event EventHandler<ExecutableWorkEventArgs> WorkEvent
Event Type
Type Description
EventHandler<ExecutableWorkEventArgs>
  • View Source
In This Article
Back to top Copyright © DNV AS. All rights reserved.