| Author | 
		  Message
		 | 
		
		  | mverh | 
		  
		    
			  
				 Posted: Tue May 28, 2002 6:32 am    Post subject: WMQI V2.1 CSD02 Reference Variables | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 06 Mar 2002 Posts: 97
  
  | 
		  
		    
			  
				Has anyone used reference variables when trying to populate an MRM message on output...I have a microflow that xforms a n XML input message to an MRM output message...it all works great...I then try to improve readability and hopefully performance by using a reference variable... 
 
 
Before:
 
 
SET "OutputRoot"."MRM"."MQ_HEADER_V1"."ACAI_STRUCT_ID" = 'ACAI';
 
 
===> works!
 
 
After:
 
 
DECLARE ref_ACAI REFERENCE TO "OutputRoot"."MRM"."MQ_HEADER_V1";
 
SET "ref_ACAI"."ACAI_STRUCT_ID" = 'ACAI';
 
 
===> fails!
 
 
Trace shows the following error:
 
 
RecoverableException  BIP2230E: Error detected whilst processing a message in node 'CUST.INQ.RQ.V0R0M1.CustomerInquireRequestQueue'. 
 
                                       The message broker detected an error whilst processing a message in node 'CUST.INQ.RQ.V0R0M1.CustomerInquireRequestQueue'. An exception has been thrown to cut short the processing of the message. 
 
                                       See the following messages for details of the error. 
 
2002-05-28 10:41:51.202999     2688   ParserException  BIP5354E: MTI internal error: diagnostic information 'parseRightSibling called before RefreshElementFromBitstream'. 
 
                                       An internal software error has occurred in the Message Translation Interface Parser. The diagnostic information associated with this message is: 'parseRightSibling called before RefreshElementFromBitstream'.
 
 
Thanks... _________________ Marc Verhiel
 
IBM Canada Ltd. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | zpat | 
		  
		    
			  
				 Posted: Tue May 28, 2002 7:06 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 19 May 2001 Posts: 5867 Location: UK 
  | 
		  
		    
			  
				| You can only reference existing elements, so use the CREATE or SET statement to make sure they exist before using a reference. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mverh | 
		  
		    
			  
				 Posted: Tue May 28, 2002 9:44 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 06 Mar 2002 Posts: 97
  
  | 
		  
		    
			  
				So would coding the following work:
 
 
DECLARE ref_ACAI REFERENCE TO "OutputRoot"."MRM"."MQ_HEADER_V1"; 
 
SET "OutputRoot"."MRM"."MQ_HEADER_V1" = NULL;
 
...
 
SET "ref_ACAI"."ACAI_STRUCT_ID" = 'ACAI'; 
 
...
 
 
???
 
 
I would think not...but how else could I equate my "OutputRoot"."MRM"."MQ_HEADER_V1"  to something that would make it valid when the parser attempts to serialize it... _________________ Marc Verhiel
 
IBM Canada Ltd. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kirani | 
		  
		    
			  
				 Posted: Tue May 28, 2002 7:54 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Jedi Knight
 
 Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA 
  | 
		  
		    
			  
				I guess, if you change the sequence of DECLARE REFERENCE and SET statement then it will work, i.e.
 
 
SET "OutputRoot"."MRM"."MQ_HEADER_V1" = NULL; 
 
DECLARE ref_ACAI REFERENCE TO "OutputRoot"."MRM"."MQ_HEADER_V1"; 
 
..
 
SET "ref_ACAI"."ACAI_STRUCT_ID" = 'ACAI'; 
 
..
 
 
To me following ESQL code looks more readable than above code,
 
SET "OutputRoot"."MRM"."MQ_HEADER_V1"."ACAI_STRUCT_ID" = 'ACAI'; 
 
 
If you are building an output tree from input tree then you can use REFERENCE to point to input tree and that will increases readability. For example,
 
 
DECLARE ref_data REFERENCE TO InputRoot.XML.Tag1.Data;
 
SET OutputRoot.MRM.DATA = ref_data.Name;
 
 
Hope this helps. _________________ Kiran
 
 
 
IBM Cert. Solution Designer & System Administrator - WBIMB V5
 
IBM Cert. Solutions Expert - WMQI
 
IBM Cert. Specialist - WMQI, MQSeries
 
IBM Cert. Developer - MQSeries
 
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mverh | 
		  
		    
			  
				 Posted: Wed May 29, 2002 3:15 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 06 Mar 2002 Posts: 97
  
  | 
		  
		    
			  
				| Kiran, I agree that the readability is a minor issue with this simple example...but I have numerous fields in the MQ_HEADER_V1 structure that need to be set as well as many in structures that follow the header...so using the reference will help readability when all fields are being set...also I have been led to believe that reference variables improve performance...I haven't tried the change I suggested to see if it works ...when I do I update the thread... | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mverh | 
		  
		    
			  
				 Posted: Fri May 31, 2002 3:24 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 06 Mar 2002 Posts: 97
  
  | 
		  
		    
			  
				| Making the changes to the ESQL that sets the reference to NULL doesn't solve this problem...still invesigating... | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Yanghui | 
		  
		    
			  
				 Posted: Wed Jun 05, 2002 1:59 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Disciple
 
 Joined: 08 May 2002 Posts: 151 Location: Dublin, Ireland 
  | 
		  
		    
			  
				In the output side, I normally create the field first by the following ESQL:
 
 
CREATE FIELD "OutputRoot"."MRM"."MQ_HEADER_V1";
 
DECLARE ref_ACAI REFERENCE TO "OutputRoot"."MRM"."MQ_HEADER_V1"; 
 
SET ref_ACAI."ACAI_STRUCT_ID" = 'ACAI'; 
 
 
BTW, I don't think you need double quote for reference variables. 
 
 
Hope it helps.
 
 
-Yanghui | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mverh | 
		  
		    
			  
				 Posted: Wed Jun 05, 2002 9:37 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 06 Mar 2002 Posts: 97
  
  | 
		  
		    
			  
				| Thanks for the tip Yanghui...that worked like a charm... | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |