Show / Hide Table of Contents

Class WorkExecutionContext

A hierarchical execution context for IComputationalWork.

Inheritance
object
WorkExecutionContext
Implements
IExecutionContext
IVariableContainer
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DNVGL.One.Compute.WorkExecution.ExecutionModel
Assembly: DNVGL.One.Compute.WorkExecution.dll
Syntax
public class WorkExecutionContext : IExecutionContext, IVariableContainer

Constructors

View Source

WorkExecutionContext(WorkExecutionContext, IComputationalWork, CancellationToken)

Initializes a new instance of the WorkExecutionContext class.

Declaration
public WorkExecutionContext(WorkExecutionContext parentContext, IComputationalWork work, CancellationToken cancellationToken)
Parameters
Type Name Description
WorkExecutionContext parentContext

The parent context.

IComputationalWork work

The work.

CancellationToken cancellationToken

The cancellation token.

See Also
IExecutionContext

Properties

View Source

CancellationToken

Gets the cancellation token.

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

The cancellation token.

See Also
IExecutionContext
View Source

Exception

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

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

The exception.

See Also
IExecutionContext
View Source

ExecutableWork

Gets the executable work.

Declaration
public IComputationalWork ExecutableWork { get; }
Property Value
Type Description
IComputationalWork

The executable work.

See Also
IExecutionContext
View Source

this[string]

Gets or sets the object with the specified variable name.

Declaration
public object this[string variableName] { get; set; }
Parameters
Type Name Description
string variableName

Name of the variable.

Property Value
Type Description
object

The object.

See Also
IExecutionContext
View Source

Message

Gets the message.

Declaration
public string Message { get; }
Property Value
Type Description
string

The message.

See Also
IExecutionContext
View Source

Progress

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

Declaration
public double Progress { get; }
Property Value
Type Description
double

The progress as a fraction between 0 and 1.

See Also
IExecutionContext
View Source

Result

Gets the result from executing the work.

Declaration
public object Result { get; }
Property Value
Type Description
object

The result.

See Also
IExecutionContext
View Source

Status

Gets the work status.

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

The status.

See Also
IExecutionContext
View Source

Variables

Gets the context variables.

Declaration
public IEnumerable<Variable> Variables { get; }
Property Value
Type Description
IEnumerable<Variable>

The context variables.

See Also
IExecutionContext

Methods

View Source

CreateRootContext(IComputationalWork)

Creates the root context.

Declaration
public static IExecutionContext CreateRootContext(IComputationalWork work = null)
Parameters
Type Name Description
IComputationalWork work

The work.

Returns
Type Description
IExecutionContext

A root IExecutionContext.

See Also
IExecutionContext
View Source

IsAssigned(string, bool)

Determines whether this variable has been assigned.

Declaration
public bool IsAssigned(string variableName, bool searchContextHierarchy = true)
Parameters
Type Name Description
string variableName

Name of the variable.

bool searchContextHierarchy

if set to true the context hierarchy will be searched in addition to this context.

Returns
Type Description
bool

true if the variable is assigned; otherwise, false.

See Also
IExecutionContext

Events

View Source

WorkEvent

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

Declaration
public event EventHandler<ExecutableWorkEventArgs> WorkEvent
Event Type
Type Description
EventHandler<ExecutableWorkEventArgs>
See Also
IExecutionContext

Implements

IExecutionContext
IVariableContainer

See Also

IExecutionContext
  • View Source
In this article
Back to top Copyright © DNV AS. All rights reserved.