ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to use default value for output

Post new topic  Reply to topic
 How to use default value for output « View previous topic :: View next topic » 
Author Message
Yanghui
PostPosted: Tue May 20, 2003 2:54 am    Post subject: How to use default value for output Reply with quote

Disciple

Joined: 08 May 2002
Posts: 151
Location: Dublin, Ireland

Hi,

I am using WMQI2.1+CSD4 on NT. I just can't make the default value show up in the output by using MRM (XML physical layer). Does anyone know what I am missing? Is there any switch to have default value take effect?

Thanks a lot in advance.

-Yanghui
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Tue May 20, 2003 7:32 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Please make sure your Element/Attribute is not defined as optional.
_________________
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
View user's profile Send private message Visit poster's website
Yanghui
PostPosted: Wed May 21, 2003 12:24 am    Post subject: Reply with quote

Disciple

Joined: 08 May 2002
Posts: 151
Location: Dublin, Ireland

Hi,

Thanks for your reply.

I did setup min occurs of the element as 1 in the Connection tag. I tried to switch Repeat to Yes as well, which made no difference.

The interesting thing is that the default value does show up if I use CWF format for output instead of XML. So, probably it just doesn't work for XML. Can anybody confirm this?

This function could be very useful. In my case, both input and output msgs are in XML. The output XML format is quite complex with few fields mapped from the input msg. I am wondering if I can let MRM to generate most XML layout with default value meanwhile using ESQL to do the few mapping in one Compute node. It's just not pleasent to have a lot of Set statements for lots of static data.

Regards
-Yanghui
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Thu May 22, 2003 4:17 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

I guess then this constraint is not enforced by the broker for XML wire format. Try posting this question in IBM newsgroup to get a confirmed answer.
_________________
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
View user's profile Send private message Visit poster's website
drajib
PostPosted: Fri May 23, 2003 1:56 am    Post subject: Reply with quote

Apprentice

Joined: 25 Mar 2003
Posts: 42
Location: India

Hi Yanghui,

I encountered a similar situation with TDS format. The default values didn't get populated in the output message.

As Kiran has metioned, this default value constraint probably is not enforced by the broker on formats other than CWF.

Regards
Back to top
View user's profile Send private message
kirani
PostPosted: Fri May 23, 2003 9:25 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

I think it will also work if the data element separation is set to Fixed Length in TDS wire format.
_________________
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
View user's profile Send private message Visit poster's website
Craig B
PostPosted: Wed Jun 18, 2003 3:48 am    Post subject: Reply with quote

Partisan

Joined: 18 Jun 2003
Posts: 316
Location: UK

The MRM parsers only use the default values when they need to maintain byte order in the bitstream. The MRM parser needs to do this in fixed length environments when fields cannot be missed out because the bytes would subsequently be allocated to the wrong fields should the message be reparsed. For example, in MRM-CWF if there were two STRING fields (field1 and field2) both with a length of 5. Then it would not be possible to create a message tree that just contained field2. Should the following ESQL be coded :

Code:

SET OutputRoot.MRM.field2 = 'ABCDE';


Then a bitstream of ABCDE could not be created because if this was reparsed then ABCDE would be allocated to field1 and not field2. Ie, there is no metadata in the message to indicate field ordering, the sequence of bytes determines the field order allocation. Therefore in such cases, the MRM parser will make use of default values (if defined) to ensure a message biststream is created that maintains its order.

When using XML, then there are no fixed lengths and field allocation is not done based on sequence of bytes. Tags can be extracted from the message and if MRM-XML is used, then these tags can be matched to fields in the message definitions. If we go back to the previous example, then if we used that ESQL, then this would produce a bitstream <Message><field2>ABCDE</field2></Message> . If this message were reparsed then ABCDE could be matched to field2 in the message due to the tag, and the parser can deduce that field1 was omitted. Therefore there was no need to write the field1 tag into the message using the default value. Hence default values are not used on the MRM-XML physical format.

So to summarise, MRM default values are only written when there is a need to write them due to bitstream sequencing. Therefore, MRM default values will only be used with CWF and on TDS. However, it will only be used on TDS for those data element separation types that support fixed length separation. Ie : Fixed length, Variable Length Elements Delimited where a length has been specified in field, Tagged Fixed Length, Tagged Encoded Length etc.

And finally, just to confuse things completely .... it should also be noted that before CSD03, default values were not working on TDS, and reading the memo.ptf, it seems that this was corrected in CSD03 under reference number 25178.
_________________
Regards
Craig
Back to top
View user's profile Send private message
michaelpatton
PostPosted: Mon Sep 13, 2004 12:52 pm    Post subject: Building a default XML message from the model Reply with quote

Apprentice

Joined: 21 May 2002
Posts: 25
Location: East Coast USA

Based on Craig's update above, it is then possible to add a CWF format layer to the message set, and build the message using nothing but the default values, then reparse that message in the XML layer.
It should be noted though, that you will have to add an extra field at the very end of the tree in the first pass to force all the previous elements to use their default values. But when reparsing the message into XML, you can set that field to NULL.
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to use default value for output
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.