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 » Problem in setting "Nillable" property in message

Post new topic  Reply to topic
 Problem in setting "Nillable" property in message « View previous topic :: View next topic » 
Author Message
srindies
PostPosted: Sat Feb 04, 2006 2:16 am    Post subject: Problem in setting "Nillable" property in message Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Sat Feb 04, 2006 6:08 am    Post subject: Reply with quote

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
View user's profile Send private message
srindies
PostPosted: Sat Feb 04, 2006 7:43 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Sat Feb 04, 2006 9:05 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You have a message set that describes your input XML.

There are properties on the elements in that model that control how a blank or space filled physical element is turned into a logical element when the XML is parsed.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ad06720_.htm

You have a message set that describes your Output Fixed Length message.

There are also properties that control how a logical element that contains the NULL value is turned into spaces or etc. when the message set is rendered.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ad06830_.htm

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ad06250_.htm

One frequent difficulty people run into when working with NULl elements is that they do something like
Code:
set OutputRoot.MRM.MyElement = NULL;

This removes the MyElement field from the message tree, which is usually not what is wanted. Therefore, there is a clause that allows you to assign directly to the value of an element.
Code:
set OutputRoot.MRM.MyElement VALUE = NULL;

Then the element still exists in the logical message tree, and contains the NULL value.

Then the MRM will use the rules set up in the message set for handling NULL values to determine how to output a physical value for that element.
[/url]
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
srindies
PostPosted: Sun Feb 05, 2006 12:59 am    Post subject: Reply with quote

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
View user's profile Send private message
kimbert
PostPosted: Mon Feb 06, 2006 2:04 am    Post subject: Reply with quote

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
View user's profile Send private message
srindies
PostPosted: Mon Feb 06, 2006 10:19 pm    Post subject: Reply with quote

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
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 » Problem in setting "Nillable" property in message
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.