Condition for two headers in XCBR

Posted by Admin on 06-Apr-2010 05:49

Hi,

In my project scenario I need to check values from 2 header at a time in XCBR.

Based on xpath evaluation of 2 headers I need to route the message to other service

is there any way to check values of 2 header at a time in XCBR and route message?

Thanks,

Yashwant

All Replies

Posted by nweddle on 06-Apr-2010 13:49

Hello,

If I understand your question correctly, you may want to append two values together and check the appended value.

concat(string(/some/xpath/header1), string(/some/xpath/header2)) = 'header1valheader2val'

if the xpath values are equal to the hardcoded string, route to your service.

HTH,

Nathan  

Posted by Bill Wood on 11-Apr-2010 06:38

The trick to the above is that you want to select the whole message as the source and not a single part or header.

See the Help for Workbench under:

(Online at http://communities.progress.com/infocenter/index.jsp?topic=/com.sonicsw.tools.xcbr.doc/rules_condition.html).

You want to choose the "Message" radio button in the following

You can then access this with XPath (as in the previous reply) and concat or create any XPath on multple headers, as in:

/message/headers/header [@name="myHeader"]="bar"

This thread is closed