To provide greater flexibility when parsing and processing messages, Fuse Mediation Router supports language plug-ins for various scripting languages. For example, if an incoming message is formatted as XML, it is relatively easy to extract the contents of particular XML elements or attributes from the message using a language such as XPath. The Fuse Mediation Router implements script builder classes, which encapsulate the imported languages. Each language is accessed through a static method that takes a script expression as its argument, processes the current message using that script, and then returns an expression or a predicate.
Table 1.2 lists the elements that you can insert whenever the context demands an expression or a predicate. The content of the element must be a script written in the relevant language. At runtime, the return value of the script is read by the parent element.
Table 1.2. Elements for Expression and Predicate Languages
| Element | Language | Description |
|---|---|---|
simple | Simple | A simple expression language, native to Fuse Mediation Router. |
xpath | XPath | The XPath language, which is used to select element, attribute, and text nodes from XML documents (see http://www.w3schools.com/xpath/default.asp). The XPath expression is applied to the current message. |
xquery | XQuery | The XQuery language, which is an extension of XPath (see http://www.w3schools.com/xquery/default.asp). The XQuery expression is applied to the current message. |
sql | JoSQL | The JoSQL language, which is a language for extracting and manipulating data from collections of Java objects, using a SQL-like syntax (see http://josql.sourceforge.net/). |
ognl | OGNL | The OGNL (Object Graph Navigation Language) language (see http://www.ognl.org/). |
el | EL | The Unified Expression Language (EL), originally developed as part of the JSP standard (see http://juel.sourceforge.net/). |
groovy | Groovy | The Groovy scripting language (see http://groovy.codehaus.org/). |
javaScript | JavaScript | The JavaScript scripting language (see http://developer.mozilla.org/en/docs/JavaScript), also known as ECMAScript (see http://www.ecmascript.org/). |
php | PHP | The PHP scripting language (see http://www.php.net/). |
python | Python | The Python scripting language (see http://www.python.org/). |
ruby | Ruby | The Ruby scripting language (see http://www.ruby-lang.org/). |
mvel | MVEL | The MVEL expression language (see http://mvel.codehaus.org/). |
| <... language="beanshell"> | BeanShell | The BeanShell scripting language (see http://www.beanshell.org/). |
bean | Bean | Not really a language. The bean element is
actually a mechanism for integrating with Java beans. You use the
bean element to obtain an expression or predicate
by invoking a method on a Java bean. |
For more information on the expression languages see:
the links listed in Table 1.2








