on 04-06-2016 1:52 PM
Hi Experts,
I have two receivers and my source xml needs route to receivers based on the condition.
If it goes to wrong receiver, I get mapping exception because of different logic.
Below are the conditions that i am using for routing, not sure i am getting errors. Please help me on this.
For ReceiverA:
(((/Source1/Data/Node/SubNode/Value = A) and (/Source1/Data/Node/DiffNode/SecondValue = "ABC" or /Source1/Data/Node/DiffNode/SecondValue = "DEF")) or ((/Source1/Data/Node/SubNode/Value = B) and (/Source1/Data/Node/DiffNode/SecondValue = "ABC" or /Source1/Data/Node/DiffNode/SecondValue = "DEF")) EX )
For ReceiverB:
(((/Source1/Data/Node/SubNode/Value = A) and (/Source1/Data/Node/DiffNode/SecondValue != "ABC" or /Source1/Data/Node/DiffNode/SecondValue != "DEF")) or ((/Source1/Data/Node/SubNode/Value = B) and (/Source1/Data/Node/DiffNode/SecondValue != "ABC" or /Source1/Data/Node/DiffNode/SecondValue != "DEF")) EX )
Logic is:
((If Value is equals to 'A') and (If SecondValue is equals to "ABC" or "DEF")) or ((If Value is equals to 'B') and (If SecondValue is equals to "ABC" or "DEF")) ---> route to receiverA
((If Value is equals to 'A') and (If SecondValue is not equals to "ABC" or "DEF")) or ((If Value is equals to 'B') and (If SecondValue is not equals to "ABC" or "DEF")) ---> route to receiverB
Appreciate your inputs on this. Thank you.
Hi Mohan,
Use below XPATH expressions.
/Source1/Data/Node[(SubNode/Value = "A" or SubNode/Value = "B") and (DiffNode/SecondValue = "ABC" or DiffNode/SecondValue = "DEF")] EX ---->REC1
/Source1/Data/Node[(SubNode/Value = "A" or SubNode/Value = "B") and (DiffNode/SecondValue != "ABC" or DiffNode/SecondValue != "DEF")] EX ---->REC2
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Its not throwing error while determining receiver. However if SecondValue is equals to "ABC" , its going to both receivers which is not expected.
I got the reason why its going to both receivers , if SecondValue is equals to "ABC" , below conditions which are in bold are satisfying the logic.
Can you help to fix this.
/Source1/Data/Node[(SubNode/Value = "A" or SubNode/Value = "B") and (DiffNode/SecondValue = "ABC" or DiffNode/SecondValue = "DEF")] EX ---->REC1
/Source1/Data/Node[(SubNode/Value = "A" or SubNode/Value = "B") and (DiffNode/SecondValue != "ABC" or DiffNode/SecondValue != "DEF")] EX ---->REC2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mohan,
Can you specify, what error you are receiving?
--
Sendhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.