The Split Connector splits a single XML file into multiple XML files.
The Split Connector is configured with an xpath upon which input XML files should be split into multiple output XML files. This is useful when an XML file contains a ‘batch’ of data, for instance multiple orders, multiple line items, or multiple customer records. The Split Connector splits this ‘batched’ XML data into a separate XML file for each order/item/record.
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.
- XPath The path in the XML structure to the element upon which the split should occur. Each unique occurrence of the specified xpath will result in a unique output 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 By default, logs for transactions processed by the connector will be stored in the Logs subfolder for the connector. For connectors that process many transactions, it may be desirable to further divide the logs based on the datetime they were generated. When this setting is set to Daily, logs generated on the same day will be grouped in a subfolder;; when this setting is set to Weekly, logs generated in the same week will be grouped in a subfolder; and so on.
- 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.
- Send Whether messages arriving at the connector will automatically be processed.
Below is an example XML input file that contains multiple TransactionSet elements (i.e. it contains a ‘batch’ of transactions):
<Items> <Interchange> <Id>1</Id> <TransactionSet> <Data>value1</Data> </TransactionSet> <TransactionSet> <Data>value2</Data> </TransactionSet> </Interchange> </Items>
The Split Connector can split this input file into two separate output files, one for each TransactionSet element. To accomplish this, the XPath field should be set to the xpath to the TransactionSet element:
The following two output files would result:
<Items> <Interchange> <Id>1</Id> <TransactionSet> <Data>value1</Data> </TransactionSet> </Interchange> </Items>
<Items> <Interchange> <Id>1</Id> <TransactionSet> <Data>value2</Data> </TransactionSet> </Interchange> </Items>
THe XPath can include a wildcard character (*) to split on all elements at a given xpath. For example, the input XML may contain multiple groups of data that need to be split into separate files, however the groups of data have different element names:
<Items> <Group1> <Data>value1</Data> </Group1> <Group2> <Data>value2</Data> </Group2> <Group3> <Data>value3</Data> </Group3> </Items>
These groups can be split by setting the XPath to the following value:
The following three output files would result:
<Items> <Group1> <Data>value1</Data> </Group1> </Items>
<Items> <Group2> <Data>value2</Data> </Group2> </Items>
<Items> <Group3> <Data>value3</Data> </Group3> </Items>