-
Notifications
You must be signed in to change notification settings - Fork 82
content router
Icon |
|
---|---|
Use When |
Content within a message needs to be routed to different downstream components in the existing flow |
Samples |
Partition By Gender |
Description |
The content router routes content within a message to one or more downstream components based on the routing criteria configured in the component. |
Inbound Message Type |
Any Message Type |
Output Message Type |
Any Message Type |
Control Message Handling |
Input: With all messages received by this component including control messages the routing criteria is checked and if it validates then the message will be forwarded to the target including control messages. Output: A control message will be forwarded only to target components where a message was routed based on the routing criteria unless the 'Send Control Message To All Nodes' property is checked (see below). |
Name | Description |
---|---|
Whether to forward failed messages and continue processing. This is the name of a linked component to forward the failed messages to. |
|
Send Control Messages To All Nodes |
Whether a control message is forwarded to all nodes regardless of the results from the routing criteria. |
Only Route First Match |
If checked, the content router will only route an inbound content to the first criteria in the criteria list that evaluates to true, not all criteria in the list that evaluate to true. |
A groovy script expression that returns true or false. The groovy script is executed/evaluated for each record in an inbound message. If the expression evaluates to true, the message is passed to the step at the right. If the expression is evaluates to false, the message is NOT passed to the step at the right.
The target step is the connected downstream component that will receive the message if the groovy expression evaluates to true.
Tip
|
The inbound message will go to ALL target steps where the expression evaluates to true (i.e. a message can go to more than one target step) unless the "Only Route First Match" option is checked. |
if (ENTITY.ATTRIBUTE=='Value 1') return true; if (ENTITY.ATTRIBUTE=='Value 2') return true;
Tip
|
If an entity based message has multiple entities within a single record, the record will be treated as a whole, not as its individual entities within the record. This means that the entire record (including all of its entities) will be delivered to a downstream component if the groovy expression evaluates to true, and NONE Of the entities will be delivered to the downstream component if the expression evaluates to false. For example, if the Person model contains entities NAME and ADDRESS, and the groovy expression is something like "NAME.FIRST_NAME='TOM'", a record with NAME.FIRST_NAME='TOM' will send both the NAME and ADDRESS entities to the downstream component. A record with NAME.FIRST_NAME='BOB' will send NEITHER the NAME nor ADDRESS entities of the record to the downstream component. |
if (text.indexOf("Some text string") > 0) return true; if (text.indexOf("Some other text string") > 0) return true;
Example 3. Sample groovy expressions for routing based on a message header. This example tests to see if the header variable is available before testing it
binding.variables.containsKey('chainId') && chainId.equals('001')