Class WorkItem
Compute task.
Implements
Inherited Members
Namespace: DNVGL.One.Compute.Core.FlowModel
Assembly: DNVGL.One.Compute.Core.dll
Syntax
[DataContract]
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
[JsonProperty("id")]
[DataMember]
public string Id { get; set; }
Property Value
Type | Description |
---|---|
string | The item identifier. |
JobId
Gets or sets the job identifier.
Declaration
[DataMember]
public string JobId { get; set; }
Property Value
Type | Description |
---|---|
string | The job identifier. |
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.
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 SourceFindItems(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 |
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 string that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents this instance. |
Overrides
View SourceTraverse(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.