Header Match Connector [Deprecated]

Version 23.4.8841


Header Match Connector [Deprecated]


The Header Match Connector adds a decision shape to the flow, capable of sending a file to one of two defined connectors based on headers within the file.

Overview

A Header Match Connector functions as a fork in the flow. Files are sent along different paths in the flow depending on whether a specified header within the file matches a defined value. Files that match are sent along the solid blue flow path, and files that do not match are sent along the dotted gray flow path.

For headers already present in the file, simply configure the connector to check the desired Header Name and compare the header value with a specified Value. In addition, custom headers can be added to a file via ArcScript to facilitate dynamic routing based on custom data.

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, unique identifier for the connector.
  • Connector Type Displays the connector name and a description of what it does.
  • Connector Description An optional field to provide a free-form description of the connector and its role in the flow.
  • Type The data type of the header that will be used to match files. Support data types are Strings, Numbers, and DateTime formats.
  • Header Name The name of the header that will be used to match files. If a header with this name is found in the input file, the value of that header will be compared to the Value setting.
  • Operator The logical operator that should be used to compare the header value in the input file and the Value setting.
  • Value Header values parsed from input documents will be compared with this setting. The type of comparison depends on the Operator setting.

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 helps keep logs organized and improves performance.
  • Log Messages Whether the log entry for a processed file includes 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

Miscellaneous settings are for specific use cases.

  • Other Settings Enables you to configure hidden connector settings in a semicolon-separated list (for example, setting1=value1;setting2=value2). Normal connector use cases and functionality should not require the 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.

Custom Headers

ArcScript supports adding custom headers to files via two methods:

  • The portSetMessageHeader scripting operation
  • The Header:* output attribute of Script Connectors

portSetMessageHeader

The portSetMessageHeader operation should be used within the Event Scripts of a connector (when setting a custom header in a dedicated Script Connector, the Header output attribute should be used instead, as described in the next section).

For example, the following ArcScript can be placed in the After Receive event of any connector prior to the Header Match Connector in the flow:

<arc:set attr="Header:custom_header" value="myvalue" />
<arc:call op="portSetMessageHeader" />

ArcScript can also be used to determine custom header values dynamically, and then this dynamic value can be added as a custom header using the operation above. As a simple example, a file may need to be routed according to a special character within the file, which can be read using the fileReadLine operation. The following ArcScript looks for a special character at the start of the second line of a file, and adds this as a custom header:

<arc:set attr="special_character" value="default_value" />

<arc:set attr="file" value="[FilePath]" />
<arc:call op="fileReadLine">
  <arc:if exp="[file:line | equals(2)]">
    <arc:set attr="special_character" value="[file:data | substring(0,1)]" />
  </arc:if>
</arc:call>

<arc:set attr="Header:custom_header" value="[special_character]" />
<arc:call op="portSetMessageHeader" />

After running the above script on a file, the Header Match Connector can route files along different flow paths according to the special character.

Header Output Attributes

When adding a custom header within a dedicated Script Connector (rather than in the Event Scripts of another connector), the portSetMessageHeader operation is not required. Instead, the headers of the output message can be set directly via the Header:* output attributes, as described below.

The arc:push keyword is used to push output messages (files) from a Script Connector. By default, the two required parameters for arc:push are FileName and Data, like the following example:

<arc:set attr="outputItem.FileName" value="myOutputFile.txt" />
<arc:set attr="outputItem.Data" value="Some file contents" />
<arc:push item="outputItem" />

Header:* output attributes are an optional addition to FileName and Data which are used to specify custom headers for the output message. Any attribute set on the output item (i.e. the item that is ‘pushed’) that has the “Header:” prefix will be treated as a header value.

For example, the following ArcScript adds a single custom header with the name “myHeader” and the value “5” to the output message:

<arc:set attr="outputItem.FileName" value="myOutputFile.txt" />
<arc:set attr="outputItem.Data" value="Some file contents" />
<arc:set attr="outputItem.Header:myHeader" value="5" />
<arc:push item="outputItem" />

The same principle can be extended to set an arbitrary number of custom headers, e.g.: outputItem.Header:myHeader1, outputItem.Header:myHeader2, etc.