Class ExecutableWorkBase
Base class for implementations of IComputationalWork.
Inheritance
System.Object
ExecutableWorkBase
Inherited Members
DNVGL.One.Compute.Core.FlowModel.WorkItem.Select<T>(Func<, >)
DNVGL.One.Compute.Core.FlowModel.WorkItem.Traverse(Action<, >, DNVGL.One.Compute.Core.FlowModel.WorkItem)
DNVGL.One.Compute.Core.FlowModel.WorkItem.FindItems(Func<, >, System.Boolean)
Namespace: DNVGL.One.Compute.WorkExecution.ExecutionModel
Assembly: DNVGL.One.Compute.WorkExecution.dll
Syntax
public abstract class ExecutableWorkBase : WorkItem, IFlowModelItem, IComputationalWork
Properties
View SourceSource
Gets or sets the source.
Declaration
public WorkItem Source { get; set; }
Property Value
Type | Description |
---|---|
WorkItem | The source. |
Methods
View SourceCanExecute()
Determines whether this instance can execute.
Declaration
public virtual bool CanExecute()
Returns
Type | Description |
---|---|
System.Boolean |
|
Complete(IExecutionContext, Object, String)
Completes the specified context.
Declaration
protected static object Complete(IExecutionContext context, object result, string message = null)
Parameters
Type | Name | Description |
---|---|---|
IExecutionContext | context | The context. |
System.Object | result | The result. |
System.String | message | The message. |
Returns
Type | Description |
---|---|
System.Object | The completed work. |
CreateRootExecutionContext()
Creates the execution context.
Declaration
protected IExecutionContext CreateRootExecutionContext()
Returns
Type | Description |
---|---|
IExecutionContext | A new root IExecutionContext. |
Execute(Object, IExecutionContext)
Executes with the specified input.
Declaration
public object Execute(object input, IExecutionContext executionContext = null)
Parameters
Type | Name | Description |
---|---|---|
System.Object | input | The input. |
IExecutionContext | executionContext | The execution context. |
Returns
Type | Description |
---|---|
System.Object | Result from execution. |
Fail(IExecutionContext, String, Exception)
Fails the specified context.
Declaration
protected static Exception Fail(IExecutionContext context, string message = null, Exception exception = null)
Parameters
Type | Name | Description |
---|---|---|
IExecutionContext | context | The context. |
System.String | message | The message. |
Exception | exception | The exception. |
Returns
Type | Description |
---|---|
Exception | An exception. |
GetDescendants()
Gets the descendants.
Declaration
public override IEnumerable<WorkItem> GetDescendants()
Returns
Type | Description |
---|---|
IEnumerable<WorkItem> | Descendant items. |
Overrides
View SourceProcess(Object, IExecutionContext)
Processes the specified input.
Declaration
protected abstract object Process(object input, IExecutionContext executionContext)
Parameters
Type | Name | Description |
---|---|---|
System.Object | input | The input. |
IExecutionContext | executionContext | The execution context. |
Returns
Type | Description |
---|---|
System.Object | Processing result. May be null. |