Kourier Integrator Online Help

KMK.FILTER

Syntax

PROGRAM KMK.FILTER [DSN] [XML-PARSE-SUB "FILTERSUB"]

Description

KMK.FILTER is a Kourier command that can filter messages in a service command stack, and optionally reroute messages to a DSN other than the service target DSN.

Use the XML-PARSE-SUB to call a subroutine to reformat or otherwise process messages. The subroutine filtersub must be compiled and cataloged in the account, and must have the calling interface described in a Filter Subroutine.

If the filter subroutine returns an error, then no further processing of the message. The original message is left in the queue for the source DSN or the SYSTEM queue. Administrators must correct this type of error by:

When a DSN is specified in the command, the message rerouted to a target DSN. If XML-PARSE-SUB is specified, the message is sent after it has been processed by the filter subroutine filtersub. Rerouted messages then continue normal service processing and get sent to any subsequent service command or target DSN. Using this rerouting DSN allows inbound messages to be sent to multiple DSN's if desired.

Rerouted messages are dequeued to the DSN immediately before further service processing occurs. Normally Kourier only dequeues the service target DSN upon completion of service processing only after all service processing is complete. Dequeuing the rerouted messages immediately ensure that they get to the DSN, even if there isn't a service scheduled to send them.

If no source message is found, no routing or filtering occurs.

Qualifiers

DSN

A DSN to which to route the message, in addition to the normal target DSN.

XML-PARSE-SUB "FILTERSUB"

Call the filter subroutine filtersub to translate or otherwise process messages.

The subroutine filtersub must be compiled and cataloged in the account. It must also have the calling interface described in Filter Subroutine.

Scope of Use

This subroutine MUST be used in a Kourier service.

Example

These examples are Kourier service commands that can be specified in a Kourier service.

This example reroutes incoming messages to the DSN "MESSAGE_LOG" without any message parsing. This will log all messages processed by the service:

KMK.FILTER MESSAGE_LOG

This example reroutes incoming messages to the DSN "TO_TAX" after the message has been parsed and translated by the filter routine, FILTERTAX:

KMK.IMPORT TO_TAX XML-PARSE-SUB "FILTERTAX"

Related Topics: 

Kourier Service Commands

Kourier TCL Commands Overview

Kourier Command Keywords