Top
Top
LibraryEASYProcess Reference Manual 5ProcessesServicesProcessFlowWorkshopSelectNodes

SelectNodes Overview

SelectNodes allows you to keep only a subset of a given Node (Ex: “WorkData/Inquire”). This subset is taken by passing in an XPath input. So, the filter is done by XSLT Predicates. Predicates are used to find a specific node or a node that contains a specific value and are always embedded in square brackets.

The service selects all nodes specified in the XPath input, removes all the previous input for the node given, and then returns the ones it was told to select with the XPath input and XSLT Predicate. There is evidence of this in the logs because usually a service’s Info node comes after the results. However, if I pass in an XPath without an XSLT Predicate, it will just remove all the output and re-add it all back. The only difference is the order. The service info node will not occur first and then the results after.

Note that this same functionality can be recreated in another service called EvaluateXML, but it will need to be used in conjunction with XSLT. If you are familiar with XSLT, EvaluateXML is a more powerful tool because it can be further customized for any further needs without having to add a new service.

There is also another service called SelectNode which also allows you to take a subset of the given Node, but the subset is specified using indexes to specify their position in the result list.


SelectNodes Use Examples
Workshop:ProcessFlowWorkshop
Service:SelectNodes
Inputs
XPathThis is the XPath with XSLT Predicate used to specify the subset of the given node. Example: WorkData/GetItems[LineType='C']

SelectNodes Use Examples

Basic Use Example

In this example we have a RunQuery named “RunQuery2” which returns 10 results. Our SelectNode is configured to find only the node with a specific DISPLAYMODELNUMBER property. We can see that before the SelectNodes ran, there were 10 results in the logs. Afterwards, one one result exist in the logs and it is the record with the matching property.

Also notice the SelectNodes service output also returns the number of records it has kept. In our example the output has a Count of 1 which is correct because we filtered to find only one displaymodelnumber.


Powered by EASYProcess (© 2019 K-Rise Systems, Inc).