Tree (dw::util::Tree)

This utility module provides functions for handling values as tree-data structures.

To use this module, you must import it to your DataWeave code, for example, by adding the line import * from dw::util::Tree to the header of your DataWeave script.

Introduced in DataWeave version 2.2.2.

Functions

Name Description

asExpressionString

Transforms a Path value into a string representation of the path.

filterArrayLeafs

Applies a filtering expression to leaf or Path values of an array.

filterObjectLeafs

Applies a filtering expression to leaf or Path values of keys in an object.

filterTree

Filters the value or path of nodes in an input based on a specified criteria.

isArrayType

Returns true if the provided Path value is an ARRAY_TYPE expression.

isAttributeType

Returns true if the provided Path value is an ATTRIBUTE_TYPE expression.

isObjectType

Returns true if the provided Path value is an OBJECT_TYPE expression.

mapLeafValues

Maps the terminal (leaf) nodes in the tree.

nodeExists

Returns true if any node in a given tree validates against the specified criteria.

Variables

Types

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub