XPath Route

The XPath Route task enables you to send messages to a specific destination based on conditions that you specify.

Data from the mediation exchange, such as the security information or message body, can be used to specify the conditions of the route.

XPath Route tasks can only be placed on input paths, but specifying an XPath Route task on the input path automatically creates the correct output and fault paths.

See Routing Messages in a Mediation Flow for more information about the XPath Route task.

General Tab

Use the General tab to specify a name and description for the task. This tab is useful for providing documentation for tasks in your mediation flows.

Field Description
Name Assign a name to the task, to identify the task in the mediation flow. This name appears in the tooltip that opens when you hover the cursor over the task icon in the mediation flow.
Description Describe the task briefly. This description appears in the tooltip that opens when you hover the cursor over the task icon in the mediation flow.

Decision Tab

Use the Decision tab to create routing cases, routing conditions, and variables to hold data that will be evaluated in the routing conditions. The Decision tab includes a toolbar for adding and deleting cases and conditions

Toolbar Icon Description

Add Case

Adds a routing case to the table on this tab. A new case appears in the table on this tab with a default name, and the case is drawn in the mediation flow diagram. By default, new cases created with this icon point to an error icon until a Target Service/Operation is specified for the case.

Delete Case

Deletes the selected routing case.

Add Variable

Adds a variable to use in routing conditions. Clicking this icon opens a dialog that enables you to specify the name and data type of the variable:
  • String
  • Integer
  • Boolean
  • Float
  • Double
  • Decimal

Each variable appears as a column between the Case column and the Target Service/Operation column.

Delete Variable

Opens a dialog for you to select the variable to delete.

The Decision tab includes a table containing all of the routing cases.

Column Description
Case Name of the routing case. Click the cell to edit the name.

Variable Names

(routing condition)

The name of each variable that you create appears in at the top of the middle column of the table. The middle column is used to specify the XPath expression for the routing condition for each case. Your expressions are not limited to simple comparisons, and you do not need to use any of the variables you have defined in the expressions.

You must type the XPath expression in the condition field next to each routing case, or select the field and use the Xpath Editor field at the bottom of the tab to edit the expression.

Variables are referenced in the XPath expressions for each routing case by their names. Unlike XPath expressions in the Transform task, you do not need to use a dollar sign to specify the root of the path to the variable. For example, the expression to determine if the city variable is equal to "Palo Alto" would be: city = "Palo Alto"

The Transform task has a graphical XPath editor that you can use as a reference for creating XPath functions for the route task. See Using XPath on page 107 and Data/Function Tabs on page 91 for more information about XPath.

Target Service/Operation The name of the Target Service and target operation that is the destination for this case. If you drag the path for the case to a target operation in the mediation flow, this field is set automatically to the correct value. You can also click this field to either type or select the target operation.

At the bottom of the table is the configuration for the Otherwise case for the route. The Otherwise case is taken when all other cases evaluate to false. Use the Target Service Operation field to specify the target operation to perform for this case.

You can use the XPath editor window at the bottom of the Decision tab to edit the XPath expressions for each routing condition.

Input Tab

Use the Input tab to map data from the mediation exchange into the list of variables that you have created for the XPath Route task. See Transform Tasks for a description of how to use a mapping panel.