Returns a node from the xml

Last published at: May 2nd, 2023

Description:

Get a value from a selected xml node

Inputs

  • 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

Returns

  • 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
  • Select Update Variables step and configure the the following values for the properties as shown on the below graphic 
  • 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>
  • Select GetXMLValue step and configure the the following values for the properties as shown on the below graphic 
  • Click on Maps xml node values to variables and map the XML nodes to variables/globals.

  • Save the process definition, create necessary variable/globals, create a process instance and execute. 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