Class WorkItem
Compute task.
Inheritance
Implements
Inherited Members
Namespace: DNVGL.One.Compute.Core.FlowModel
Assembly: DNVGL.One.Compute.Core.dll
Syntax
public abstract class WorkItem : FlowModelObject, IFlowModelItem
Constructors
View SourceWorkItem()
Initializes a new instance of the WorkItem class.
Declaration
protected WorkItem()
Properties
View SourceId
Gets or sets the item identifier.
Declaration
public string Id { get; set; }
Property Value
Type | Description |
---|---|
System.String | The item identifier. |
JobId
Gets or sets the job identifier.
Declaration
public string JobId { get; set; }
Property Value
Type | Description |
---|---|
System.String | The job identifier. |
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.
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 identifier.
Methods
View SourceFindItems(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 |
Returns
Type | Description |
---|---|
IEnumerable<WorkItem> | Items that satisfy the |
GetDescendants()
Gets the descendants.
Declaration
public abstract IEnumerable<WorkItem> GetDescendants()
Returns
Type | Description |
---|---|
IEnumerable<WorkItem> | Descendant items. |
GetParent()
Gets the parent.
Declaration
public WorkItem GetParent()
Returns
Type | Description |
---|---|
WorkItem | Parent item. |
OnInitialize(Job)
Called when the Job is initialized.
Declaration
public virtual void OnInitialize(Job job)
Parameters
Type | Name | Description |
---|---|---|
Job | job | The job. |
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 |
Type Parameters
Name | Description |
---|---|
T | Result collection element type. |
ToString()
Returns a
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A |
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.