Quantcast
Channel: SCN : Unanswered Discussions - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 6719

XPATH in Receiver Determination for missing node

$
0
0

I have this situation in a proxy to file/email scenario.

 

My date from the proxy can look like this:

 

<RECEIVER_ID>0002000135</RECEIVER_ID>

<EMAILID>foo@fooland.com</EMAILID>

 

or

 

<RECEIVER_ID>0002000135</RECEIVER_ID>

{no EMAILID NODE}

 

I need to route the data to an email (as an attachment) or to a file to be FTP'd. Notice the <RECEIVER_ID> node has the same value in both case. I need to make this determination based on the existance or non-existance of the <EMAILID> node. I read about a million blogs and web pages and what I found does not work.

 

I have tried as the Xpath rule for a file to be sent as

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID  = 0002000135 AND

/p4:CustInvcWandPOS_MT/Records/[not(exists(EmailID))] EX

 

and

 

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID  = 0002000135 AND

/p4:CustInvcWandPOS_MT/Records/[not((EmailID) EX

 

I have as the XPath for the email

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID = 0002000135 AND

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID EX

 

 

What happens is when there is no EMAILID node at all, PI is still trying to send out an email and not trying to send a file. I verified it was finding the [not(exists(EMAILID))] as invalid but finding the "send email" version as valid and failing, of course, as there is no EMAILID node.

 

Please help!


Viewing all articles
Browse latest Browse all 6719