cancel
Showing results for 
Search instead for 
Did you mean: 

Using XPath

Former Member
0 Kudos

Hi All,

This is a JDBC-Proxy(scenario). Based on a particular field content say "receiver". I need to use 2 different receivers. For example, if the value is "1" I need to send the message to first receiver and if the value is "2" I need to send the message to second receiver.

Can you tell me how I need to configure my interface to achieve this. Also, is it possible to have 2 different mappings one for the first receiver and another mapping for the second receiver?

Thanks in Advance.

Regards,

Jai Shankar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jai,

All you need to do for the same is,

Under Receiver Determination --> Configured Receivers --> Specify the 2 receivers and beside the same you have an option called condition, there you specify the condition on which it has to go to the first system and then the condition on which it has to go to the second system.

When you click on the codition it will open another window (Condition Editor window) under which you have a Left Operand which when you click will open up another window(Expression Editor window), there for your need you check on the XPath radio button and then click on the field whose value you wanna check from the structure that it displays, when you click on the field it fills in the XPath Expression, then click ok.

After that it takes you back to the previous window(Condition Editor window) with the Left Operand having the XPath Expression, so all you will have to do is to fill the Right Operand which is nothing but the value you want that field to contain.(For Example if a field "A" that you have selected which comes in the XPath Expression in ur Left Operand,has a value "1" in your Right Operand)

There you also have an option to put in an "and" or an "or" condition if required(For Example if you wanna check if "A" and "B" is satisfied or it you wanna check if "A" or "B" is satisfied, this can also be done)

If you have any doubts or clarifications on the same, please do ask and i will tell you how to proceed.

Regards,

Abhy

Message was edited by: Abhy Thomas

Former Member
0 Kudos

Hi Shabz and Abhy,

Thanks a lot. I am working on that and will get back to you, if I face with any problems. Can you pls answer my second question, my configuration depends on your answer. <i>is it possible to have 2 different mappings one for the first receiver and another mapping for the second receiver?</i>

Thanks and Regards,

Jai Shankar.

Shabarish_Nair
Active Contributor
0 Kudos

yes of course ...

u can handle it in your Int. det.

Chk /people/suraj.sr/blog/2006/01/05/multiple-inbound-interfaces-within-a-service

former_member91687
Active Contributor
0 Kudos

Hi,

Yes you can. Use the mappings w.r.t the receivers you want to in your Interface determination.

Regards,

Chandra

Former Member
0 Kudos

Thanks a lot Shabz. I l get back to you after configuring the interface.

Thanks & Regards,

Jai Shankar.

Former Member
0 Kudos

Hi Jai,

See when we give 2 receivers, we thereby also need two interface determinations.

In your Interface Determination, we specify the Interface Mapping. So incase you have the sane Mapping for both the receivers you can specify the same Interface Mapping for both receivers else if you want different mappings for different Receivers,you can give different Interface Mappings for each of the receivers...

Regards,

Abhy

Former Member
0 Kudos

Hi All,

Thanks a lot for the timely help.

Thanks & Regards,

Jai Shankar.

Former Member
0 Kudos

Hi All,

I have configured the interface mapping and message mapping, but I am having some problem with xpath, I have added 2 receivers in the configured receivers column. Also I could go to the expression editor and selected my colum and in the right hand opernad I have given the expected value.

Every thing is fine. But how do I specify, if the condition fails choose second receiver and choose first if the condition is true.

Thanks & Regards,

Jai Shankar.

Shabarish_Nair
Active Contributor
0 Kudos

if the condition fails choose second receiver and choose first if the condition is true

>>>

in XPATH conditions if a suitable condition is not true it checks for the next condition and only for the condition tht turns true your message will be sent.

bhavesh_kantilal
Active Contributor
0 Kudos

Jai,

<i>But how do I specify, if the condition fails choose second receiver and choose first if the condition is true.</i>

The 2 conditions will be independent of each other. In the sense, the receivers are choosen whenever the condition becomes true.

The simple way to do this would be to specify the valid condition for one of the receivers and for the other receiver give the opppsite of the previous condition. So, at any given time only one recever would be choosen.

http://www.w3schools.com/xpath/xpath_operators.asp

Regards,

Bhavesh

Former Member
0 Kudos

Shabz,

I am lost some where, For the 2 receivers I have added to in the configured receivers column, I can get only one xpath condition, I cant give one condition for each receiver. What am I doing wrong here?

Thanks & Regards,

Jai Shankar.

Shabarish_Nair
Active Contributor
0 Kudos

I can get only one xpath condition, I cant give one condition for each receiver

>> can u explain your conditons ?

did u have a look at the blogs ... i guess those explain how to give the conditions.

Former Member
0 Kudos

Hi All,

Thans for that. Abhy, I was doing exactly as you told. Now I can give different conditions for different receivers.

Thanks & Regards,

Jai Shankar.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jai,

You can do one thing,

for the first receiver you have specified the codition right... Now ur doubt is if the condition fails, how to check if the condition as failed...

Let's assume that u are checking a field "A" for value "1",now for the first receiver you have checked for A EQUAL 1 right...?

For second receiver check for the condition A NOTEQUAL 1, so this indirectly checks if you first condition has failed.

<b>The mistake ur doing to add a receiver (in Receiver Determination) is, ur clicking on the "+" symbol... Dont do that there is a symbol like "[]"(add new condition), use that and you can give 2 conditions, one for each receiver.This will solve your problem :-)</b>

Regards,

Abhy

Message was edited by: Abhy Thomas

bhavesh_kantilal
Active Contributor
0 Kudos

Jai,

You can give multiple conditions.

In the recievr deteramintion, under the condition, the last button allows you to add multiple conditions ~~ one for each receiver.

Regards,

Bhavesh

Shabarish_Nair
Active Contributor
0 Kudos

/people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers

/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

Those sud help you ... in case of any clarification do get back