getXMLNode Step
Description:
This step fetches a value from the 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 variables/globals to store the XML Value and result after execution
- Click the "updateVariable" step to configure its "Settings" properties. Provide a name to the step.
- Click the "updateVariable" step to configure its "Advanced" properties. Provide a variable or global to hold the XML value. Select Yes for the “Has Expression” field.
- The “Logging” setting configuration is necessary for documentation and also measures the workflow progress and the percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.
- Click the "getXMLNode" step to configure its "Settings" properties. Provide a name for 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 a variable/global to store the collection index. Provide the variable/global that holds the XML value.
- Click 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 measures the workflow progress and the percent complete. This is achieved 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 in this example is included 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 details of the XML node value and store them in the output variable. Select the process instance to render
- Click on the GetXMLValue step to view the instance properties
Definition Sample:
You may download the sample definition(s) from the link here and later import it (drag-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.
NOTE: Please verify and complete the process steps for any missing configurations, such as file path references and database connections after import. Then, save the definition to confirm the changes.
Click here to download the sample file.