Returns a node from the xml

Use this step to fetch XML node value.

Last published at: July 14th, 2023

getXMLNode Step

Description:

Get a value from a selected xml node.

Returns

  • xPath expression to query the selection - xPath value
  • variable/global to store the value - node value 
  • node from the row to get the xml value from - node reference 
  • variable/global to store the collection index - loop value  
  • variable/global that holds the xml - XML value (and not the XML file path)
  • maps XML node values to variables - map XML node values to variable/global
 

 

Inputs

  • NextItem – returns this value if there are more items to return from the xml
  • NoMoreItems – returns this if there are no more values to return from the xml 
 

 

Usage:

Example:

Let’s build and execute the “getXMLValueDef” example.          

  • Create a new definition called “getXMLValueDef” 
  • Select the definition and click the “design” button
  • Drag the above steps from the toolbox and connect as shown above
  • Define a variables/globals to store the XML Value and result after execution
  • Click on the "updateVariable" step to configure its "Settings" properties. Provide a name to the step. 
  • Click on the "updateVariable" step to configure its "Advanced" properties. Provide a variable/global to hold the XML value. Select Yes for HasExpression field. 
  • The “Logging” setting configuration is necessary for documentation and also measure the workflow progress and the percent complete. This is acheived by configuring the step state and percent fields individually as shown in the images below. Configure the “Logging” using the following properties.
  • Click on the "getXMLNode" step to configure its "Settings" properties. Provide a name to the step. Provide the XPath expression to query the collection. Provide a variable/global to store the node value. Provide the node value from the row to get the value from. Provide variable/global to store the collection index. Provide the variable/global which holds the XML value. 
  • Click on the "getXMLNode" step to configure its "Advanced" properties. Click on the button to map XML node values to variables.  
  • The “Logging” setting configuration is necessary for documentation and also measure the workflow progress and the percent complete. This is acheived by configuring the step state and percent fields individually as shown in the images below. Configure the “Logging” using the following properties.
  • The XML value used here as shown below.
<root>
  <Book1>
    <MaterialID>123456789</MaterialID>
    <MaterialName>Roman Test</MaterialName>
    <Quantity>123.6</Quantity>
    <UoM>Kg</UoM>
    <Tolerance>2</Tolerance>
  </Book1>
  <Book1>
    <MaterialID>123456790</MaterialID>
    <MaterialName>Roman Test 2</MaterialName>
    <Quantity>133.6</Quantity>
    <UoM>Kg</UoM>
    <Tolerance>3</Tolerance>
  </Book1>
  <Book1>
    <MaterialID>123456791</MaterialID>
    <MaterialName>Roman Test</MaterialName>
    <Quantity>143.6</Quantity>
    <UoM>Kg</UoM>
    <Tolerance>4</Tolerance>
  </Book1>
  <Book1>
    <MaterialID>123456792</MaterialID>
    <MaterialName>Roman Test 3</MaterialName>
    <Quantity>153.6</Quantity>
    <UoM>Kg</UoM>
    <Tolerance>5</Tolerance>
  </Book1>
  <Book1>
    <MaterialID>123456793</MaterialID>
    <MaterialName>Roman Test</MaterialName>
    <Quantity>163.6</Quantity>
    <UoM>Kg</UoM>
    <Tolerance>6</Tolerance>
  </Book1>
</root>
  • Save the process definition, create a new process instance and execute. 
  • Render the process instance. Click on the process step. The step should get  XML node value details and store into the output variable.
  • Select the process instance to render 
  • Click on the GetXMLValue step to view the instance properties