About the RegexFilterNode sample

This sample demonstrates how a JavaCompute node can be used as a filter node, and the use of user-defined attributes.

The node has two user-defined attributes: filterField and filterRegex. The node extracts the element value of the first field in the message with the name held by the attribute filterField. If the value matches the regular expression held by the attribute filterRegex, the message is propagated to the out terminal, otherwise it is propagated to the alternate terminal.

This sample covers the following steps:

  1. Extracts the field value that is used for matching, using XPath expressions.
  2. Creates the matcher from the regular expression and the field value.
  3. If the field value matches the regular expression, propagates the message to out terminal of the JavaCompute node.
  4. If the field value does not match the regular expression, propagates the message to alternate terminal of the JavaCompute node.

The following MQ queues are created by the sample:

The following message flow, RegexFilterNodeFlow, is imported by the sample:

RegexFilterNodeFlow

Main Page iconBack to About the JavaCompute Node sample