cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping exception

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member182412
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Thanks for your inputs.

I tried this, Still getting the error.

former_member182412
Active Contributor
0 Kudos

Hi Mohan,

Former Member
0 Kudos

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

former_member182412
Active Contributor
0 Kudos

Use and operator instead of or in not equal to ABC and not equals to DEF

RaghuVamseedhar
Active Contributor
0 Kudos

Mohan,

Please correct xPath expressions

((If Value is equals to 'A' or 'B') and (If SecondValue is equals to "ABC" or "DEF")) ---> route to receiverA

((If Value is equals to 'A' or 'B') and (If SecondValue is not equals to "ABC" or "DEF")) ---> route to receiverB

sendhil_kumar
Active Participant
0 Kudos

Hi Mohan,

Can you specify, what error you are receiving?

--

Sendhil

Former Member
0 Kudos

Sendhil,

Basically this is IDoc to File... so getting tRFC error in ECC SM58 because of Invalid receiver determination conditions.