cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute the mapping condition

Former Member
0 Kudos

Dear All,

I have a scenario where the source and target mapping is as follows

Source                                          Target

HeaderNodeA                                 HeaderNodeB

Employeeid                                    EmpId

Employeename                              EmpName

Department                                    Dept

DateOfJoining                                 DOJ

If the Department value in incoming payload is 01 or 02 then the target node should not be created and an alert should be raised to end user. For rest of the incoming Department values, it should create the target node.

Please let me know how can i execute the above mapping condition.

Regards

Uday Kiran

Accepted Solutions (0)

Answers (6)

Answers (6)

Harish
Active Contributor
0 Kudos

Hi Uday,

If the Department value in incoming payload is 01 or 02 then the target node should not be created and an alert should be raised to end user. For rest of the incoming Department values, it should create the target node.

--> do you want to send the message and raise the alert? or want to stop the message and raise the alert (in case of department value is 01 or 02).

If you don't want to send the message and raise the alert, the best way is to implement in receiver determination. Because it is a routing logic.

If you implement this in mapping then you will mix the routing alerts (which you are raising in mapping) with mapping failure alerts.

regards,

Harish

Former Member
0 Kudos

Hi Harish,

I don't want to send the message and raise the alert

so can i get the reference/useful links, if any ? for this kind of condition as it will be more helpful to me because i am not familiar with how to implement such logic in receiver determination.

Regards

Uday

Muniyappan
Active Contributor
0 Kudos

Hi,

Check this for reference

http://wiki.scn.sap.com/wiki/display/XI/Xpath+Condition+in+Receiver+Determination

Can you confirm occurrence of headernode?

This will be possible when headernode comes once.

If headernode comes multiple  times in one message then you have to use multi mapping to filter.But here you can not raise an alert.

Regards,

Muniyappan

Harish
Active Contributor
0 Kudos

Hi Uday,

If you are getting the XML from adapter engine, then you can use the standard receiver determination. Please refer the below blog for standard receiver determination and interface determination condition

regards,

Harish

Former Member
0 Kudos
former_member184720
Active Contributor
0 Kudos

Sorry i just read your question again and

if you have a message which has multiple records with dept ID 01,02,03 and 04 then the target should receive the records for 03 and 04 and at the same time alert mail should be generated for 01 and 02.

If so may be you can design something like this->

Define two interfaces-> one is your actual target and the other would be mail receiver

In the receiver dtermination route the messages based on the xpath

actual receiver-> xpath would be Dept!=01 and 02

in the mapping : Filter the records

Mail mapping -> Xpath would be Dept= 01 or 02

In the mapping : filter the records and map it to mail receiver strcuture so that email will have enough details.

Muniyappan
Active Contributor
0 Kudos

Hi,

You can handle this in receiver determination with Xpath condition or use simple udf with in raise the exception.

Regards.

Muniyappan

Former Member
0 Kudos

Dear Muniyappan,

Thanks for your response.

I have tried using createif and ifelse functions saperately. can you elaborate the logic condition as i am unaware of using Xpaths.

Regards

Uday

gagandeep_batra
Active Contributor
0 Kudos

Hi Uday

for this scenario you have two option

1. using UDF write a code to alert

2. put a condition at receiver determination it that condition is not match then raise the alert

Regards

GB

former_member184720
Active Contributor
0 Kudos

Simple.. use create if function under the Node function to create the target node only when the dept ID is not in 01 and 02.

Other cases when the mapping failes, configure the alerts to so that your end user will receive the faiure alert

Former Member
0 Kudos

Hi Hareesh,

i have tried using createif and ifelse functions saperately. can you elaborate the logic condition.

Regards

Uday

former_member184720
Active Contributor
0 Kudos

Dept ID-> fix values(01,02->false)->create IF->your target node