Online documentation for DictionaryFilter

Generated 2006-03-17

Component allowing the specification of rules used to filter dictionary objects.

Description

Many components produce complex messages called dictionaries. Examples include RSSClient and EmailReceiver. This component can be used to filter such messages. For example, an email message might be filtered so that only emails from a certain person are accepted. Details of filtering are specified using a set of rules.

If you are interested in filtering emails, then you should look at EmailFilter, a version of this component that provides simple functionality to specify filters using safe lists and blocked lists.

Usage

If your filter is configured with a number of rules, then any dictionary/message placed onto property inputMessages will be filtered using these rules. Dictionaries that pass this filtering stage will be placed onto property acceptedMessages, and those that fail will be placed onto property rejectedMessages.

Configuration

Configuration using default rule types

This component is currently configured to support the specification of filters using the following types of rule: To configure the filter, you provide instances of these rule types to properties allRules and anyRules. For example, if you wanted a filter allowing any dictionary through which has a from field containing sre@cs.nott.ac.uk but not stefan_egglestone@hotmail.com, you would set allRules to {from contains sre@cs.nott.ac.uk,from doesn't contain stefan_egglestone@hotmail.com}

Configuration with user-defined rule types

Hopefully, the default rule types will be sufficient for the specification of most filters. But, they can be replaced, with other rule types using different keywords. Note that this is not an easy process to perform, requiring knowledge of regular expressions. If you want to do it, you'll need to modify the following properties:

In each of these properties, you should place an array of values, with each element in the array corresponding to one keyword that you are defining.