Skip to Content
0

SAP PI Receiver Determination - How to check for non existing Element in Condition Editor

Dec 19, 2016 at 02:44 PM

246

avatar image

Hey experts,

in my scenario, i had a lot of incoming xml files. For each file i have to check if there is a specific element in this xml. If the element is existing, the message should be rejected. If the node is NOT existing, the message should be send to the configured receiver.

In the receiver determination, i said that if no receiver is found, the message should be ignored. Now i have to configure the condition, so that only xml-files without the element gets a receiver.

With the given four operations, this is not possible. I searched the internet and found some topics about my problem, but it still dont work. My non-functional solution is:

/p1:Node1/p1:Node2/p1:Node3[not(Element1)]
EX

I also found and tried this, also without success:

/p1:Node1/p1:Node2/p1:Node3[count(Element)
= 0] EX

In both cases, it works exactly the other way it should work – the xml without element gets no receiver, but the xml with the element does.

Can you please give me a hint? ;-) We use PI 7.31

Regards,

Chris

condition.jpg (61.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Evgeniy Kolmakov Dec 20, 2016 at 04:52 AM
1

Hi Chris!

Your second condition definitely should work. Try another one:

//p1:Node1[count(p1:Node2/p1:Node3/Element)=0] EX

Also check if namespace prefixes should be used for any/all elements in XPath and namespace definition is supplied.

Regards, Evgeniy.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Evgeniy,

thank you, now it works! I see the difference, but can you explain me, why this works and my solution not? I'd like to learn something for the future ;-)

Thank you again!

Regards, Chris

0

Hi Chris!

Frankly speaking, I don't know why it doesn't work with your condition :-) Maybe if you provide your payload I could check.

Regards, Evgeniy.

0
Navdeep Singh Dec 19, 2016 at 08:30 PM
0

Hi Christopher,

try with the below condition

count(/p1:Node1/p1:Node2/p1:Node3[Element]) = 0
Share
10 |10000 characters needed characters left characters exceeded