Author |
Message
|
EAIMBGuy |
Posted: Thu Sep 20, 2007 1:21 am Post subject: XML to TDS mapping uing esql - Output message has no values |
|
|
Newbie
Joined: 20 Sep 2007 Posts: 5
|
Hi All,
Need some MB help. Below is the scenario I am working on.
I have to do a translation from xml to csv type out put. So in MB, I have defined a input message set of xml type and output message set of TDS type. I am using esql in compute node to do this mapping/translation. In compute node I am doing the following -
OutputRoot.Propererties.MessageDomain = 'MRM';
OutputRoot.Propererties.MessageIdentifier = 'Message Id';
OutputRoot.Propererties.MessageForamt = 'TDS';
OutputRoot.Propererties.MesageType = 'OutPutMessage';
And after this I am reading the xml conent and assigning them to the Output Message as follows. (Infact my mapping involves more than 70 fields on either sides and I have to use esql only for mapping) -
OutputRoot.MRM.OutPutMessage.Field1 = InputRoot.XML.Root.Field1;
OutputRoot.MRM.OutPutMessage.Field2 = InputRoot.XML.Root.Field2;
OutputRoot.MRM.OutPutMessage.Field3 = InputRoot.XML.Root.Field3;
OutputRoot.MRM.OutPutMessage.Field4 = InputRoot.XML.Root.Field4;
Infact when I do debug using debugger, I can see These assignments being hapening properly. This can be seen when I come out of the Compute node and being there below MRM -> OutPutMessage section of the debugger.
But, when this output message is put to Queue .. I see -
1. The complete structure of the Output message
2. But the values in each field is not the ones that were assigned in the compute node. But ones those are set as default values those are defined in the output message set.
I am not getting any errors or exceptions.
So I am not sure what could be missing in my Compute node esql code. Need your help on the same at the earliest.
Appreciate ur help.
Thanks and Regards
EAIMBGuy
Last edited by EAIMBGuy on Thu Sep 20, 2007 1:44 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Thu Sep 20, 2007 1:29 am Post subject: Re: XML to TDS mapping uing esql - Output message has no val |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
EAIMBGuy wrote: |
Outputroot.MRM.OutPutMessage.Field1 = Inputroot.Root.Field1;
Outputroot.MRM.OutPutMessage.Field2 = Inputroot.Root.Field2;
Outputroot.MRM.OutPutMessage.Field3 = Inputroot.Root.Field3;
Outputroot.MRM.OutPutMessage.Field4 = Inputroot.Root.Field4;
|
I'm surprised this works as you say it does in the debug. At least it should be InputRoot, and I would have expected InputRoot.XML (or if you're on v6 XMLNS). Or InputBody if it's modeled.
Post the output of the debug. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Sep 20, 2007 2:31 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I strongly suspect that your output message tree does not match your message definition. ( it may be very close, but it needs to match exactly ).
If you are on v6, there is a simple way to find the problem. Take a user trace - you will get a warning for each field which is 'self-defining' ( does not match the message definition ).
If you are on v5, set 'validation' to 'Content and value' on your output node.
You will get a validation error if the message tree does not match the definition. |
|
Back to top |
|
 |
