cancel
Showing results for 
Search instead for 
Did you mean: 

how to use "larger than" in a context object condition

Former Member
0 Kudos

Hi

In a receiver determination I need to make a condition where one receiver is chosen if the size of the attached file in my mailsender communication channel is larger than 500 bytes and an other receiver is chosen, if the file is lager than 500 bytes.

As there is no context object for this attachment size my plan was to make a module where I write the attachment size to the context object "ProcessStep" and hence use this context object for my evaluation. BUT, all the context objects are of type string and thus it is not possible to use the "larger than" operand on that object. I then thought about just selecting the XPath radio button (in stead of the Context Object radio button) and entering this expression:

ns1:Main\ProcessStep < 500 EX

where ns1:http://sap.com/xi/XI/System

I haven't tested it yet, and I doubt that it will work.

What other options do I have?

Please note, that I am merely passing thru the attached flat file and thus have no message mapping.

I use PI 7.11.

BR MIkael

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Plz check last example in below blog.

[http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3774] [original link is broken] [original link is broken] [original link is broken];

-Gouri

Former Member
0 Kudos

Hi Mikael,

You can use XPath in receiver determination to route a message to different systems.

You can check the below links.They might be of some help.

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

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

Regards,

Rohit

Former Member
0 Kudos

HI Mikael,

we can handle this..

Since the greater than (>) operator is not available in the condition editor, you can use the following solution: You define the relevant logical expression in the expression editor by means of an XPath predicate, and assign it to a node element. Using the condition editor you then just query the existence of this node element (by using the existence operator (EX)).

http://help.sap.com/saphelp_nw04/helpdata/EN/ab/13bf7191e73a4fb3560e767a2525fd/content.htm

on above link go to bottom you will get solution for your problem..

Thanks,

Bhupesh

Former Member
0 Kudos

Hi Bhupesh

Thanks for your answer. However, I do not have a node element (in the payload) as I do not have a source message type because I am passing thru the attachment.

However, do you think this will work (I chose ConversationId in stead of ProcessStep, as ConversationId is a message header field, see link):

ns1:/Main [[ConversationId < 500]]

ns1: http://sap.com/xi/XI/System

As indicated here: http://help.sap.com/saphelp_nw04/helpdata/EN/6e/ff0bf75772457b863ef5d99bc92404/content.htm

/Mikael

Former Member
0 Kudos

Node .. means your field on which you want to put condition..

Thanks,

Bhupesh

Former Member
0 Kudos

ok, I shall try it out and let you know if it worked