|  | 
 
  
    | RSS Feed - WebSphere MQ Support | RSS Feed - Message Broker Support |  
 
  
	|    |  |  
  
	| Dynamic Reference doesn't work on Environment tree | « View previous topic :: View next topic » |  
  	| 
		
		
		  | Author | Message |  
		  | Yanghui | 
			  
				|  Posted: Fri May 23, 2003 3:35 am    Post subject: Dynamic Reference doesn't work on Environment tree |   |  |  
		  | Disciple
 
 
 Joined: 08 May 2002Posts: 151
 Location: Dublin, Ireland
 
 | 
			  
				| Hi, 
 I just found that actually dynamic reference doesn't work on Environment tree within WMQI2.1 + CSD4.
 
 For example,
 
 Method 1:
 DECLARE RefEnv1 REFERENCE to Environment.Variables.Matrixs;
 SET RefEnv1.MM.Type = '00';
 
 Method 2:
 SET Environment.Variables.Matrixs.MM.Type = '00';
 
 The result of Method 1 is a new child MM generated under Environment and it's the sibling of Variables.
 
 The Method 2 will bring the expected correct result.
 
 Does anybody know it's true or something I didn't do right in the method 1? Thanks in advance.
 
 Regards
 -Yanghui
 |  |  
		  | Back to top |  |  
		  |  |  
		  | ernest-ter.kuile | 
			  
				|  Posted: Fri May 23, 2003 5:21 am    Post subject: Re: Dynamic Reference doesn't work on Environment tree |   |  |  
		  |  Apprentice
 
 
 Joined: 13 May 2002Posts: 49
 Location: KLM Holland
 
 | 
			  
				| 
   
	| Yanghui wrote: |  
	| I just found that actually dynamic reference doesn't work on Environment tree within WMQI2.1 + CSD4. |  
 This has been true for a while now, and is also true for the LocalEnvironment. I had hoped this would be gone by now (we're still at CSD2). Oh, well.
 
 Because of this, I only use REFERENCE for reading. The rare cases I do need it for writing, I would do a
 
 SET Environment.Variables.Matrixs.dummy = dummy;
 DECLARE RefEnv1 REFERENCE to Environment.Variables.Matrixs;
 
 SET RefEnv1.MM.Type = '00';
 
 Just before I need to access something deeper down for writing.
 
 Ernest
 |  |  
		  | Back to top |  |  
		  |  |  
		  | mpuetz | 
			  
				|  Posted: Tue Jun 17, 2003 8:58 am    Post subject: |   |  |  
		  | Centurion
 
 
 Joined: 05 Jul 2001Posts: 149
 Location: IBM/Central WebSphere Services
 
 | 
			  
				| Hi, 
 the reason why method 1 fails is
 because the NAME element
 
 Environment.Variables.Matrixs
 
 doesn't exist when you declare the reference variable
 to point to it.
 
 If you do a
 
 CREATE FIELD Environment.Variables.Matrixs
 
 before you declare the reference variable all works well.
 
 The reason why you get your entries directly below the
 Environment root element is likely as follows:
 
 The DECLARE REFERENCE statement walks through the
 Environment and tries to find the Variables element.
 Because it doesn't exist it returns its current position,
 hence 'Environment' as the reference value.
 
 I have actually checked that this is correct, by creating
 Environment.Variables first, and then declared
 the reference to Environment.Variables.Matrixs
 
 The result was, as expected, that the reference now
 pointed to Environment.Variables.
 
 Now you may call this behavior a bug or a feature.
 Before you exploit this 'feature' in your code (I'm
 sure somebody will find a use for this), confirm
 with IBM support, that this is really the intended
 behavior.
 _________________
 Mathias Puetz
 
 IBM/Central WebSphere Services
 WebSphere Business Integration Specialist
 |  |  
		  | Back to top |  |  
		  |  |  
		  |  |  |  
  
	|    |  | Page 1 of 1 |  
 
 
  
  	| 
		
		  | 
 
 | 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
 
 |  |  |  |