cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping output not in sequence with input

Former Member
0 Kudos

Hi Experts,

I am working on a File to File scenario.

My MM looks something like below:

Input_MT Output_MT

Recordset Recordset

Node: I_record 0:n -


> I_record 0:n (Direct Mapping)

<fields> <fields>

Node: U_record 0:n -


> U_record 0:n (Direct Mapping)

<fields> <fields>

My input file has two structures namely IRECORD AND URECORD which occur radomly, i.e,

<IRECORD>

<IRECORD>

<URECORD>

<IRECORD>

<URECORD>

<URECORD>

<URECORD>

<IRECORD>

<URECORD>

-

-

-

-

-

SO ON

When the above MM is executed with the above sample of input, the output sequence is not same as the input sequence of records. Instead it give all the IRECORDs together and then al the URECORDs together.

Something like:

<IRECORD>

<IRECORD>

<IRECORD>

<IRECORD>

<IRECORD>

-

-

-

-

<URECORD>

<URECORD>

<URECORD>

<URECORD>

-

-

-

Cant I get the output record sequence same as that of input??

Accepted Solutions (1)

Accepted Solutions (1)

prateek
Active Contributor
0 Kudos

In an xml file, both the structure means the same in all senses. If your output is an xml file, then it shouldn't make any difference.

Regards,

Prateek

Former Member
0 Kudos

Hi Prateek,

My input non-xml file has these structures in random sequence, and i want them in my output file in the same sequence as that of input. My MM test itself is not giving the output in the sequence which is expected.

Former Member
0 Kudos

Since all your input Feilds are coming under the same context ( same node) .

The runtime mapping will first execute all the occurence of the first field and create the target feilds.

and then move in to the next feild.

Can we know what is the problem if the output is not coming in same sequence as that of input.

As Prateek told there will not be any difference in the content of your XML docment.

Cheers

Sunil.

SudhirT
Active Contributor
0 Kudos

Hi Shobha,

If you want the output exactly as your input, Just goto interface determination and remove the Interface mapping by creating new Interface determination with Inbound interface specified and without the interface mapping.

Thanks!

Former Member
0 Kudos

Hi Sunil,

Thank you 4 answering the query.

U and Prateek are absolutely correct that there will be no difference in the file content. Just they will not be in sequence. But the requirement is such that, the sequence has to be followed. One of the field in the record is serial number. So the output file content has to be in this sequence...

thanks

Former Member
0 Kudos

Hi Sudhir,

Thank you too.. that was a smart answer. I want the output file content to be in same sequence as that of input. Not the same content as that of input. If that was the case, i know how to bypass the file. I am doing some transformations in MM. Hence i need IM.

Former Member
0 Kudos

Hi Shobha,

I think its not possible using the graphical mapping as GM combines all the nodes of the same type and then moves to the next node.

May be you can give a try via java mapping.

Thanks,

Pooja

VijayKonam
Active Contributor
0 Kudos

Are you writing this to a file? If that is the case you need to create you output message as per a single file or one repeatable strucuture. Then create your mapping anc hcnage the target message cardinality to 1..U.

VJ

Former Member
0 Kudos

Hi Shobha

If i understand the requirement.

You want to get the output file in same order as input. Did you tried with some tests.

Its an XML file that follows the structure. If you are not modifying it then it will reach from top to bottom in same order. Moreover your transformations are not involving context changes and structure changes in mapping then you should give it a try with various test cases. I think it will not change the sequence.

if this doesn't work then we can create a Java mapping to handle the sequence.

Thanks

Gaurav

Former Member
0 Kudos

Thank you Pooja, VijayaShankar and Gaurav..

Ill try your suggestion Shankar..

Answers (1)

Answers (1)

stefan_grube
Active Contributor
0 Kudos

The graphical mapping tool is not able to produce alternating subnodes.

When you use the file content conversion of the MesageTransformbean instead of the fcc of the fiel adapter, then you can create a structure like this:

<row>

<IRECORD>

<row>

<IRECORD>

<URECORD>

<row>

<IRECORD>

<URECORD>

<row>

<URECORD>

<row>

<URECORD>

<row>

<IRECORD>

<URECORD>

That helps to keep the nodes in the correct sequence.

Regards

Stefan

VijayKonam
Active Contributor
0 Kudos

Thats a good thing to know Stefan. Thanks for the input..!!

VJ