Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Conditional Router Mediator (New in version 4.0) can be used to specify the routing of the message according to given conditions. This mediator checks whether the "Condition" evaluates to true and mediates using the target sequence. A matching route will break the router if the "Break after route" is set to true.

...

Table of Contents
maxLevel3
minLevel3
locationtop
styleborder:1

...

typeflat
separatorpipe

...

Syntax

Code Block
XML
XML

<conditionalRouter continueAfter="(true|false)">
    <route breakRoute="(true|false)">
      <condition ../>
      <target ../>
    </route>+
</conditionalRouter>

...

1. The user can define any number of routes. Each and every route must contain a "condition" which is to be evaluated and a predefined "Target" sequence, which will be used to mediate further. To add a route, click on the "Add Route" link.

2. Specify the following option options of the RouteRouter:

Parameter NameDescription
Continue after routing

...

This parameter specifies whether the mediation flow should/should not continue after executing the conditional router mediator. Possible values are as follows.

  • Yes: If this is selected, mediation continues to execute (any other mediators specified) after the conditiional router mediator.
  • No: If this is selected, mediation discontinues after executing the conditiional router mediator. This is the default value.
Break after route

You can specify this for each conditional route of the conditional route mediator. It specifies whether the router should/should not continue after executing the specified conditional route.

  • True: If this is selected, a matching route would break the router, so that it does not continue to execute the next conditional route.
  • False: If this is selected, the router continues to execute the next conditional route defined in the conditional router mediator.
Evaluator ExpressionRoute condition. For example, you can specify that a message is routed based on the its header (provides better performance) or its content (provides more fine-grained searching). 
Target Sequence

A target sequence needs to be provided as registry key/local entry to do further mediation processing.

Excerpt
hiddentrue

description of the Conditional Router Mediator in WSO2 ESB.