Author |
Message
|
sri_csee1983 |
Posted: Wed Apr 09, 2008 2:19 am Post subject: Mapping a null value to a CWF Output |
|
|
 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 |
|
 |
Vitor |
Posted: Wed Apr 09, 2008 2:29 am Post subject: Re: Mapping a null value to a CWF Output |
|
|
 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 |
|
 |
sri_csee1983 |
Posted: Wed Apr 09, 2008 2:32 am Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Wed Apr 09, 2008 2:39 am Post subject: |
|
|
 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 |
|
 |
Gaya3 |
Posted: Wed Apr 09, 2008 2:40 am Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Wed Apr 09, 2008 2:45 am Post subject: |
|
|
 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 |
|
 |
sri_csee1983 |
Posted: Wed Apr 09, 2008 2:51 am Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Wed Apr 09, 2008 2:58 am Post subject: |
|
|
 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 |
|
 |
sri_csee1983 |
Posted: Wed Apr 09, 2008 3:01 am Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Wed Apr 09, 2008 3:03 am Post subject: |
|
|
 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 |
|
 |
sri_csee1983 |
Posted: Wed Apr 09, 2008 3:20 am Post subject: |
|
|
 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 |
|
 |
Gaya3 |
Posted: Wed Apr 09, 2008 3:33 am Post subject: |
|
|
 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 |
|
 |
sri_csee1983 |
Posted: Wed Apr 09, 2008 4:54 am Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Wed Apr 09, 2008 5:12 am Post subject: |
|
|
 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 |
|
 |
kimbert |
Posted: Wed Apr 09, 2008 5:59 am Post subject: |
|
|
 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 |
|
 |
|