The Merge Connector merges multiple XML files into a unified XML file.
The Merge Connector is configured with a Repeat XPath setting that determines which data in the input XML is merged into the output file. The output file includes the data ‘inside’ the configured xpath (i.e. all children of the configured xpath) for each input XML file. Data before/above the configured xpath is taken from the first input XML file, and data after/below the configured xpath is taken from the last input XML file.
The Scheduled Send automation setting instructs the connector to wait for a specified interval and merge all XML input files in the Input/Send Folder when that interval elapses. The standard Send automation setting instructs the connector to automatically process input files; files that should be merged together must be placed in a shared subfolder within the Input/Send Folder.
This section contains all of the configurable connector properties.
Settings related to the core operation of the connector.
- Connector Id The static name of the connector. All connector-specific files are held in a folder by the same name within the Data Directory.
- Connector Description An optional field to provide free-form description of the connector and its role in the flow.
- Repeat XPath The path in the XML structure to the element where data should be merged. All data inside this xpath, for each input XML file, will be added to the output file. Data above/before this xpath will be taken from the first input XML file, and data after/below this xpath will be taken from the last input XML file.
Settings that determine the folder on disk that files will be processed from, and where they will be placed after processing.
- Input Folder (Send) The connector can process files placed in this folder. If Send Automation is enabled, the connector will automatically poll this location for files to process.
- Output Folder (Receive) After the connector finishes processing a file, the result will be placed in this folder. If the connector is connected to another connector in the flow, files will not remain here and will instead be passed along to the Input/Send folder for the connected connector.
- Processed Folder (Sent) After processing a file, the connector will place a copy of the processed file in this folder if Save to Sent Folder is enabled. This copy of the file will not be passed along to the next connector in the flow.
Settings not included in the previous categories.
- Log Subfolder Scheme Instructs the connector to group files in the Logs folder according to the selected interval. For example, the Weekly option instructs the connector to create a new subfolder each week and store all logs for the week in that folder. The blank setting tells the connector to save all logs directly in the Logs folder. For connectors that process many transactions, using subfolders can help keep logs organized and improve performance.
- Log Messages Whether the log entry for a processed file will include a copy of the file itself.
- Save to Sent Folder Whether files processed by the connector should be copied to the Sent folder for the connector.
Settings related to the automatic processing of files by the connector.
- Enable Automation Whether messages arriving at the connector will automatically be processed.
- Send If enabled, the Merge Connector will automatically process files arriving in the Send Folder without waiting for files to accumulate.
- Scheduled Send If enabled, a Send Interval should be specified to allow files to accumulate in the Send Folder; once the interval elapses, the connector will merge all accumulated input files.
Below is an example set of input XML files and the corresponding single output file.
This example will merge three XML files with similar structure:
<Items> <Interchange> <Id>1</Id> <TransactionSet> <Data>Transaction Data 1</Data> </TransactionSet> </Interchange> </Items>
<Items> <Interchange> <Id>2</Id> <TransactionSet> <Data>Transaction Data 2</Data> </TransactionSet> </Interchange> </Items>
<Items> <Interchange> <Id>3</Id> <TransactionSet> <Data>Transaction Data 3</Data> </TransactionSet> </Interchange> </Items>
In this example, the Repeat XPath field is set to ‘/Items/Interchange/TransactionSet’. The resulting output merges the data within the TransactionSet elements and takes the Id element from the first input file.
<Items> <Interchange> <Id>1</Id> <TransactionSet> <Data>Transaction Data 1</Data> </TransactionSet> <TransactionSet> <Data>Transaction Data 2</Data> </TransactionSet> <TransactionSet> <Data>Transaction Data 3</Data> </TransactionSet> </Interchange> </Items>