Node List
Node list objects allow you to select node relationships in an expression. For example,
after you add a node
object to an expression, you can add the
children
object to further refine your expression.
After you add a node list object, you can add the following methods to that object. After
you add a method, you must specify a condition for that method (depending on the method,
this will be either a value that can be evaluated to a Boolean value, or a float,
integer, or string value to be returned for each node in the list for the
toFloatList
, toIntegerList
, and
toStringList
methods).
Method | Description | Parameters | Example |
---|---|---|---|
Any |
Returns True if any of the nodes in a node list match the specified condition. | The condition that the node list object gets evaluated against. | any.childNode.properties.AccountType.equals(Expense)
will return True if any of the children of the selected node have an
account type of Expense.
|
Count |
Returns a count of the nodes in a node list that match a specified condition. | The condition that the node list object gets evaluated against. | count.childNode.properties.SourcePlanType.equals(Plan1)
returns the number of children for a selected node whose source plan
type is "Plan1".
|
Filter |
Returns a list of nodes which match the specified condition. | The condition for the filter (must return a Boolean value). | ancestors.filter
(ancestorNode.properties.Level.lessThan(4)) returns a list
of ancestor nodes on the first three levels.
|
Find |
Returns the first node in a node list that matches a specified condition. | The condition that the node list object gets evaluated against. | find.childNode.properties.Name.startsWith(A_)
returns the first child of a selected node whose name starts with the
letter "A_" |
Get |
Returns the node in a list of nodes at the specified index | The index (position in the list) of the node to get.
The position that you specify must be an integer value. Positive index numbers (or zero) count from the first index to the last, with zero being the first index. Negative index numbers count from last to first. |
node.children.get(0) gets the first child node of a
node
|
isEmpty |
Returns True if the node list is either null or
empty.
|
None | node.properties.PLN.UDA (Account).IsEmpty returns
True if the value of the PLN.UDA (Account) string list is either null or
empty.
|
Max |
Returns a single node with the maximum value of the specified data type. If multiple nodes in the list have the maximum value, the first node is returned. |
The assessed value to determine which node in the list has the
maximum value.
Allowed data types for the value are String, Integer, Float, Date, Timestamp, or Boolean. |
node.children.max.(childNode.name) returns the
maximum child name based on data type. For example, if the children node
names are integers, it would return the highest numeric value.
|
Min |
Returns a single node with the minimum value of the specified data type. If multiple nodes in the list have the minimum value, the first node is returned. |
The assessed value to determine which node in the list has the
minimum value.
Allowed data types for the value are String, Integer, Float, Date, Timestamp, or Boolean. |
node.children.min.(childNode.properties.Salary)
returns the subordinate under a manager which has the lowest salary in
an employee hierarchy.
|
Reverse |
Returns the node list values in the reverse order. | None | node.ancestors.reverse returns a list of ancestors
for a node in reverse (bottom up) order.
|
Size |
Returns the number of nodes in a node list.
Note: The
|
None | return node.children.size.toString returns the
number of children for a node as a string value.
|
toFloatList |
Returns a float value from each node in a node list
For methods, see Integer List and Float List. |
None | return
node.children.toFloatList(childNode.properties.Ownership%).sum
returns the sum of the ownership percentage for all children of a
node.
|
toIntegerList |
Returns a integer value from each node in a node list
For methods, see Integer List and Float List. |
None | return
node.children.toIntegerList(childNode.properties.Employees).size
returns the number of employees across all child nodes.
|
toStringList |
Returns a string value from each node in a node list.
See List and String List for the methods that you can add to a string list. |
None | return
node.ancestors.toStringList(ancestorNode.name).join("|")
returns a string list of ancestors for a node separated by
"|".
|