xmlCompare Step

Use this step to compare two XML data set.

Last published at: March 18th, 2025

Description:

This step compares two XML data sets, returning new items present in one data set and removing items from the second. 

 

Helpjuice Info Callout Title

  • XML1 - Xml data set 1
  • XML2 - Xml data set 2
  • columnList - List of columns to compare
  • varGlobalXML1NewItems - Variable/Global to store XML1 new items
  • varGlobalXML2RemovedItems - Variable/Global to store XML2 removed items
 

 

Helpjuice Success Callout Title

  • True – step executed successfully
  • False – step failed to execute
 

 

Usage:

 

 

Example:

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

  • Create a new definition called “xmlCompareDef”
  • Select the definition and click the “design” button
  • Drag an “UpdateVariables” and "xmlCompare" step to the canvas
  • Connect the dots between the Start, “UpdateVariables” and "xmlCompare" step
  • Define variables/globals to store XML data to compare
  • Define variables/globals to store the comparison result (for both new and removed)
  • Click the "UpdateVariables" step to configure its “Required” properties. Provide a name to the step. 

 

  • Click the "UpdateVariables" step to configure its “Optional” properties. Click the button to define multiple variables and their values. Click the Add Row (+) button to insert an empty row. Provide a variable name and XML value as below. Click the Save button. You may insert multiple variables by using the Add Row button. 

 

  • The XML data used for variables.varXML1 (for reference)
<SQLData>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>20</PROCUREMENTTYPEID>
    <ROWNO>1</ROWNO>
    <PROCESSID>eef9a64e-c2bb-4f4f-99df-a5201d841e42</PROCESSID>
    <RowID>0</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>24</PROCUREMENTTYPEID>
    <ROWNO>1</ROWNO>
    <PROCESSID>a3784005-c8d6-43f1-b5bc-05583b9ea617</PROCESSID>
    <RowID>1</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>36</PROCUREMENTTYPEID>
    <ROWNO>1</ROWNO>
    <PROCESSID>617b40af-2a9b-4ae0-8356-73410d2fb22c</PROCESSID>
    <RowID>2</RowID>
  </Row>
</SQLData>

 

  • The XML data used for variables.varXML2 (for reference)
<SQLData>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>20</PROCUREMENTTYPEID>
    <ROWNO>1</ROWNO>
    <RowID>0</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>20</PROCUREMENTTYPEID>
    <ROWNO>2</ROWNO>
    <RowID>1</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>24</PROCUREMENTTYPEID>
    <ROWNO>1</ROWNO>
    <RowID>2</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>24</PROCUREMENTTYPEID>
    <ROWNO>2</ROWNO>
    <RowID>3</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>36</PROCUREMENTTYPEID>
    <ROWNO>1</ROWNO>
    <RowID>4</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>36</PROCUREMENTTYPEID>
    <ROWNO>2</ROWNO>
    <RowID>5</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>38</PROCUREMENTTYPEID>
    <ROWNO>1</ROWNO>
    <RowID>6</RowID>
  </Row>
</SQLData>

 

  • Click on the "xmlCompare" step to configure its “Required” properties. Provide a name to the step. Provide the variable/global reference for XML1 and XML2. Provide the variable/global reference to store XML1 new items. Provide the variable/global reference to store XML2 removed items. 

 

  • Click on the "xmlCompare" step to configure its “Optional” properties. Provide the shared column names (comma-separated) to be used for comparison.

 

  • 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.

 

  • Save the process definition, create a process instance, and execute. The process step should compare two XML data sets, return new items in one, and remove items from the second data set. Navigate to Administration - Run - Process Instance - select the process instance to render. Click the xmlCompare step to view the properties. Click the varGlobalXML1NewItems icon to view the new items after comparison. Click the varGlobalXML2RemovedItems to view the duplicate items removed after contrast.  

 

  • The XML result set for varGlobalXML1NewItems after compare (for reference)
<SQLData>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>24</PROCUREMENTTYPEID>
    <ROWNO>1</ROWNO>
    <PROCESSID>a3784005-c8d6-43f1-b5bc-05583b9ea617</PROCESSID>
    <RowID>0</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>36</PROCUREMENTTYPEID>
    <ROWNO>1</ROWNO>
    <PROCESSID>617b40af-2a9b-4ae0-8356-73410d2fb22c</PROCESSID>
    <RowID>1</RowID>
  </Row>
</SQLData>

 

  • The XML result set for varGlobalXML2RemovedItems after compare (for reference)
<SQLData>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>20</PROCUREMENTTYPEID>
    <ROWNO>2</ROWNO>
    <RowID>0</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>24</PROCUREMENTTYPEID>
    <ROWNO>1</ROWNO>
    <RowID>1</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>24</PROCUREMENTTYPEID>
    <ROWNO>2</ROWNO>
    <RowID>2</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>36</PROCUREMENTTYPEID>
    <ROWNO>1</ROWNO>
    <RowID>3</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>36</PROCUREMENTTYPEID>
    <ROWNO>2</ROWNO>
    <RowID>4</RowID>
  </Row>
  <Row>
    <PROJECTID>9268</PROJECTID>
    <PROCUREMENTTYPEID>38</PROCUREMENTTYPEID>
    <ROWNO>1</ROWNO>
    <RowID>5</RowID>
  </Row>
</SQLData>

 

 

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.