Type Filter mediation primitive : Conditionally route a message based on the message type, by comparing the message against a list of user defined xpaths and types.
The Type Filter mediation primitive uses XPath expressions to allow you to direct messages down different paths of a flow, based on their type.
The Type Filter mediation primitive has one input terminal (in), one fail terminal (fail), and multiple output terminals, (one of which is the default terminal). The in terminal is wired to accept a message and the other terminals are wired to propagate a message.
Each of the output terminals, apart from the default terminal, is associated with an XPath expression and a type. The elements of the message identified by the XPath expressions are compared, in turn, with the associated type. The primitive always uses the first matching output terminal. The default terminal is used if the message meets none of the conditions.
If an exception occurs during the filtering, the fail terminal propagates the original message, together with any exception information.
Usage:
You can use the Type Filter mediation primitive to check that the inbound message has elements of a specific type. If the criterion is not met you can raise a fault using the Fail mediation primitive, or send an error response.
Type Filter Properties:
Filters :
A list of XPaths, types, and associated terminal names, that define the filtering performed by the mediation primitive.
Note: Order is significant in the list of expressions. Expressions are evaluated in the order they appear in the table.
XPath element :
An XPath 1.0 expression against which the message is tested. The expression is evaluated starting from the XPath expression /, which refers to the complete SMO.
Type :
The qualified type to be matched.
Terminal name :
The name of an output terminal. There is one terminal name for each pattern XPath type pair. The terminal name must be a valid connection endpoint, and it must not be fail or default. The default value is empty, which is invalid.
NOTE:
The Type Filter primitive matches on either the exact type of an element or its derived types. For example, if you try to match against xsd:int but the actual element is of type xsd:short, it will still match.