on 10-04-2013 8:42 AM
Hi,
I have this payload.
<ns:request>
<in>
<materialno>AU1234</materialno>
</in>
<ns:/request>
I'm using xpath in receiver determination and I have to check the country code prefix in the material number. I need to use Substring function and not ContainsPattern (double ~) because I will create a longer expression later on.
I'm using this condition but it doesn't work:
/ns:request/in[substring(materialno,1,2)='AU'] EX
Any idea? Appreciate your inputs!
Hi Mark,
Your xpath looks right for me, have you defined the ns namespace correctly in the table with prefix and namespace columns?
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Inaki,
I just realized it's working if it's the only condition. But when I add another expression using AND, to check the another field, it's failing. The thing is, the 2nd expression also works if it's the only condition. So basically, problem happens when I combine both expressions with AND.
<ns:request>
<in>
<materialno>AU1234</materialno>
<country/>
</in>
</ns:request>
Here is my condition:
/ns:request/In[substring(materialno,1,2)='AU'] EX
AND
/ns:request/In[string-length(country) = 0] EX
Since both are satisfied, it should be routed to ReceiverA. However, it's getting moved to ReceiverB via the 'No receiver is found option, process as follows: Select the following receiver: ReceiverB'.
Hi,
Refer to this blog & notice how the 'AND' condition is provided:
Hello Mark,
Have you tried unchecking the multiline option? If this is checked, it causes both conditions to be evaluated independently and the results for both conditions joined e.g it checks for condition 1 (all nodes for condition 1) first and if true, then checks for condition 2 (all nodes for condition 2).
Regards,
Mark
<?xml version="1.0" encoding="utf-8" ?>
Hi Alejandro,
It worked. Thanks!. It would be great if you could shed some light on referencing the xml payload
Sorry, the issue is that I have multi-mapping going, meaning 2 interfaces.
So, when the //InternalID = GRTG pickup target 1
and when the //InternalID = PLCY pickup target 2
Currently, it picksup target 1 for all.
Thanks!
Vimal
You could try using *AU* to check for ContainsPattern instead of using Substring.
Please let me know if it works.
If we dont use * on both Sides, what I have seen is that PI pops up Error for not being able to find the Receiver.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this
substring(/ns:request/in/materialno,1,2)='AU'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
substring(/ns:request/in/materialno,1,2)='AU'
or if you have a single material
substring(//materialno,1,2)='AU'
http://www.worldofintegration.com/content/xpath-string-functions-examples
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.