cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in msg mapping

Former Member
0 Kudos

Hi all,

I have 3 fields (Emp_no,Name,Salary)...i am sorting those values based upon Emp_no. Now the problem is only the emp_no is getting sorted and the remaining things are coming as it is.

Source Structure=Target Structure

Mt_src

Employee

emp_no

name

salary

Mapping:(mine)

Mt_src---->Mt_tgt

Employee--->Employee

emp_no>removecontext>sort>splitbyvalue(eachvalue)>emp_no

name-->name

salary-->salary

Regards

Arivarasu S

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey try using sortbykey instead of sort..

Like sort, but with two inbound parameters to sort (key/value) pairs. The sort process can be compared to that of a table with two columns.

● Using the first parameter, you pass key values from the first column, which are used to sort the table. If you have classified the key values as numeric in the function properties, they must not be equal to the constant ResultList.SUPPRESS. See also: The ResultList Object

● Using the second parameter, you pass the values from the second column of the table.

noce blog on sorting in message mapping..

/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13

thanks,

Vijaya

Answers (3)

Answers (3)

Former Member
0 Kudos

It is because you are only sorting a particular field i.e. emp_no in your case. You have to also sort the other fields, i will give u an example with name

emp_no>removecontext>

                                          > sortbykey>splitbyvalue-->name

name > removecontex t>

sortbykey should use comparator Lexicographical.

Do the same for other fields as well.

Sameer

Former Member
0 Kudos

Hi,

Currently the Queue of emp_no is not matching with the other fields,

Use the node function mapWithDefault to align all the queues

Refer

As the functions sort and sortByKey only sort the elements within the same context, we have to use the function removeContexts before sort. After sort we have to restore the original contexts. We do this with the node function splitByValue

/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13

reg,

suresh

Former Member
0 Kudos

HI,

Practically records r sorted based on the mandatory and unique filelds. But if in ur scenario that couldnt happen, then check if that node exists using "exists" function and then only proceed fot the sorting

Currently the Queue of emp_no is not matching with the other fields,

Use the node function mapWithDefault to align all the queues

Refer

As the functions sort and sortByKey only sort the elements within the same context, we have to use the function removeContexts before sort. After sort we have to restore the original contexts. We do this with the node function splitByValue

/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13

Thanks

Swarup

Edited by: Swarup Sawant on Jun 23, 2008 11:50 AM