# Class ProcessInstancesTree OptimaJet.Workflow.Core.Subprocess.ProcessInstancesTree Namespace: [OptimaJet.Workflow.Core.Subprocess](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Subprocess/) ```csharp public sealed class ProcessInstancesTree ``` ## Constructors `public ProcessInstancesTree(Guid id)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `id` | `Guid` | | `public ProcessInstancesTree(Guid id, string name, string startingTransitionName)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `id` | `Guid` | | | `name` | `String` | | | `startingTransitionName` | `String` | | ## Properties `public Guid Id { get; }` `public string Name { get; set; }` `public string StartingTransitionName { get; set; }` `public ProcessInstancesTree Parent { get; }` `public ProcessInstancesTree Root { get; }` `public bool IsRoot { get; }` `public IEnumerable Children { get; }` ## Methods `public void Remove()` `public ProcessInstancesTree GetNodeById(Guid id, bool startFromRoot = true)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `id` | `Guid` | | | `startFromRoot` | `Boolean` | | ### Returns | Type | Description | | --- | --- | | `ProcessInstancesTree` | | `public List GetAllLeafs()` ### Returns | Type | Description | | --- | --- | | `List` | | `public List GetAllLeafs(ProcessInstancesTree node, List acc)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `node` | `ProcessInstancesTree` | | | `acc` | `List` | | ### Returns | Type | Description | | --- | --- | | `List` | | `public List GetAllChildrenIds(int startDistance = 1, int? endDistance = null)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `startDistance` | `Int32` | | | `endDistance` | `Nullable` | | ### Returns | Type | Description | | --- | --- | | `List` | | `public bool HaveChildWithName(string name)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | | ### Returns | Type | Description | | --- | --- | | `Boolean` | | `public ProcessInstancesTree GetChildWithName(string name, bool deepSearch = false)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | | | `deepSearch` | `Boolean` | | ### Returns | Type | Description | | --- | --- | | `ProcessInstancesTree` | | `public void AddChild(ProcessInstancesTree instancesTree)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `instancesTree` | `ProcessInstancesTree` | | `public void RemoveChild(ProcessInstancesTree instancesTree)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `instancesTree` | `ProcessInstancesTree` | | `public IEnumerable BreadthFirstTraversal(bool includeRoot, Func levelOrderBy = null)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `includeRoot` | `Boolean` | | | `levelOrderBy` | `Func` | | ### Returns | Type | Description | | --- | --- | | `IEnumerable` | | `public IEnumerable DepthFirstTraversal(bool includeRoot)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `includeRoot` | `Boolean` | | ### Returns | Type | Description | | --- | --- | | `IEnumerable` | | [Previous WorkflowTimerProcessor](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Timers/WorkflowTimerProcessor/) [Next SubprocessUtils](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Subprocess/SubprocessUtils/)