cancel
Showing results for 
Search instead for 
Did you mean: 

Merge Payload issue

former_member277492
Participant
0 Kudos

Hello Experts,

I have an issue while combining the Payload after message mapping.

This Integration between SF and CPI and I am using Compound Employee.

Below are the steps;
1. I am extracting data by firing a query, splitting employee record by using General Splitter and given Grouping as 1.
2. Configured Router and given the condition based on the Event (Hire, Rehire, Change and Termination) the employee records differentiated and should go to the respective mapping (Above mentioned 4 events have got different mappings and structure change).

3. After Mapping output I would like to merge the payload and send it to Target system (SFTP adapter is used here).

4. I am using Gather function after Mapping and result is still getting separate output files only and not the merged one.

(May be because of General Splitter behaviour)

Do we have any Groovy to handle this requirement or any other way to achieve this.

Kindly provide your Inputs in resolving the issue.

Thanks,

Regards,

Sree

Accepted Solutions (0)

Answers (6)

Answers (6)

former_member277492
Participant
0 Kudos

Hello Shivaram,

I have incorporated few other changes and completed the task.

Thank you for your efforts.

Best Regards,

Sree

former_member277492
Participant
0 Kudos

Hello Shivaram,

Sorry for the delayed response due to medical emergency.

I have tried the below approach for merging the payload.

I am using below groovy and appending the payload in SFTP directory (1 file will be written and rest of the records will append into the same file). Records are appending but

<?xml version="1.0" encoding="ISO-8859-1"?> and EMPLEADOS (Root node) is repeating for each employee record. Output xml file looks like below;

Output file with multiple tags - Not desired one.

Desired output structure is;

Please could you help me out resolving this issue.

Thank you,

Best Regards,

Sree

former_member277492
Participant
0 Kudos

Hello Shivaram,

Thanks for the details.

I will try on the proposed solution and update.

Best Regards,

Sree

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Sreekar,

You can improvise bit on the modeling if you are only using splitter to identify records based on event reasons.

Use Content Filter to group all the 3 categories ( hire, rehire, termination or whatever event reasons you want ) shown in below blog( refer design use case ) and then use JOIN/GATHER to have all the records.

Content Filter Example Condition:

queryCompoundEmployeeResponse/CompoundEmployee[((person/logon_user_is_active = ‘true’) and ((person/employment_information/job_information/emplStatus =’A’) and (person/employment_information/job_information/emplStatus/event_reason =’HIRNEW’))) ]

Reference blog:

https://blogs.sap.com/2017/06/01/sap-cloud-platform-integration-content-filter-in-detail/

Regards,

Sriprasad Shivaram Bhat

former_member277492
Participant
0 Kudos

Hello Shivaram,

Thanks for your quick response.

Please find the enclosed details. Whereas I am getting output as a separate file for each employee record. Requirement is to generate a single file event wise (Hire, Rehire, Change and Termination).

I doubt join will work in this requirement. Please suggest a way forward.

Best Regards,

Sree

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Sreekar,

You should use Join and then gather to collect all the messages. Also make sure all the 4 mappings produce similar record structure and after gather you can use the Content Filter & Content Modifier to get rid of multimap tags. Please share screenshot of your iflow to visualize if some other issue with your modeling.

Regards,

Sriprasad Shivaram Bhat