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 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 for specific use cases.
- Other Settings Allows configuration of hidden connector settings in a semicolon-separated list, like
setting1=value1;setting2=value2. Normal connector use cases and functionality should not require use of these settings.
Settings related to the automatic processing of files by the connector.
- 送信 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>