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 » Mapping a null value to a CWF Output

Post new topic  Reply to topic Goto page 1, 2  Next
 Mapping a null value to a CWF Output « View previous topic :: View next topic » 
Author Message
sri_csee1983
PostPosted: Wed Apr 09, 2008 2:19 am    Post subject: Mapping a null value to a CWF Output Reply with quote

Centurion

Joined: 25 Mar 2008
Posts: 125
Location: Chennai,India

Dear Friends,

I am mapping an XML to a CWF file. My flow works well If i have values for all the tags in the XML file. But if any of the tags contains NULL inside it. It throws error stating "An element should contain a valid value exists on the tree without a value". Actually I shud send back this null value to the CWF file. Is that possible. If so how, plz let me know.
_________________
With Cheers,
Sri
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Vitor
PostPosted: Wed Apr 09, 2008 2:29 am    Post subject: Re: Mapping a null value to a CWF Output Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sri_csee1983 wrote:
Actually I shud send back this null value to the CWF file. Is that possible. If so how, plz let me know.


Yes. How you do you represent "null" in your CWF?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sri_csee1983
PostPosted: Wed Apr 09, 2008 2:32 am    Post subject: Reply with quote

Centurion

Joined: 25 Mar 2008
Posts: 125
Location: Chennai,India

Dear Vitor,

Just need send blank upto the fields length. say for eg Field1 is with length 5 in CWF and I get the XML value of CWF as null, I need to send 5 blank spaces, Since it is a fixed length format
_________________
With Cheers,
Sri
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Vitor
PostPosted: Wed Apr 09, 2008 2:39 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sri_csee1983 wrote:
Just need send blank upto the fields length.


Then define ESQL / mapping function to blank fill the target field when the input is null.

Simple.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Gaya3
PostPosted: Wed Apr 09, 2008 2:40 am    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

You can even set that using Message Set properties

Regards
Gayathri
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 09, 2008 2:45 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Gaya3 wrote:
You can even set that using Message Set properties


I had assumed the posted had tried that and failed, hence the post. I thought to offer an alternative that might be clearer to implement.

This could have been an error of judgement on my part.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sri_csee1983
PostPosted: Wed Apr 09, 2008 2:51 am    Post subject: Reply with quote

Centurion

Joined: 25 Mar 2008
Posts: 125
Location: Chennai,India

U mean, I need to check for each non mandatory elements,

if field null then set spaces or 00000 (if numeric). else set the value?
_________________
With Cheers,
Sri
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Vitor
PostPosted: Wed Apr 09, 2008 2:58 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sri_csee1983 wrote:
U mean, I need to check for each non mandatory elements,

if field null then set spaces or 00000 (if numeric). else set the value?


Either code as you see fit, or define the message set as you see fit.

It's a design choice for you to make. If all else fails, you could actually try one of the methods and see what happens.......
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sri_csee1983
PostPosted: Wed Apr 09, 2008 3:01 am    Post subject: Reply with quote

Centurion

Joined: 25 Mar 2008
Posts: 125
Location: Chennai,India

Dear Vitor / Gayathri,

What property in Message set will do that. Plz let me know.
_________________
With Cheers,
Sri
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Vitor
PostPosted: Wed Apr 09, 2008 3:03 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sri_csee1983 wrote:
What property in Message set will do that. Plz let me know.



_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sri_csee1983
PostPosted: Wed Apr 09, 2008 3:20 am    Post subject: Reply with quote

Centurion

Joined: 25 Mar 2008
Posts: 125
Location: Chennai,India

Dear Vitor / Gayathri,

In Message Set Properties, Under Physical Properties, CWF1 I have set Byte Allign Pad to Spaces, Policy of missing Elements use NULL values under Output Properties. Tried using Default also. What else shud I check. I dont know. Plz let me know
_________________
With Cheers,
Sri
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Gaya3
PostPosted: Wed Apr 09, 2008 3:33 am    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

There is some thing called Representation of null values in the message set.

Even it will be good if you search a bit.

It will help you to learn....what do you think, No Spoon Feeding.

Regards
Gayathri
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
sri_csee1983
PostPosted: Wed Apr 09, 2008 4:54 am    Post subject: Reply with quote

Centurion

Joined: 25 Mar 2008
Posts: 125
Location: Chennai,India

Dear Gayathri,

Ur spoon feed also didnt worked out. I tried all combinations thts present in XML NULL Value representations. None Worked out

NullAttribute,
NullEmpty,
NullValue,
NullElement,
NullValueAttribute. For both Numeric and Non Numberic Null

Nothing worked out. Still getting the same error
_________________
With Cheers,
Sri
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Vitor
PostPosted: Wed Apr 09, 2008 5:12 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sri_csee1983 wrote:
Nothing worked out. Still getting the same error


Then there are 2 possibilities:

1) There's another combination you've not tried
2) There's a bug in the software preventing this working & you should raise a PMR.

I have an opinion about which is more likely, but I've been proved wrong on that recently so it remains nothing but an opinion.

How does the message set documentation say you can achieve this?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Apr 09, 2008 5:59 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

The null handling support in the MRM parser does two things:
- When parsing, MRM parser creates elements with the logical value NULL when the input value matches the null handling specification
- When writing, MRM parser outputs a null physical value when the logical value in the message tree is NULL.

You can also set the value of an element to NULL using ESQL:
Code:
SET OutputRoot.MRM.myMessage.myField VALUE = NULL;

However, you should only do that if the MRM parser is unable to do it for you automatically.

You seem to be wanting a 'NullMissing' option, but there is no such option. You can handle missing elements in CWF using by assigning default values to them in the message definition.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Mapping a null value to a CWF 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.