EAIMBGuy |
Posted: Thu Sep 20, 2007 12:11 pm Post subject: |
|
|
Newbie
Joined: 20 Sep 2007 Posts: 5
|
Hi Kimbert,
I do not have any errors in Tracel Log. Below is the snippet of my trace log-
2007-09-20 09:47:42.191001 16368 UserTrace BIP2539I: Node 'TDSMessageFLow.MessageToOutput': Evaluating expression ''rowRecordSet.*:*[1].stockcode'' at ('.TDSMessageFLow_MessageToOutput.CopyEntireMessage', '44.53'). This resolved to ''rowRecordSet.*:*[1].stockcode''. The result was ''ROW... Root Element Type=50331648 NameSpace='' Name='stockcode' Value='0T1380037'''.
2007-09-20 09:47:42.191001 16368 UserTrace BIP2568I: Node 'TDSMessageFLow.MessageToOutput': Copying sub-tree from ''rowRecordSet.*:*[1].stockcode'' to ''OutputRoot.MRM.RepairOrder_Output.Customer''.
2007-09-20 09:47:42.191001 16368 UserTrace BIP2537I: Node 'TDSMessageFLow.MessageToOutput': Executing statement ''SET OutputRoot.MRM.RepairOrder_Output.Address = rowRecordSet.*:*[1].kva;'' at ('.TDSMessageFLow_MessageToOutput.CopyEntireMessage', '45.4').
2007-09-20 09:47:42.191001 16368 UserTrace BIP2539I: Node 'TDSMessageFLow.MessageToOutput': Evaluating expression ''rowRecordSet.*:*[1].kva'' at ('.TDSMessageFLow_MessageToOutput.CopyEntireMessage', '45.52'). This resolved to ''rowRecordSet.*:*[1].kva''. The result was ''ROW... Root Element Type=50331648 NameSpace='' Name='kva' Value=37''.
2007-09-20 09:47:42.191001 16368 UserTrace BIP2568I: Node 'TDSMessageFLow.MessageToOutput': Copying sub-tree from ''rowRecordSet.*:*[1].kva'' to ''OutputRoot.MRM.RepairOrder_Output.Address''.
2007-09-20 09:47:42.191001 16368 UserTrace BIP2537I: Node 'TDSMessageFLow.MessageToOutput': Executing statement ''SET OutputRoot.MRM.RepairOrder_Output.AccountNumber = rowRecordSet.*:*[1].connection_code;'' at ('.TDSMessageFLow_MessageToOutput.CopyEntireMessage', '46.4').
2007-09-20 09:47:42.191001 16368 UserTrace BIP2539I: Node 'TDSMessageFLow.MessageToOutput': Evaluating expression ''rowRecordSet.*:*[1].connection_code'' at ('.TDSMessageFLow_MessageToOutput.CopyEntireMessage', '46.58'). This resolved to ''rowRecordSet.*:*[1].connection_code''. The result was ''ROW... Root Element Type=50331648 NameSpace='' Name='connection_code' Value='ABC'''.
2007-09-20 09:47:42.191001 16368 UserTrace BIP2568I: Node 'TDSMessageFLow.MessageToOutput': Copying sub-tree from ''rowRecordSet.*:*[1].connection_code'' to ''OutputRoot.MRM.RepairOrder_Output.AccountNumber''.
2007-09-20 09:47:42.191001 16368 UserTrace BIP2537I: Node 'TDSMessageFLow.MessageToOutput': Executing statement ''RETURN TRUE;'' at ('.TDSMessageFLow_MessageToOutput.Main', '5.3').
2007-09-20 09:47:42.191001 16368 UserTrace BIP4007I: Message propagated to 'out' terminal of node 'TDSMessageFLow.MessageToOutput'.
2007-09-20 09:47:42.769001 16368 UserTrace BIP2638I: The MQ output node 'TDSMessageFLow.OQueue' attempted to write a message to queue ''R.OUTQ'' connected to queue manager ''QM1''. The MQCC was '0' and the MQRC was '0'.
2007-09-20 09:47:42.769001 16368 UserTrace BIP2622I: Message successfully output by output node 'TDSMessageFLow.OQueue' to queue ''R.OUTQ'' on queue manager ''QM1''. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Sep 20, 2007 12:21 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You are on v6, right? ( just checking, as you didn't actually say so )
Default values are applied when
- the Data Element Separation of the parent structure is 'Fixed Length'
- the field is not in the message tree ( or is not in the correct place, which amounts to the same thing from the parser's point of view )
So - check that the members of each structure are in the correct order (i.e. in the order defined in the message definition ). |
|
Back to top |
|
 |
EAIMBGuy |
Posted: Thu Sep 20, 2007 1:53 pm Post subject: |
|
|
Newbie
Joined: 20 Sep 2007 Posts: 5
|
Hi,
Yes I am on V6.
Thanks and Regards
EAIMBGuy |
|
Back to top |
|
 |
EAIMBGuy |
Posted: Thu Sep 20, 2007 2:39 pm Post subject: |
|
|
Newbie
Joined: 20 Sep 2007 Posts: 5
|
Hi kimbert,
When u say check for the order, do u mean to say I must map in the order the fields are created in message set? Also, can I ignore mapping/assigning if the output field is not supposed to be mapped.
Thanks and Regards
EAIMBGuy |
|
Back to top |
|
 |
kimbert |
Posted: Thu Sep 20, 2007 4:15 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
When u say check for the order, do u mean to say I must map in the order the fields are created in message set? |
Yes, I'm afraid so. If you change the 'Composition' property of all your complex types/groups from 'Sequence' to 'UnorderedSet' then WMB will automatically re-order the fields as it writes them...but this will increase CPU usage and may reduce your message throughput quite a lot.
Quote: |
Also, can I ignore mapping/assigning if the output field is not supposed to be mapped. |
Your output message tree should contain every field defined in the message set, in the order defined in the message set. If a field is not in the message tree it will be assigned a default value from the message set. If no default value has been defined, a parsing exception will be thrown. |
|
Back to top |
|
 |
EAIMBGuy |
Posted: Thu Sep 20, 2007 5:07 pm Post subject: |
|
|
Newbie
Joined: 20 Sep 2007 Posts: 5
|
Hi All,
Thanks for ur help. It is working now.
I am supposed to assign as below. Here was the misake -
Outputroot.MRM.OutPutMessage.Field1 = Inputroot.Root.Field1;
Outputroot.MRM.OutPutMessage.Field2 = Inputroot.Root.Field2;
Outputroot.MRM.OutPutMessage.Field3 = Inputroot.Root.Field3;
Outputroot.MRM.OutPutMessage.Field4 = Inputroot.Root.Field4;
Thanks and Regards
EAIMB Guy |
|
Back to top |
|
 |
|