Author |
Message
|
pfaulkner |
Posted: Wed Apr 23, 2003 10:15 am Post subject: MRM Mapping Question |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
If I have an MRM XML message and an MRM Cobol message and I map from the XML to Cobol, do I have to map the fields in the order required?
I would have assumed using MRM that no matter the order I map the fields it would place them in the correct position within the msg, and fill in any fields I don't map with default values....
Is this not the case? |
|
Back to top |
|
 |
RamVijayawada |
Posted: Wed Apr 23, 2003 10:44 am Post subject: |
|
|
Novice
Joined: 22 Apr 2003 Posts: 15
|
NO matter how u map the fields, they appear in the order of the phsical structure u created.. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 23, 2003 11:20 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
To follow up on what RamVijayawada said,
Yes. Fields are added in the order of your ESQL statements. |
|
Back to top |
|
 |
pfaulkner |
Posted: Wed Apr 23, 2003 12:02 pm Post subject: |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
Jeff, sounds like you are disagreeing with RamVijayawada.
I did run a test and added a trace node, it does appear that the order matches the ESQL and not the physical structure defined in the MRM. |
|
Back to top |
|
 |
RamVijayawada |
Posted: Wed Apr 23, 2003 12:17 pm Post subject: |
|
|
Novice
Joined: 22 Apr 2003 Posts: 15
|
Trace is controlled by the esql, u see what u write in the esql thatz what trace is, but actually it appears as the physical structure, The only way to change the order is by using REORDER Option... |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 23, 2003 1:26 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Maybe I am disagreeing with RamVijayawada, but only if I misunderstand what he's saying.
My understanding is that the order defined on the types and elements in the MRM is used for parsing the data as it comes out of the bitstream and into the logical message tree. The order of elements in the logical message tree is then used while rebuilding the bitstream on output.
The order of the elements in the logical message tree is determined by ESQL. Fields are stored relative to other fields by how you create them.
Code: |
Set OutputRoot.MRM.Field.B = '2';
Set OutputRoot.MRM.Field.A = '1'; |
will create a bitstream like '21', because you have created A as the NEXTSIBLING of B.
Of course, you can also reorder the tree before output, using a variety of techniques. But the WMQI system is not going to use the MRM model to reorder your tree for you. |
|
Back to top |
|
 |
pfaulkner |
Posted: Wed Apr 23, 2003 1:34 pm Post subject: |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
So based on what you explained....
If I had an MRM defined as follows:
FieldA
FieldB
FieldC
And in my Compute node I mapped as follows:
Set OutputRoot.MRM.FieldA = '1';
Set OutputRoot.MRM.FieldC = '2';
What if I always wanted to include FieldB but it's value should always be ' '. I assume I cannot just create a default value for my Element in the message set and assume it will be populated when rebuilding the output stream????
Would I always need to use code as follows?
Set OutputRoot.MRM.FieldA = '1';
Set OutputRoot.MRM.FieldB = ' ';
Set OutputRoot.MRM.FieldC = '2'; |
|
Back to top |
|
 |
kirani |
Posted: Wed Apr 23, 2003 1:37 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Broker will reorder your elements in the tree if you set the Type composition property of your Compound type to Unordered Set. Please see the following thread for more details:
http://www.mqseries.net/phpBB2/viewtopic.php?t=6653&highlight=composition _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
|