on 12-08-2008 12:29 PM
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??
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.