The Batch / De-batch filter can be used to combine separate messages into a single file or to separate a batched file into its components.

To define the size of the batch message created, the message collection properties of the filter are used. Refer to Message Collector for details on message collection.

Configuration Properties

Property

Description

Mode

Determines the mode of the filter:

  • De-batch (default) - a file is split into separate messages.
  • Batch - messages are combined into a single file.

Header

Identifies the string that appears at the beginning of the batched file. Can include special formatting sequences. Refer to Formatting Sequences for details.

Available only in Batch mode.

Separator

Identifies the string that separates messages within the batched file. Can include special formatting sequences. Refer to Formatting Sequences for details.

Available only in Batch mode.

Trailer

Identifies the string that appears at the end of the batched file. Can include special formatting sequences. Refer to Formatting Sequences for details.

Available only in Batch mode.

Batch Header Expression

Identifies the string that appears at the beginning of the file to be de-batched. Cannot end with a pipe ("|"). This is not a text field, but a regular expression field supporting GNU Regular Expressions with the Posix Extended flag.

Available only in De-batch mode.

Batch Trailer Expression

Identifies the string that appears at the end of the file to be de-batched.

Available only in De-batch mode.

Separator Type

Identifies whether messages in the file to be de-batched are separated by a marker or a separator:

  • Separates Message (default) - a separator identifies the string found between messages and does not appear in the de‑batched message bodies. A message separator is not part of the message.
  • Marks Start of Message - a marker is part of the message and identifies the string found at the beginning of each message.

Available only in De-batch mode.

Message Separator Expression

The regular expression that identifies the message separator. This string is a POSIX (Portable Operating System Interface) regular expression. Refer to IEEE's Portable Application Standards Committee for details.

Messages to be de-batched are treated as a byte stream. Therefore ensure you use the appropriate regular expression when Separator Type is set to marker. For example, if you want to de-batch on all instances of "MSH|", you should enter MSH\| (or MSH\|\^~ to guarantee de-batching occurs only on instances of "MSH|^~" at the beginning of messages using standard separators). Entering MSH| is not permitted as it configures the filter to de-batch on every individual character (as well as every occurrence of "MSH").

Available only in De-batch mode.

Set Identifier Property Specifies the property name that each message uses to identify the batched message that it belongs to.

Index Base

Determines the index base used to batch the message set. Selecting a zero-based index (Zero) sets the index to start at 0 and increase monotonically. Selecting a one-based index (One) sets the index to start at 1 and increase monotonically.

  • Zero (default)
  • One 

Formatting Sequences

The character sequences described in the following table can be used in the HeaderSeparator, and Trailer configuration properties to control the output in a created batch of messages for the respective part.

Character Sequence

Description

\n

New line.

\r

Carriage return.

\xdd

Character with code given by hexadecimal 2-digit number (d - hex digit).

\

Backslash (\) character.

%n

Current message number (starting from 0) in the batch of messages when used in the Separator configuration property. It is always -1 when used in context of Header or Trailer properties.

%c

Total number of messages in the batch.

%t[datetimefmt]

Formats current date-time using formatting string given. The following formatting characters are allowed:

  • y - year
  • M - month
  • d - day
  • h or H - hour (12hr or 24hr)
  • m - minute
  • s - second

Refer to the documentation for the Java class SimpleDateFormat for the full date-time format.

%%

Percent (%) character

$$

Dollar ($) character

Published Properties

Published properties for the Batch / De-batch filter are:

  • TotalNumberOfBatchedMessages - the total number of messages that are included in the batched message.
  • BatchIndex - the index of this message within the batched message. The filter's Index Base configuration property determines whether the index is zero-based or one-based.
  • <Set Identifier Property> - the unique identifier identifying the batched message that this message belongs to. The property name is user-specified through the filter's Set Identifier Property configuration property.

These properties are only populated when De-batch mode has been selected.