Author |
Message
|
lung |
Posted: Thu Nov 28, 2002 1:56 am Post subject: Default values in Trace |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Whenever a message passes thru a trace node, we will see the contents of the message, right?
But NOT the default values (if you define any in the MRM).
For example, I'm building an MRM-CWF message which have 3 fields. The first field will be taken from the input message (inputbody) whilst the 2 other fields will be generated automatically based on the default values defined in the MRM. I then place a trace node just before the output node.
The trace file is showing only the first field, and not the 2 other fields. However, in the output queue, all three fields are there.
Is there anyway to see default values in the trace files? _________________ lung |
|
Back to top |
|
 |
Ian |
Posted: Thu Nov 28, 2002 2:28 am Post subject: |
|
|
Disciple
Joined: 22 Nov 2002 Posts: 152 Location: London, UK
|
Hi Lung,
There are two concepts here, the message tree and the bitstream.
MRM default values are only applied to the bitstream at the time the message is rendered (MQOutput node) and as such you will not see these in the message tree.
Your observation here is the correct behaviour and as such is 'working as designed'.
In answer to your question : No
Quote: |
Is there anyway to see default values in the trace files? |
_________________ Regards, Ian |
|
Back to top |
|
 |
lung |
Posted: Thu Nov 28, 2002 5:08 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Thanks, Ian.
So is there any way that I can view the message with the default values in WMQI? (not thru the queue)
Thanks again. _________________ lung |
|
Back to top |
|
 |
Ian |
Posted: Mon Dec 02, 2002 2:33 am Post subject: |
|
|
Disciple
Joined: 22 Nov 2002 Posts: 152 Location: London, UK
|
Hi Lung,
It is my understanding that there are only two ways to view the default values for MRM messages :
1. Via the logical model : check the messageset definition to see the assigned defaults values.
2. Via the physical output : check the bitstream after the message is rendered via MQOutput node (the message on the MQSeries queue)
Therefore I think the answer to your question is No. _________________ Regards, Ian |
|
Back to top |
|
 |
tchagan |
Posted: Mon Dec 02, 2002 4:53 am Post subject: |
|
|
 Apprentice
Joined: 10 Feb 2002 Posts: 31
|
Hi,
try using the ResetContentDescriptor node, this will render your output to MRM within the flow, then you can view in your trace node.
Terry |
|
Back to top |
|
 |
Ian |
Posted: Mon Dec 02, 2002 5:43 am Post subject: |
|
|
Disciple
Joined: 22 Nov 2002 Posts: 152 Location: London, UK
|
Hi Terry,
I had consider this as an option but do not think this will work ...
Re-reading my previous post, this should have more accurately read : "MRM default values are only applied to the bitstream at the time a new message is rendered"
This is because ResetContentDescriptor node :
-> takes original input bitstream and reparses using a diffrent message template
-> it does not take the logical representation (message tree) and reparse it into a new bitstream
Refer to Websphere MQ Integrator Version 2.1 - Using the Control Center Guide :
Appendix A. The IBM Primitive nodes
Quote: |
The ResetContentDescriptor node takes the bit stream of the input message
and reparses it using a different message template and either the same or a
different parser. The node can reset any combination of message domain,
set, type, and format.
|
Quote: |
It is important to note that the ResetContentDescriptor node does NOT:
-> Change the physical bit stream, only the way in which the bitstream is parsed in
WebSphere MQ Integrator.
|
Again, this is my understanding of how this works and if someone has implemented this and found that it works differently to this then I would be interested to hear about it  _________________ Regards, Ian |
|
Back to top |
|
 |
lung |
Posted: Mon Dec 02, 2002 9:47 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Well, usually I put the trace node before the output node... So if I put my trace node AFTER the output node, will I be able to read the default values then?  _________________ lung |
|
Back to top |
|
 |
kirani |
Posted: Mon Dec 02, 2002 9:51 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Lung,
Default values defined into MRM Messageset are used by MRM-Writer while writing out message bitstream to output queue. I believe, by adding Trace node after MQOutput node will not display the default values. _________________ 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 |
|
 |
lung |
Posted: Mon Dec 02, 2002 9:57 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Thanks, Kiran.
So is there anyway where I can view the bitstream? I'm sending my message to a queue that's residing on a different machine, and I cannot browse a remote queue, right? So how am I suppose to know whether my default values come out exactly the way I wanted... _________________ lung |
|
Back to top |
|
 |
kirani |
Posted: Mon Dec 02, 2002 10:04 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Hi Lung,
You can look at bitstream on output queue only.
Since your output queue is remote queue, you will have to use some utility (MQSeries Explorer, MQJExploer, etc.) to look at local queue on remote machine. In test environment you could write a copy of your output message to some local queue and verify the bitstream. _________________ 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 |
|
 |
