You can use a wildcard in the component or the sub-component position of the HPath.
NOTE: The wildcard is only available in QIE 5.0.51 or greater.
For example, to get all of the components from the PID-2 field, we can do the following:
var components = message.getAllNodes('PID-2.*');
for (var i = 0; i < components.length; i++) {
qie.warn(components[i]);
}
The above script will output 4 log lines:
Log 1: 35707
Log 2: {blank}
Log 3: {blank}
Log 4: ASD
You can use a similar node path to get all of the sub-components, for this we will do the following:
var subComponents = message.getAllNodes('PID-3.1.*');
for (var i = 0; i < subComponents.length; i++) {
qie.warn(subComponents[i]);
}
This script will output 3 log lines:
Log 1: 661
Log 2: {blank}
Log 3: 47984-1510001
NOTE: You cannot use a wildcard for the component and include a sub-component identifier, PID-3.*.1, as this will throw an exception.