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” and open the definition in designer mode.
- Drag an “UpdateVariables” and "xmlCompare" step to the canvas
- Connect the dots between the “Start” and other steps, as shown above.
- Define a variable or a global to store the XML data for comparison.
- Define a variable or a global to store the comparison result (for both new and removed).
- Click the "UpdateVariables" step to configure its “Required” properties. Provide a name for the step. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

- 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 the "xmlCompare" step to configure its “Required” properties. Provide a name for the step. Provide the variable or global reference for XML1 and XML2. Provide the variable or global reference to store new items in XML1. Provide the variable or global reference to store removed items in XML2. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

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

- 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 then execute it. The process step should compare two XML data sets, return new items in the first, and remove items from the second. 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 comparison (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 comparison (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 them (drag-and-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.