Show / Hide Table of Contents

Class WorkItem

Compute task.

Inheritance
object
FlowModelObject
WorkItem
CompositeWork
FlowGraph
WorkUnit
ExecutableWorkBase
Implements
IFlowModelItem
Inherited Members
FlowModelObject.BatchNumber
FlowModelObject.Properties
FlowModelObject.PropertiesContent
FlowModelObject.this[string]
FlowModelObject.UpdateProperties(string)
FlowModelObject.UpdateProperties(FlowModelObject)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: DNVGL.One.Compute.Core.FlowModel
Assembly: DNVGL.One.Compute.Core.dll
Syntax
[DataContract]
public abstract class WorkItem : FlowModelObject, IFlowModelItem

Constructors

View Source

WorkItem()

Initializes a new instance of the WorkItem class.

Declaration
protected WorkItem()

Properties

View Source

Id

Gets or sets the item identifier.

Declaration
[JsonProperty("id")]
[DataMember]
public string Id { get; set; }
Property Value
Type Description
string

The item identifier.

View Source

JobId

Gets or sets the job identifier.

Declaration
[DataMember]
public string JobId { get; set; }
Property Value
Type Description
string

The job identifier.

View Source

ParentId

Gets or sets the parent identifier.

Declaration
[DataMember]
public string ParentId { get; set; }
Property Value
Type Description
string

The parent identifier.

Remarks

Identifier of the parent WorkItem. Null if this is the root of the WorkItem hierarchy.

View Source

Tag

Gets or sets the tag.

Declaration
[DataMember]
public string Tag { get; set; }
Property Value
Type Description
string

The tag.

Remarks

This is a client specified tag that does not need to be unique. It is used as a recognizable prefix for the job identifier.

Methods

View Source

FindItems(Func<WorkItem, bool>, bool)

Finds the items that satisfy the given predicate.

Declaration
public IEnumerable<WorkItem> FindItems(Func<WorkItem, bool> predicate, bool exhaustive = true)
Parameters
Type Name Description
Func<WorkItem, bool> predicate

The predicate.

bool exhaustive

if set to true [exhaustive].

Returns
Type Description
IEnumerable<WorkItem>

Items that satisfy the predicate.

View Source

GetDescendants()

Gets the descendants.

Declaration
public abstract IEnumerable<WorkItem> GetDescendants()
Returns
Type Description
IEnumerable<WorkItem>

Descendant items.

View Source

GetParent()

Gets the parent.

Declaration
public WorkItem GetParent()
Returns
Type Description
WorkItem

Parent item.

View Source

OnInitialize(Job)

Called when the Job is initialized.

Declaration
public virtual void OnInitialize(Job job)
Parameters
Type Name Description
Job job

The job.

View Source

Select<T>(Func<WorkItem, T>)

Selects the specified function.

Declaration
public IEnumerable<T> Select<T>(Func<WorkItem, T> function)
Parameters
Type Name Description
Func<WorkItem, T> function

The function.

Returns
Type Description
IEnumerable<T>

Collection of type T.

Type Parameters
Name Description
T

Result collection element type.

View Source

ToString()

Returns a string that represents this instance.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents this instance.

Overrides
object.ToString()
View Source

Traverse(Action<WorkItem, WorkItem>, WorkItem)

Traverses the work item hierarchy.

Declaration
public void Traverse(Action<WorkItem, WorkItem> action, WorkItem parent = null)
Parameters
Type Name Description
Action<WorkItem, WorkItem> action

The action to be performed at each work item.

WorkItem parent

The parent node.

Remarks

The arguments of the action are as follows: (WorkItem parentItem, WorkItem childItem). If the parentItem is null, the childItem is the root item of the hierarchy.

Implements

IFlowModelItem

Extension Methods

WorkItemExtensions.GetAncestors(WorkItem, WorkItem)
WorkItemExtensions.GetRelativeWeight(WorkItem, WorkItem)
WorkItemExtensions.BuildExecutableWork(WorkItem)
  • View Source
In this article
Back to top Copyright © DNV AS. All rights reserved.