Show / Hide Table of Contents

Class WorkItem

Compute task

Inheritance
System.Object
FlowModelObject
WorkItem
CompositeWork
FlowGraph
WorkUnit
Implements
IFlowModelItem
Inherited Members
FlowModelObject.BatchNumber
FlowModelObject.Properties
FlowModelObject.PropertiesContent
FlowModelObject.Item[String]
FlowModelObject.UpdateProperties(String)
Namespace: DNVGL.One.Compute.Core.FlowModel
Assembly: DNVGL.One.Compute.Core.dll
Syntax
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
public string Id { get; set; }
Property Value
Type Description
System.String

The item identifier.

View Source

JobId

Gets or sets the job identifier.

Declaration
public string JobId { get; set; }
Property Value
Type Description
System.String

The job identifier.

View Source

ParentId

Gets or sets the parent identifier.

Declaration
public string ParentId { get; set; }
Property Value
Type Description
System.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
public string Tag { get; set; }
Property Value
Type Description
System.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 id

Methods

View Source

FindItems(Func<WorkItem, Boolean>, Boolean)

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, System.Boolean> predicate

The predicate.

System.Boolean 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 that represents this instance.

Declaration
public override string ToString()
Returns
Type Description
System.String

A that represents this instance.

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.GetRelativeWeight(WorkItem, WorkItem)
WorkItemExtensions.GetAncestors(WorkItem, WorkItem)
  • View Source
Back to top Copyright © DNV GL AS. All rights reserved.