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 » MRM: Setting Integer element to allow nulls

Post new topic  Reply to topic
 MRM: Setting Integer element to allow nulls « View previous topic :: View next topic » 
Author Message
catwood2
PostPosted: Mon Jun 14, 2004 2:21 pm    Post subject: MRM: Setting Integer element to allow nulls Reply with quote

Centurion

Joined: 17 May 2002
Posts: 108

Hi,
WMQI 2.1 CSD6

Can I set an message element, that is defined as an integer type, to allow nulls?
It is defaulting nulls to "0" on output. I can understand why - but not sure if there is a way I can tweak that. The only null property I see is on the message set itself ("Default Null Value Permitted") and even after going thru the Working with Messages manual having difficulty figuring out what that property does.

Tried setting the nillable attribute in the schema imported...no luck.
thoughts appreciated.
Back to top
View user's profile Send private message
bpugh
PostPosted: Tue Jun 15, 2004 5:21 am    Post subject: Reply with quote

Novice

Joined: 27 Apr 2004
Posts: 24
Location: St. Louis, MO

Have you tried setting the Padding Character to "NUL"? I'm using the V5.0.2 toolkit and when I click on an element in a message set, then click on Properties, underneath Physical Properties click on Local Element and you can change the padding character to zeros, spaces, or null. Might be worth a shot. This has helped me out in the past.

Bob
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jun 15, 2004 11:46 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You don't say what your output format is - I'll assume that it is XML.
XML null handling is controlled at the Message Set level. You need to go to the XML properties of the message set, and set the 'Encoding Numeric Null' and 'Encoding Numeric Null Value' properties. When the element's value matches the value in 'Encoding Numeric Null Value' it will do whatever you have said in the 'Encoding Numeric Null' option...but you don't say what you want to see on the output, so I can't be more specific than that.
You will also need to add a 'Null Permitted' value constraint to each nullable element in your model, or else set the 'Default Null Permitted' flag on the message set.
Back to top
View user's profile Send private message
catwood2
PostPosted: Tue Jun 15, 2004 2:00 pm    Post subject: Reply with quote

Centurion

Joined: 17 May 2002
Posts: 108

Thanks for the pointers.

Output format is XML.

The desire is that when empty tags passed thru flow that they remain empty for certain elements on output. Currently, the integer tags are being populated:
Incoming Tag:
Code:
<RequestorSeverity></RequestorSeverity>


Output Message Tag:
Code:
<RequestorSeverity>0</RequestorSeverity>


and I would like
Code:
<RequestorSeverity></RequestorSeverity>


I went to the MessageSet level and attempted to set the properties on the XML tab for Null Encoding as recommended. I went to 'Working with Messages' manual to attempt to get a feel for how to populate. Didn't get much of a feel and also noticed that each of those property descriptions ended with the line:
Quote:
(This property is reserved for future use.)


Is my version an issue (WMQI2.1 csd6)?

Maybe my attempt at configuring:

MessageSet XML Tab
Encoding Null Num: NullElement
Encoding Null Num Value: xsi:nil

MessageSet Tab
Default Null Permitted at No

Element level:
Added value constraint of null permitted to the elements in question.

Thanks for any thoughts.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jun 16, 2004 8:01 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Don't hold me to this, but I think this is what you need. Give it a try, and let me know what happened:

Encoding Null Numeric : NullEmpty
Encoding Null Numeric Value : Not applicable

This should mean that when the input tags are empty, the value of the node (not the node itself) is set to null by the parser. On output, that null value in the tree will be written to the output bitstream as empty tags.

If you find that your output tree contains '0' (zero) rather than null, perhaps because your message flow has changed the tree, use

Encoding Null Numeric : NullValue
Encoding Null Numeric Value : 0

Your use of the NullPermitted value constraint is correct.
Back to top
View user's profile Send private message
catwood2
PostPosted: Wed Jun 16, 2004 8:40 am    Post subject: Reply with quote

Centurion

Joined: 17 May 2002
Posts: 108

Kimbert-
Thanks! Indeed that did the trick. Greatly appreciate it!
Back to top
View user's profile Send private message
catwood2
PostPosted: Thu Jun 17, 2004 8:38 am    Post subject: Reply with quote

Centurion

Joined: 17 May 2002
Posts: 108

As I am going thru some testing of MRM validation, I am wondering why the parser didn't choke on the empty elements? If null was not permitted - shouldn't this have generated an exception when validation was performed? And, of course, I have some elements where I am trying to do that - get a parser error when an element is null.
I did make an attempt by providing the Null Permitted constraint to the element and setting the value to 'false'....but, I don't think i'm grasping these properties when creating the constraint....off to do some more reading.
Back to top
View user's profile Send private message
catwood2
PostPosted: Thu Jun 17, 2004 10:41 am    Post subject: Reply with quote

Centurion

Joined: 17 May 2002
Posts: 108

Well, I can generate the exception if I place a MinLength constraint of 1 on the element...but it still seems the Null settings are not working (or, likely, brain not grasping)?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MRM: Setting Integer element to allow nulls
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.