Browse the Tree Structure Types and Functions

The following functions allow retrieving the parent node, children, or siblings of a given node.

getParent

Syntax

It is possible to get the parent of a specific node with given <designation>. See to the following syntax.

var result = getParent(<designation>)

var obj = new BrowserObject(<designation>);

var result = getParent(obj);

getChildren

Syntax

It is possible to get the children of a specific node with a given <designation>. See to the following syntax.

var result = getChildren(<designation>)

var obj = new BrowserObject(<designation>);

var result = getChildren(obj);

getSiblings

Syntax

It is possible to get the siblings of a specific node with a given <designation>. See to the following syntax.

var result = getSiblings(<designation>)

var obj = new BrowserObject(<designation>);

var result = getSiblings(obj);

Parameter Usage

Parameter

Type

Default

Use

Annotation

designation

String

-

Mandatory

CNS full path (designation).

Result

Error Handling

Errors can occur in case:

Examples

 

How to get the parent of the Logics node

var browserObject = new BrowserObject("System1.ApplicationView:ApplicationView.Logics");

    var parent = getParent(browserObject)

if (!parent.error)

    console("Parent = {0}", parent.browserObject)

 

How to get the children of the Logics node

var browserObject = new BrowserObject("System1.ApplicationView:ApplicationView.Logics");

var children = getChildren(browserObject)

if (!children.error)

{

    console("Children Count = {0}", children.browserObjects.length)

    console("Children = {0}", children.browserObjects)

}

 

How to get the parent of the Field Networks node

var parent = getParent("System1.ManagementView:ManagementView.FieldNetworks")

if (!parent.error)

    console("Parent = {0}", parent.browserObject)

 

How to get the children of the Management View node

var children = getChildren("System1.ManagementView:ManagementView")

if (!children.error)

{

    console("Children Count = {0}", children.browserObjects.length)

    console("Children = {0}", children.browserObjects)

}

 

How to get siblings of the Scripts node

var browserObject = new BrowserObject("System1.ApplicationView:ApplicationView.Logics.Scripts");

    var siblings = getSiblings(browserObject)

if (!siblings.error)

{

    console("Siblings Count = {0}", siblings.browserObjects.length)

    console("Siblings = {0}", siblings.browserObjects)

}