| Author | 
		  Message
		 | 
		
		  | Pratik611 | 
		  
		    
			  
				 Posted: Mon Sep 11, 2017 3:40 am    Post subject: Dynamic UDP value fetch in ESQL | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 27 Jul 2014 Posts: 17
  
  | 
		  
		    
			  
				Hi,
 
 
There's a requirement wherein we got to use the value of a particular UDP from a list of UDP's based on a parameter in the input message.
 
 
Is this possible in ESQL?
 
So i want to dynamically select my UDP and take its value. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Mon Sep 11, 2017 4:07 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Pratik611 | 
		  
		    
			  
				 Posted: Mon Sep 11, 2017 8:17 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 27 Jul 2014 Posts: 17
  
  | 
		  
		    
			  
				
   
	| mqjeff wrote: | 
   
  
	| https://www.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak01015_.htm | 
   
 
 
 
Hey mqjeff, thanks for the reply.
 
Read through the entire help but couldnt find out if i can pick a UDP out of a list of UDP's dynamically.
 
I want to do it similar to the below eg:
 
Environment.Variable.{VariableValueFromInputMessage}
 
 
Something like this with a UDP | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | inMo | 
		  
		    
			  
				 Posted: Tue Sep 12, 2017 6:23 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Master
 
 Joined: 27 Jun 2009 Posts: 216 Location: NY 
  | 
		  
		    
			  
				| What are you doing to cause recognition of the UDP's value(s) in your ESQL code? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Pratik611 | 
		  
		    
			  
				 Posted: Tue Sep 12, 2017 8:34 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 27 Jul 2014 Posts: 17
  
  | 
		  
		    
			  
				
   
	| inMo wrote: | 
   
  
	| What are you doing to cause recognition of the UDP's value(s) in your ESQL code? | 
   
 
 
 
So i got this operationID coming in my input message for eg op1 and i have UDP's set like below:
 
op1=value1,
 
op2=value2,
 
op3=value3
 
 
so based on the operationID of the incoming message, i need to assign value to a variable FinalValue
 
 
so here.. Finalvalue = value1 cos operationid is op1
 
 
I hope this makes things clear | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Wed Sep 13, 2017 4:46 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				ESQL doesn't have the concept of a hashmap (which it sounds a lot like you're trying to create). Each UDP is a separate and distinct variable with no inherent connection to each other. 
 
 
It's an easy task to create a CASE statement with the code you outline, and this would work great if you have a fixed number of UDPs that change their value. It's not onerous even if you have a variable number of UDPs as you'd have to change the code to add a new EXTERNAL declaration just to get the UDP to work, so you can add a line to the CASE statement at the same time. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | timber | 
		  
		    
			  
				 Posted: Thu Sep 14, 2017 4:33 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 25 Aug 2015 Posts: 1292
  
  | 
		  
		    
			  
				Alternatively, put all of the properties into a SHARED ROW variable, and access them via the {} syntax: 
   
	| Code: | 
   
  
	| SET property1Value = mySharedProperties.{"property1"} | 
   
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Thu Sep 14, 2017 5:24 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				
   
	| Vitor wrote: | 
   
  
	| ESQL doesn't have the concept of a hashmap (which it sounds a lot like you're trying to create).  | 
   
 
 
 
With good programming practices, a logical message tree can be accessed as if it were a hashmap. _________________ chmod  -R ugo-wx / | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |