Author |
Message
|
srindies |
Posted: Sat Feb 04, 2006 2:16 am Post subject: Problem in setting "Nillable" property in message |
|
|
Apprentice
Joined: 06 Jan 2006 Posts: 28
|
Hi All,
I have been working on converting XML Messages to Fixed Length(FL) messages. I extracted XML message definition from XML Schema and manually defined FL Message format. Some XML elements can be blank and I need to catch it in FL and set blank space instead of value. I have set "Nillable" property to True but it didnt work. I was also trying to populate blank characters in Default field so mapper could pick default values from it. But, none of my solution working. I have copied error message below ..
Quote: |
( WBRK_BRKR.Execution_Group1 ) MTI internal error: diagnostic information 'An element should contain a valid value exists on the tree without a value'. |
I have used trace node and understood the flow. It is normal and also got the error element. But, How to make an element 'Nillable'?
Sample Definition:
Quote: |
<xsd:element default=" " name="FifthName_Arabic"
nillable="true" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep justification="leftJustify"
length="16" messageSetDefaultRep="TDS" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
|
Mapping ESQL:
Quote: |
SET OutputRoot.MRM.FifthName_Arabic = InputRoot.MRM.Body.ExpatPersonalDetails.ExpatNameArabic.FifthName;
|
Thanks in advance,
Sridhar H |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Feb 04, 2006 6:08 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
In general, you need to set the value to NULL.
You appear to be modelling your XML - there are NULL handling properties you can set that will instruct the MRM when parsing your input that when a field has blanks, it should be turned to NULL in the logical tree. And likewise for the output you can instruct the parser to replace a logical NULL with spaces.
You may have to use the VALUE clause on the SET to instruct ESQL to create an element that contains a NULL value rather than not creating an element. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
srindies |
Posted: Sat Feb 04, 2006 7:43 am Post subject: |
|
|
Apprentice
Joined: 06 Jan 2006 Posts: 28
|
I am afraid I couldnt get your explanation jefflowrey. Let me make my requirement clear. Following ESQL code will serve my requirement.
Quote: |
IF InputRoot.MRM.Body.ExpatPersonalDetails.ExpatNameArabic.FifthName IS NULL OR InputRoot.MRM.Body.ExpatPersonalDetails.ExpatNameArabic.FifthName = ' ' THEN
SET OutputRoot.MRM.FifthName_Arabic = ' ';
ELSE
SET OutputRoot.MRM.FifthName_Arabic = InputRoot.MRM.Body.ExpatPersonalDetails.ExpatNameArabic.FifthName;
END IF; |
But, I dont prefer to use this as I am sure some options are available in MB to cater my requirement. I am a newbie here and hope above explanations would be useful.
Thanks & Regards,
Sridhar H |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Feb 04, 2006 9:05 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
srindies |
Posted: Sun Feb 05, 2006 12:59 am Post subject: |
|
|
Apprentice
Joined: 06 Jan 2006 Posts: 28
|
Hi jefflowrey,
I am still not able to fix that problem with the above solutions. Let me explain my new definitions here.
Lets assume, I have an input node, compute node and output node. Input message is in XML format and required output message in FL. I have set following properties in XML Messageset definition.
Encoding Numeric Null: NULLValue
Encoding Numeric Null Value: '0'
Encoding Non-Numeric Null: NULLValue
Encoding Non-Numeric Null Value: '0'
Quote: |
If you set Encoding Null Num to NULLEmpty, this is equivalent to setting Encoding Null Num to NULLValue and Encoding Null Num Val to "". |
Sample Input Message:
Quote: |
<ExpatNameArabic><FirstName>XXXX</FirstName><SecondName>QW</SecondName><ThirdName>WE</ThirdName><FourthName>ER</FourthName><FifthName></FifthName><LastName>YYYY</LastName><ExpatNameArabic> |
I assume during runtime above sample message is parsed and FifthName will be populated by '0'.
In that case, My input message before compute node should be parsed with the Encoding Non-Numeric Null Value. But, My trace is still making FifthName as blank.
Quote: |
(0x01000015):ExpatNameArabic = (
(0x03000015):FirstName = 'XXXX'
(0x03000015):SecondName = 'QW'
(0x03000015):ThirdName = 'WE'
(0x03000015):FourthName = 'ER'
(0x01000015):FifthName =
(0x03000015):LastName = 'YYYY'
)
|
I am afraid I have done mistake and not configuring properly. Thanks for your support.
Regards,
Sridhar H |
|
Back to top |
|
 |
kimbert |
Posted: Mon Feb 06, 2006 2:04 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Almost right...try this:
Encoding Non-Numeric Null: NULLEmpty
Encoding Non-Numeric Null Value: Not applicable
FifthName is (presumably) a string, so the 'Encoding Numeric' properties are not relevant.
Before you ask, the Encoding Null properties are describing what a null looks like physically (that's why the settings are on the physical format). In your case, a null value for a string appears as an empty string. |
|
Back to top |
|
 |
srindies |
Posted: Mon Feb 06, 2006 10:19 pm Post subject: |
|
|
Apprentice
Joined: 06 Jan 2006 Posts: 28
|
Thanks Kimbert,
I started using COALESCE function for my conversion. I prefer this for the maintenance and enhancement team. They will take over our complete environment soon. There could be novice users and I don’t want to make it complicated for them.
Quote: |
SET OutputRoot.MRM.FifthName_Arabic = COALESCE(InputRoot.MRM.Body.ExpatPersonalDetails.ExpatNameArabic.FifthName,' ');
|
Thanks,
Sridhar H |
|
Back to top |
|
 |
|