cancel
Showing results for 
Search instead for 
Did you mean: 

i need to sort the incoming file contents before message mapping

Former Member
0 Kudos

Hi All,

I have requirement like i have to sort the file contents before message mapping in Xi. is there any option please suggest me with your value information.i dont want to sort in message mapping before that i want file contents to be sorted order.waiting for your quick reply.

Thanks,

seshagiri

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can have two mapping programs. Sort in first mapping and then pass out put of this to second mapping program. It will be easy to implement also.

Or you can go for XSLT/JAVA mapping for sorting.

-Gouri

Former Member
0 Kudos

HI Gauri ..

How do u Pass Data from One Mapping to Other Mapping ???? Do u mean two Scenarios ..??

Regards

PS

Former Member
0 Kudos

you don't need two scenario. You can have two mapping in the operating mapping.

you just have to make sure that Source of the first mapping and target of the last mapping should match.

Former Member
0 Kudos

Hi,

Thanks for reply can explain the process in detail or u can share any blog for this.

Thanks,

Seshu

Former Member
0 Kudos

Hi

You can use two mapping one mapping to sort and second mapping for actual mapping

the target structure of first mapping and the source structure of second mapping should be same by this the data will be passed to second mapping automatically

and you need to call these both mapping in one operation mapping

under one operation mapping two message mappings need to be called

So first mapping Sorting mapping

Second mapping actual mapping

Former Member
0 Kudos

Hi,

You can do this in one scenario.

Lets say you have MT_Source and MT_Target as two message types.

Now your MM1 will be between MT_Source & MT_Source, that is same message type. Here you built your sorting logic.

Now create MM2, between MT_Source & MT_Target. Here your actual mapping logic will be implemented. The input payload for MM2 will be sorted data.

Now in operation mapping, first call MM1 and then call MM2 (You have a plus + sign to add multiple mapping programs). Due to this sequence, at run time first MM1 will be executed and after that its oupt will be given to MM2 as source payload.

Hope its clear. Plz let me know if you have any doubts.

-Gouri

Former Member
0 Kudos

Hi Gouri,

I have 5 fields in flatfile i have to use 3 fileds for sorting records.i mentioned tht we required two mappings.first maping is graphical mapping or java mapping?can i achive this using graphical mapping.if i have to go for the java mapping can u provide the some mapping blogs or any sample code for java mapping.

Thanks,

Seshagiri

Former Member
0 Kudos

Hi Sesha,

I guess you requirement is as follows:

Flat Files (5)---> convert to XML (content conversion) -> mapping condition (use 3 elements to define sorting of records at receiver)-receiver structure.

If this is the case its a normal grapical mapping u dont require java or xslt...

You can use normal node functions to achive this requirement...

Former Member
0 Kudos

Hi,

You can use both mapping as Graphical one.

In first mapping you use sort and sort by key function to sort the data. Plz post your source and target structure + required output, we will try to suggest the actual mapping.

-Gouri

Former Member
0 Kudos

Hi Gouri,

Thanks for your information.problem solved.

Thanks,

Seshagiri

Answers (4)

Answers (4)

Former Member
0 Kudos

Yes, as suggested you can go for an adapter module development to handle this.

But we are really keen to know why is it like you have to sort the input before the mapping. What is the business requirement (shall we say restriction ?)? Please share...may be we can provide you with better solution/ design.

prateek
Active Contributor
0 Kudos

i dont want to sort in message mapping before that i want file contents to be sorted order

And why is that? Whats the business case of this requirement?

Regards,

Prateek

Former Member
0 Kudos

u can develop adapter module and first sort the content and then pass it to message mapping.

but why u wanted to sort it before and not in message mapping is there any specific reason for that.

chirag

Former Member
0 Kudos

i think the best solution is to have an operation mapping with two mapping steps.

1st step: sorting: message mapping, java, xslt

2nd step: your actual mapping

Former Member
0 Kudos

Hi Seshagairi,

You can use the sort function or SortByKey fn in your mapping

Thx,

Amar.