The Content Router component is able to route messages from an inbound connector to other components based on their content.
The Content Router component has the following configuration options:
|Namespace used in the XML message|
A Content Router component can also have one or more rules. A rule consists of two input fields:
|Name to identify the filter when connecting to another component|
|The language of the expression. Expressions can be defined using the Simple Expression Language, which also supports File Expression Language, or XPath 2.0|
|XPath 2.0 expression or Simple Expression Language that acts as a filter.|
- You will always have an
otherwiserule. The otherwise rule will not appear on the properties view. The otherwise rule acts as a bin for the remainder of the messages that do not satisfy the expression rules you defined.
Rule namemay not contain capital letters
Rule namemay not be the word otherwise as it is already taken
Rule namemay not contain spaces
Rule namemust be unique
- Each expression can only be used once to connect to another component
- The expressions are compared with the exchange one after another. When the exchange matches an expression, the exchange will be sent to the component that is connected to it. The exchange will not be compared with other expressions and will just go on in the flow.
The most simple configuration of a Content Router component will consist of just one single expression.
You can also set the namespace used in a XML message. If you don't specify the namespace, your XPath expression will not recognise anything. For example, you have the following message with a namespace:
<INBOUND_ORDER xmlns="urn:ifsworld-com:schemas:handle_inbound_order"> <DELIVERY_LEADTIME>1.0</DELIVERY_LEADTIME> <DELNOTE_DATE>2013-05-17T09:07:58</DELNOTE_DATE> </INBOUND_ORDER>
In this case, you need to specify the namespace property with:
You would then prepend your XPath expression with
The namespace abbreviation will always be
ns. You are able to specify multiple Content Routers with different namespaces in the same Flow.
Designing with Content Router components
After adding a content router component and configuring it's rules, you can connect other components to the outbound connector of the content router component.
When you do so, you will be prompted to which rule you want to connect the new component. After selecting a rule, you see the connection between the two components and the name of the rule used to route to the new component (as shown above).
You can only select each rule once for each component; when you try to connect another component using a rule that is already being used, no connection will be made.