lung |
Posted: Tue Dec 03, 2002 5:28 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
The bitstream will not come out as nice as in the trace files (with each field identified even if it's CWF)
Anyway, thanks Kiran! _________________ lung |
|
Back to top |
|
 |
Ian |
Posted: Thu Dec 05, 2002 8:20 am Post subject: |
|
|
Disciple
Joined: 22 Nov 2002 Posts: 152 Location: London, UK
|
Hi Lung,
I have given this some more thought and have come up with two solutions.
Solution 1:
Overview :
Use the new ASBITSTREAM function (available in CSD03) in conjuction with CREATE LASTCHILD.
The WMQIv2.1 ESQL Reference Manual does not appear to have been refreshed at CSD03 but the README alludes to this new function :
Quote: |
ASBITSTREAM function: This function allows the user to get a bitstream for any arbitrary subtree of a message.
|
Detail :
Messageset definition :
Code: |
myElement1 defined as STRING datatype, LENGTH of 10, default value of '1111111111'
myElement2 defined as STRING datatype, LENGTH of 10, default value of '2222222222'
myElement3 defined as STRING datatype, LENGTH of 10, default value of '3333333333'
myElement4 defined as STRING datatype, LENGTH of 10, default value of '4444444444'
myElement5 defined as STRING datatype, LENGTH of 10, default value of '5555555555'
|
Assume the messageflow path is the same as the sequence I have detailed the nodes below ...
Compute node 1 :
Code: |
DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputRoot.Properties.MessageDomain = 'MRM';
SET OutputRoot.Properties.MessageSet = 'DRNFVGS07G001';
SET OutputRoot.Properties.MessageType = 'myMessage';
SET OutputRoot.Properties.MessageFormat = 'CWF';
-- CREATE ONLY THE FIRST ELEMENT
SET OutputRoot.MRM.myElement1 = '1234567890';
|
Trace node 1 :
Code: |
(0x1000021)MRM = (
(0x300000B)myElement1 = '1234567890'
)
|
Compute node 2 :
Code: |
DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
-- STEP 1
DECLARE outputMsgBlob BLOB;
SET outputMsgBlob = ASBITSTREAM( InputRoot.MRM,InputRoot.MQMD.Encoding,InputRoot.MQMD.CodedCharSetId,'DRNFVGS07G001','myMessage','CWF', RootBitStream);
-- STEP 2
CREATE LASTCHILD OF OutputRoot DOMAIN('MRM') PARSE(outputMsgBlob,InputRoot.MQMD.Encoding,InputRoot.MQMD.CodedCharSetId, 'DRNFVGS07G001','myMessage','CWF');
|
Trace node 2 :
Code: |
(0x1000021)MRM = (
(0x300000B)myElement1 = '1234567890'
(0x300000B)myElement2 = '2222222222'
(0x300000B)myElement3 = '3333333333'
(0x300000B)myElement4 = '4444444444'
(0x300000B)myElement5 = '5555555555'
)
|
Cool
Solution 2:
Overview :
Modify your messageflow to use a temporary queue which will effectively see the bitstream rendered and then read by another input node and then any following trace nodes will see the MRM default values applied.
Detail :
Messageflow :
MQInput -> Compute (create MRM msg) -> Trace 1 -> MQQutput (queue="TEMP")
MQInput (queue="TEMP", default"set Domain, Set, Type and Format")-> Trace 2 -> MQQutput
You will see you MRM default values applied in Trace 2 (the same as per solution 1 above)  _________________ Regards, Ian |
|
Back to top |
|
 |
lung |
Posted: Sun Dec 08, 2002 4:47 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Hi Ian,
Those are really good solutions... But as for solution-1, I was wondering if the overall msg format of the output msg will be changed? Since you're creating a new element in the msg? (CREATE LASTCHILD?) _________________ lung |
|
Back to top |
|
 |
kolban |
Posted: Sun Dec 08, 2002 8:24 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Yes, I would say that the message tree will be changed ... but if you don't want that, direct the parsed tree to somewhere else such as
Code: |
CREATE LASTCHILD OF LocalEnvironment DOMAIN('MRM') PARSE outputMsgBlob,InputRoot.MQMD.Encoding,InputRoot.MQMD.CodedCharSetId, 'DRNFVGS07G001','myMessage','CWF');
|
|
|
Back to top |
|
 |
lung |
Posted: Mon Dec 09, 2002 4:44 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Thanks, Kolban! Putting it into LocalEnvironment... Never thought of that  _________________ lung |
|
Back to top |
|
 |
|