Kavin's SOA Blog

April 29, 2009

Using functions in Routing Rules in ESB

Filed under: Development — Tags: , , , — Kavin @ 8:10 pm

Many of the times we get puzzled why the expression looks good but it won’t work in ESB expression. Also some of the functions are not available with expression builder at all. But the fact is that all these functions are available with ESB runtime engine and we should be able to use them in expressions. So for the functions which are visible through expression builder, we don’t need step 1 but for functions like dvm-lookup etc. which are not visible via expression builder we have to build that expressions.

So suppose we want to use dvm-lookup to do routing then we would need to perform following steps:

  • Create XPath Syntax

image

  • Copy expression from “Source” view

image

  • Paste expression in expression builder

image

  • Append the namespace using text editor. You can get namespace from same XSL file from where you copied XPATH expression.

image

image

Once you deploy you should be able to use lookup-dvm (or any other function) within routing rule.

In summary, XPath functions work within ESB routing rule, how you build that expression is totally upto you. As long as you put that xpath function with right namespace you should see results.

NOTE: Using DVM Lookup will affect portability of your code from OESB to OSB (a.ka. ALSB).

Theme: Shocking Blue Green. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.