cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver Determination Condition not working

Former Member
0 Kudos

Hi,

The scenario is if the last 6 chars of the FIRST recordset are NOT equal to "000001" then the message should be forwarded to configured receiver else message processing should end without error.

My incoming payload structure is as follows:

<?xml version="1.0" encoding="utf-8"?>

<ns:WorkOrder xmlns:ns="http://test.com">

<OrderRecord>

<Recordset>010002720091213|103131000003 </Recordset>

</OrderRecord>

<OrderRecord>

<Recordset>020001080341110706411 28915XO000000.00KZXCVMECCREA </Recordset>

</OrderRecord>

<OrderRecord>

<Recordset>020001070341110703411 28915CO000000.00KZXCVMECCREA </Recordset>

</OrderRecord>

</ns:WorkOrder>

The following receiver determination condition is not working:

(//OrderRecord[1]/substring(Recordset,23) !="000001" EX )

As the fix has to be put urgently any help would be appreciated.

Sridhar

Edited by: Sridhar Upadhyayula on Jan 25, 2010 2:51 AM

Edited by: Sridhar Upadhyayula on Jan 25, 2010 3:00 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

have you tried sthg like that :

/ns:WorkOrder/OrderRecord\[position()=1 and not(substring(Recordset,string-length(Recordset)-5)='000001')\]/Recordset EX

Chris

PS: if heading or trailing blanks exist, we could add a trim function (normalize-space could make it too) ...

Edited by: Christophe PFERTZEL on Jan 25, 2010 1:01 PM

Former Member
0 Kudos

Chris,

Your xpath string has worked. Thanks a lot.

Regards,

Sridhar

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Did you try below?

 (/ns1:OrderRecord not (contains(substring(X,23,28),'000001') 

Use "EX" operator for above XPATH.

-Gouri

Former Member
0 Kudos

Hi Sridhar,

Have a look at this blog and restructure your Xpath accordingly. Only thing i am not sure is about the substring part (that is a java function) not sure if you can call it there.

/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

regards

Former Member
0 Kudos

Hi,

Substring is a valid xpath function, it can be used.

I have got the following query working in the XML Spy but it is not working in PI 7.0, can anyone throw some light on why the following query is not working in PI 7.0?

(//OrderRecord[1]/substring(normalize-space(Recordset),23,28) != "000001")

Can we use "normalize-space" function in PI 7.0 Receiver Determination xpath?

Payload is provided below:

<?xml version="1.0" encoding="utf-8"?>

<ns:WorkOrder xmlns:ns="http://Test.com">

<OrderRecord>

<Recordset>010002720091213|103131000002 </Recordset>

</OrderRecord>

<OrderRecord>

<Recordset>020001070341110703411 28915ZONCVCFRXXXXX MAXXT SYSTEM HAS XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX CXXXXRXXXL C139 XXXXXXXXXX0 XXXX 000000.00XXXXXXXXX </Recordset>

</OrderRecord>

</ns:WorkOrder>

Sridhar

jose_augastine3
Active Participant
0 Kudos

Hi Sridhar,

Hope this helps !!!

/people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16

Regards,

J Augastine

former_member200962
Active Contributor
0 Kudos
(//OrderRecord[1]/substring(normalize-space(Recordset),23,28) != "000001")

I think you have not maintained the brackets properly....refer to the blog by Shabarish and maintain the eaxct sequence of the brackets...it can be the issue.

Can we use "normalize-space" function in PI 7.0 Receiver Determination xpath?

yes it can be used...refer: http://www.w3schools.com/xpath/xpath_functions.asp

Regards,

Abhishek.