[jboss-dev-forums] [Design of JBoss ESB] - Enhancement to XPathLanguage.dsl

kurtstam do-not-reply at jboss.com
Sun Mar 8 16:46:17 EDT 2009


I noticed the new DslHelper, very nice Daniel. This inspired me to propose the following addition to the XPathLanguage.dsl

Add:

[then]SetAsString : "{key}", "{xpath}"=msg.getBody().add("{key}",org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.selectAsString(msg, "{xpath}") );

This will allow the user to write rules that can extract some fields from the XML and set them as named parameters on the Message.Body.

For example the rule:

  | when
  | 	    xpathGreaterThan "/price", "1.00"
  | 	then 
  | 		Log : "XPath Greater Then";
  | 		Destination : "XML_XPath_GreaterThan_Destination";
  |                 SetAsString : "priceInDollars", "/price";
  | 

would add the named parameter "priceInDollars" to the ESBMessage with a value of "1.00"

I guess you can also consider adding SetAsNumber etc.

Cheers,

--Kurt

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4216024#4216024

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4216024



More information about the jboss-dev-forums mailing list