Skip to Content

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

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 20, 2016 at 04:52 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 19, 2016 at 08:30 PM

    Hi Christopher,

    try with the below condition

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