Node Collections and Node List Data Type Properties
A node collection is a list of node values that comes from a function, such as ancestors, locations, or children. A node list data type property is a list of node values that comes from another property.
When you add a node list data type property to an expression, you can perform a property transformation, derive a property value, enforce a custom validation, filter subscription requests, filter approval or notification polices, or filter extracts using a property with a data type of Node List.
Note:
The nodes being referenced in the node list data type property can be outside of the current data chain.
After you add a node collections or a node list data type 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).
Table 25-7 Node Collections and Node List Data Type Methods and Attributes
| Method | Description | Returned Object Data Type | Parameters | Example |
|---|---|---|---|---|
Any |
Returns True if any of the nodes in a node list match the specified condition. | Boolean | 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.
Predicate node: See Predicate Node Attributes and Methods table, below. |
Count |
Returns a count of the nodes in a node list that match a specified
condition.
Tip: If you want to return the total number of
nodes without specifying a predicate condition, use
|
Integer | 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".
Predicate node: See Predicate Node Attributes and Methods table, below. |
Filter |
Returns a list of nodes which match the specified condition. | Node List
Note: The type of node list that is returned is based on the type of collection that you are performing the method on. |
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.
Predicate node: See Predicate Node Attributes and Methods table, below. |
Find |
Returns the first node in a node list that matches a specified condition. | Node
Note: The type of node that is returned is based on the type of collection that you are performing the method on. |
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_"Predicate node: See Predicate Node Attributes and Methods table, below. Returned node: See Returned Node Attributes and Methods table, below. |
Get |
Returns the node in a list of nodes at the specified index | Node
Note: The type of node that is returned is based on the type of collection that you are performing the method on. |
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
Returned node: See Returned Node Attributes and Methods table, below. |
isEmpty |
Returns True if the node list empty.
|
Boolean | None | node.properties.PLN.UDA (Account).IsEmpty returns
True if the value of the PLN.UDA (Account) string list is empty.
|
isNull |
Returns True if the node list null.
|
Boolean | None | node.properties.PLN.UDA (Account).IsNull returns
True if the value of the PLN.UDA (Account) string list is null.
|
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. |
Node
Note: The type of node that is returned is based on the type of collection that you are performing the method on. |
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. |
Node
Note: The type of node that is returned is based on the type of collection that you are performing the method on. |
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. | Node List
Note: The type of node list that is returned is based on the type of collection that you are performing the method on. |
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.
Tip: The
|
Integer | 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. |
List of Float Values | 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. |
List of Integer Values | 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. |
List of String Values | None | return
node.ancestors.toStringList(ancestorNode.name).join("|")
returns a string list of ancestors for a node separated by
"|".
|
The following attributes and methods are available for the predicate node when using
any, count, filter, or
find.
Table 25-8 Predicate Node Attributes and Methods
| Attribute or Method | Description |
|---|---|
compareTo |
Compare two node locations with these options:
|
dimension |
Node dimension |
hierarchySet |
Hierarchy set of a node in a viewpoint. |
name |
Node name |
nodeType |
Node type for a node |
properties |
Node properties |
The following attributes and methods are available for the returned node when using
find or get.
Table 25-9 Returned Node Attributes and Methods
| Attribute or Method | Description | Available For These Node Collections |
|---|---|---|
boundLocations |
In hierarchy set bound viewpoints, returns a list of locations for a node in the bound viewpoint. In node type bound or unbound viewpoints, returns node locations (the same result as when using Locations). |
|
compareTo |
Compare two node locations with these options:
|
all |
dimension |
Node dimension | all |
hierarchySet |
Hierarchy set of a node in a viewpoint. |
|
locations |
Node locations (can contain node instances). |
|
name |
Node name | all |
nextSibling |
Node sibling after a node in the hierarchy. If this is the last node,
then the NextSibling attribute returns
Null.
|
|
nodeType |
Node type for a node | all |
previousSibling |
Node sibling before a node in the hierarchy. If this is a first node
without a previous sibling, then the PreviousSibling
attribute returns Null |
|
properties |
Node properties | all |
siblings |
Sibling node objects for a node instance. |
|