![]() |
![]() |
filter [type] [name | expression] type := filter implementation (xpath, regex) name := named configuration which contains the filter details expression := inline filter configuration
Xpath filter with inline configuration
ftp "foo"
jruby "verify-address"
route do
from "foo"
filter xpath ("//orders/order")
to "verify-address"
end
Xpath filter with external configuration
ftp "foo"
jruby "verify-address"
route do
from "foo"
filter xpath "ordersOnlyConfig"
to "verify-address"
end
$ cat ordersOnlyConfig/flow.properties exp=//orders/order
In both the examples above only those messages which match the xpath expression will be allowed to continue.
The directory layout for generated configuration is:
app-root/
filter/
{name}/
flow.properties
Where '{name}' is the named of the configuration, if the user has specified a named configuration, then name is the external configuration name. If the configuration is inline, after the generate and build step it is externalized and packaged in the configuration file "flow.properties", the name in this case is a system generated name, which is never exposed to the developer. As far as the developer is concerned in his/her view the configuration is always inline.
<orders>
<order>
<item>bang001</item>
<desc>guns</desc>
<amount>50</amount>
</order>
<order>
<item>parkayXYZ</item>
<desc>butter</desc>
<amount>100</amount>
</order>
</orders>
XPath Configuration
//orders/orderOutput Message
<orders>
<order>
<item>bang001</item>
<desc>guns</desc>
<amount>50</amount>
</order>
<order>
<item>parkayXYZ</item>
<desc>butter</desc>
<amount>100</amount>
</order>
</orders>
ORDER|PO123 ITEM|bang001|guns|50 ITEM|parkayXYZ|butter|200 ORDER|PO456 ITEM|oopsABC|huggies|300Regex Configuration
"ORDER"Output Message
ORDER|PO123 ITEM|bang001|guns|50 ITEM|parkayXYZ|butter|200 ORDER|PO456 ITEM|oopsABC|huggies|300
| Property | Description | |
|---|---|---|
| me.property | Returns the value of the named property in a MessageExchange, if it exists | |
| me.operation | Returns the value of MessageExchange.getOperation() | |
| me.interface | Returns the value of MessageExchange.getInterfaceName() | |
| nm,property | Returns the value of the named property in a NormalizedMessage, if it exists | |
| nm.attachment | Return the value of DataContentHandler.getContentType() for the named attachment, if it exists |