cancel
Showing results for 
Search instead for 
Did you mean: 

Customizing XPATH in Receiver Determination

former_member192105
Participant
0 Kudos

Hello,

I am using this blog to write conditions /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination and accordingly call the receiver (either Receiver_1 or Receiver_2), never to call both the receivers simultaneously

I have a sample source message like:

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

<ConsumerDetails>

<UserId>91200024:123456</UserId> To check if UserId starts with 91200024: or not

<Date>20111301161459</Date> To check if length of Date is 14 or not

<Billing>RC</Billing> To check if Billing has value RC/ SB or not

<Type>SE</Type> To check if Type has value SE/ CWE or not

</ConsumerDetails>

Accordingly wrote the below conditions:

Receiver_1 (Conditions working fine):

UserId (MiddleOperator --> ContainsPattern) --> 91200024:*
/ConsumerDetails[(string-length(Date)) = "14"] --> EX
/ConsumerDetails[(Billing = "RC") or (Billing = "SB")] --> EX
/ConsumerDetails[(Type = "SE") or (Type = "CWE")] --> EX

Receiver_2 (Conditions not working; except 1st condition):

/ConsumerDetails[not(starts-with(UserId,'91200024:'))] --> EX
/ConsumerDetails[(string-length(Date)) != "14"] --> EX
/ConsumerDetails[(Billing != "RC") or (Billing != "SB")] --> EX
/ConsumerDetails[(Type != "SE") or (Type != "CWE")] --> EX

Only Conditions for Receiver_1 are working fine; those for Receiver_2 are not. Can anybody please provide correct conditions to be written in the Condition Editor?

~Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

RKothari
Contributor
0 Kudos

Hello,

Have you tried using the condition as mentioned below:

/ConsumerDetails[not((string-length(Date)) = "14")] --> EX
/ConsumerDetails[not((Billing = "RC")) or not( (Billing = "SB"))] --> EX
/ConsumerDetails[not((Type = "SE")) or not((Type = "CWE"))] --> EX

i.e. use not() instead of '!' ??

-Rahul

former_member192105
Participant
0 Kudos

Hello,

I did not try it, let me give a try. Will update the thread soon with results.

~Thanks.

former_member192105
Participant
0 Kudos

Hello,

The below list works as expected:

/ConsumerDetails[not((string-length(Date)) = "14")] --> EX
/ConsumerDetails[not((Billing = "RC") or (Billing = "SB"))] --> EX
/ConsumerDetails[not((Type = "SE") or (Type = "CWE"))] --> EX

~Thanks.

Answers (0)