cancel
Showing results for 
Search instead for 
Did you mean: 

SenderAppl wants to know invalid records identified by PI (in mapping)

former_member188019
Active Participant
0 Kudos

Hi All,

I have a scenario.

 
SenderAppl-->FileAdapter-->PI-->RecieverAdapter-->ReceiverAppl.

the sender and receiver datatypes is similar.

the payload can contain any number of employee elements (records) under the root element EmployeesData

a sample payload is:

 
<EmployeesData>
   <employee>
      <empName>Edwin</empName>
      <empNumber>100</empNumber>
      <emailServer>mymail.com</emailServer>
   </employee>
   <employee>
      <empName>Peter</empName>
      <empNumber>200</empNumber>
      <emailServer>xyz</emailServer>
   </employee>
   <employee>
      <empName>Mark</empName>
      <empNumber>300</empNumber>
      <emailServer>mark.com</emailServer>
   </employee>
</EmployeesData>

In my context, a valid emailServer value is something that ends with .com

the requirement is:

1) PI should send all the employee records that contain valid emailServer values.

2) the employee records that contain invalid emailServer values should be sent back (or notified in someway) to the sender, so that senderAppl team gets to know what records are pending to be corrected and sent to receiver application.

first requirement i addressed using Message Mapping.

so the record Peter containing <emailServer>xyz</emailServer> doesn not end with .com, the mapping ignored it and the rest two records Edwin and Mark have been sent to Receiver Appl.

for the second requirement, how can i configure, such that senderAppl should get something like invalid.xml containing

 
<EmployeesData>
   <employee>
      <empName>Peter</empName>
      <empNumber>200</empNumber>
      <emailServer>xyz</emailServer>
   </employee>
</EmployeesData>

As this is asynch scenario, i think the invalid data is not sent back as part of response. but somehow, the SenderAppl would like to know the unsent records to the Receiver.

let us know a decent approach to do this.

Madhu_1980

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Madhu,

as you mentioned your scenario is Async but you want to send this back to sender application.. then in that case for sure you need to change the scenario ..or flow.. as by using async for sure it is not possible..

few other option..

use same Async scenario but create two different target structure.. and map if right email address to structure A else B.. and

in case of right email address continue your scenario with your current receiver ..

but in case of wrong email address create file by using second structure ..on FTP system say.. "Test"

then create one more Async interface from Test to your sender application which will pick file from FTP and will send this details to sender application as in this case this File sender you no need to trigger this will get trigger whenever this is file on FTP..

Thanks,

Bhupesh

Answers (1)

Answers (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

the requirement is:

1) PI should send all the employee records that contain valid emailServer values.

2) the employee records that contain invalid emailServer values should be sent back (or notified in someway) to the sender, so that senderAppl team gets to know what records are pending to be corrected and sent to receiver application.

A solution for the second requirement rests on your receiver determination:

1. The first receiver is your receiver for the messages that has the .com values (no xpath)

2. The second receivers' xpath should be made such that if there is at least one emailServer (use multiline in xPath) that has no .com values, then it will be created

3. Make sure you have already created the mapping, interface det, cc, etc

Hope this helps,

Mark