cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Routing in XI

Former Member
0 Kudos

Hi ,

I have a scenario where I need to send a data from a Source A to Target B.

In XI I need to validate the header information of the incoming data. In header information is correct i need to map the data and send it to target B. But if header

information in not correct I need to send a error message back to source System A.

what will be step in Design and Configuration stages especially during colloboration profile setting.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

done ..

Former Member
0 Kudos

Hi Ranjeet,

if you are on SP19, then you can avoid BPM for your this scenario.........

But if you dont have SP19, then you will need BPM for your this scenario because in msg mapping, you will have one source msg and two target msgs - one target msg for system B and other target msg for system A if your header data is not correct........so based on your header data, either of the two msgs will be created....so you require BPM for this thing........you will have 3 data types - source msg, error msg and target msg..........then in BPM in send steps you will send your error msg to system A and target msg to system B......

Thanks,

Rajeev Gupta

henrique_pinto
Active Contributor
0 Kudos

> if you are on SP19, then you can avoid BPM for your

> this scenario.........

>

> But if you dont have SP19, then you will need BPM for

> your this scenario

Does he?

I mean, from his requirements, I understood that the message eithers goes back to A as error or to B, if successfull. This can be acomplished with simple message mappings and enhanced receiver determination. Or if he wants to avoid enhanced receiver determination he can have an extra field in payload (or a custom dynamic configuration, with the help of this weblog: /people/michal.krawczyk2/blog/2006/10/09/xi-dynamic-configuration-in-adapter-modules--one-step-further) for receiver determination conditional routing.

Regards,

Henrique.

Former Member
0 Kudos

Hi All,

I found one interesting thing XI in Receiver Determination.. I am doing a conditional routing in XI based on target data ( after mapping has been performed).

But XPATH only contain source data not the target message type.

why is it so? how can i do routing based on the data which is getting after successful mapping.?

Shabarish_Nair
Active Contributor
0 Kudos

in case you want to base it on the target follow this blog - /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers

Former Member
0 Kudos

hi vijay,

problem is that target message is not getting populated in XPATH .I am able to select only source data in XPATH.

Once target message is availabe in XPATH routing is easy.

Shabarish_Nair
Active Contributor
0 Kudos

the trick is to involve the dummy BPM as shown in the blog !!!!

Former Member
0 Kudos

Hi Vijay,

do you mean that we cannot get target message in receiver determination xpath expression?

because we don't want to use BPM .

henrique_pinto
Active Contributor
0 Kudos

No you can't.

Logically, the Receiver Determination step comes before the Interface Determination step, where the mapping runtime occurs.

But since the information in target message is function of the information in the source message (target = f(source); mapping is nothing else more than a linear transformation over source message), you could use the same function in the receiver determination condition in order to get the same check on source message. If the function is simple, use XPath's functions; if it is more complicated, you could use it inside a mapping (UDF, java mapping etc) in an enhanced receiver determination.

Regards,

Henrique.

Former Member
0 Kudos

thanks for good reply ... i read the about receiver determination facility in XI...

as per the sap help documentation is a message interface ReceiverDetermination for determining receivers at runtime.

so what i can understand from this is that.. i need to develop another mapping ( other than two message mapping that i already have...one for success and one for error response) , where i need do mapping between source message type and receiverdetermination message , and depending on the result of validation of the source message i will populate the party,service in receiverdetermination ..

Is this flow correct? Is there any blog for the same.?

Former Member
0 Kudos

Hi Henrique,

I tried to implement the conditional routing using enhanced receiver determination .

I was able to do it successfully..

thanks for guidance.

Ranjeet,

henrique_pinto
Active Contributor
0 Kudos

> I tried to implement the conditional routing using

> enhanced receiver determination .

> I was able to do it successfully..

Im glad to hear that.

> so what i can understand from this is that.. i need

> to develop another mapping ( other than two message

> mapping that i already have...one for success and one

> for error response) , where i need do mapping between

> source message type and receiverdetermination message

> , and depending on the result of validation of the

> source message i will populate the party,service in

> receiverdetermination ..

Exactly, if you do want to make the condition check on the target information.

See, since mapping is a linear transformation and the check you'd perform on target message is also one, you could do the check on source message.

target = f(source) (mapping)

g(target) = y (your check)

You could simply do the check like

g(f(source)) = y, and that's the indea behind enhanced receiver determination.

But you could use similar logic and do it like this:

source = f^-1(target)

g^-1(y) = target

where ^-1 means inverse function.

Hence, you'd have

source = f-1(g-1(y))

Since y is a constant (used in your check), this means that you could perform another similar check on the source message and get the same result as well.

Your condition check could be just like

source = y'

where y' = f-1(g-1(y)) (of course, if f and g functions are invertible).

> Is this flow correct? Is there any blog for the same.?

Now that you have successfully implemented the scenario, if there aren't any blogs on that (I don't know whether there are any or not, you'd have to check on that) you could write your own.

Regards,

Henrique.

Former Member
0 Kudos

Please give condition in Receiver determination using expression editor.

Apply check on the value in the particular field and route it towards B.

If the validation fails route the message to A.

Thanks

Amitanshu

Please reward points if the answer is helpful

Shabarish_Nair
Active Contributor
0 Kudos

you can utilize XPATH for conditional routing;

Receiver Det- Xpath:

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

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

XPATH in Interfce Det:

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

Former Member
0 Kudos

Hi ,

blog has used BPM.. i am not using BPM...

how many data i need to declared..

what would be ID setting..

Former Member
0 Kudos

please reply early...

Former Member
0 Kudos

hey

have a look at the following to see how to do conditional receiver det.without BPM

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/336365d3-0401-0010-9884-a651295a...

it uses a diff. scenario but u can have a look at the conditional recv. detm. part

thanx

ahmad

Former Member
0 Kudos

hey

u can make use of conditional receiver determination for this.

thanx

ahmad