Split Connector

Version 22.0.8473


Split Connector


The Split Connector splits a single XML file into multiple XML files.

Overview

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.

Connector Configuration

This section contains all of the configurable connector properties.

Settings Tab

Configuration

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.

Other Settings

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.

Miscellaneous

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.

Automation

Settings related to the automatic processing of files by the connector.

  • Send Whether messages arriving at the connector will automatically be processed.

Example

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:

/Items/Interchange/TransactionSet

The following two output files would result:

Output 1:

<Items>
  <Interchange>
    <Id>1</Id>
    <TransactionSet>
      <Data>value1</Data>
    </TransactionSet>
  </Interchange>
</Items>

Output 2:

<Items>
  <Interchange>
    <Id>1</Id>
    <TransactionSet>
      <Data>value2</Data>
    </TransactionSet>
  </Interchange>
</Items>

XPath Wildcards

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:

/Items/*

The following three output files would result:

Output 1:

<Items>
  <Group1>
    <Data>value1</Data>
  </Group1>
</Items>

Output 2:

<Items>
  <Group2>
    <Data>value2</Data>
  </Group2>
</Items>

Output 3:

<Items>
  <Group3>
    <Data>value3</Data>
  </Group3>
</Items>