on 09-13-2011 1:42 AM
Hi,
This is my input payload.
segment "Record" will be coming multiple times.
<ns:MT_Account xmlns:ns="urn:com.statement">
-<BalanceRecs>
- --<Record>
-
<field1>CUA</field1>
-
<field2>0.00</field2>
-
<field3>324612.28</field3>
-
<field4> LTD</field4>
-----<numRecs>0</numRecs>
</Record>
--- <Record>
-
<field1>CUb</field1>
-
<field2>0.00</field2>
-
<field3>324612.28</field3>
-
<field4> LTD</field4>
-
<numRecs>2</numRecs>
</Record>
--- <Record>
-
<field1>CUc</field1>
-
<field2>0.00</field2>
-
<field3>324612.28</field3>
-
<field4> LTD</field4>
-
<numRecs>0</numRecs>
</Record>
</BalanceRecs>
Requirement:
I need to calculate the sum of field "numrecs".
If the sum is 0, then pass to BPM(IP_BPM)
If the sum is > 0 then pass to System B.
I tried using the below blog from shabarish..
/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
/p1:MT_ActBalance/BalanceRecs/BalanceRecord[sum(numRecs) = 0] EX --> BPM
/p1:MT_ActBalance/BalanceRecs/BalanceRecord[sum(numRecs) > 0] EX --> SystemB
Is there anything im missing .. kindly suggest.
Thanks
Deepthi.
Hello,
/p1:MT_ActBalance/BalanceRecs/BalanceRecord[sum(numRecs) = 0] EX --> BPM
/p1:MT_ActBalance/BalanceRecs/BalanceRecord[sum(numRecs) > 0] EX --> SystemB
The conditions look okay. If you are using PI 7.1 with interface pattern as stateless, use // in your xPath e.g
//p1:MT_ActBalance/BalanceRecs/BalanceRecord[sum(numRecs) = 0, otherwise retain as is.
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
It is working only for one receiver.
i mean
-
<numRecs>0</numRecs>
-
<numRecs>0</numRecs>
-
<numRecs>0</numRecs>
The message is going correctly when the sum value is 0. ie to BPM.
-
<numRecs>0</numRecs>
-
<numRecs>2</numRecs>
-
<numRecs>0</numRecs>
OR
-
<numRecs>2</numRecs>
-
<numRecs>0</numRecs>
-
<numRecs>0</numRecs>
When I pass the above payloads, it is going to both the receivers.
Since the total is 2, it should go only to systemB
Any idea?
This is working perfectly for enhanced receiver determination. I dont want to use enhance version for this simple case.
The message is going to both the receivers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.