| Author | 
		  Message
		 | 
		
		  | raj12121 | 
		  
		    
			  
				 Posted: Wed Mar 09, 2011 8:57 pm    Post subject: UDP Saga | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 09 Mar 2011 Posts: 8
  
  | 
		  
		    
			  
				I have two message flows (udp1.msgflow and udp2.msgflow) in the same schema (project.test).
 
 
Requirement : Set up a UDP (e.g database schema ) which will be visible to all the flows inthe same schema.
 
 
 
Experiment:
 
 
Created an UDP (V1) in the flow edtitor and specified the UDP DECLARE ** syntax in the esql of flow1 (udp1.msgflow) with a default value DEFV1.
 
The value of UDP on udp1.msgflow is set to MYV1.
 
 
UDP variable is accessed from second flow. 
 
 
Issue :
 
UDP variable  V1 in udp1.msgflow correctly display the customised value i.e MYV1
 
Where as UDP variable  V1 in udp2.msgflow displays the default value DEFV1.
 
 
 
Any ideas.
 
 
udp2.esql
 
   
	| Code: | 
   
  
	BROKER SCHEMA project.test
 
 
 
CREATE COMPUTE MODULE udp2_Compute
 
   CREATE FUNCTION Main() RETURNS BOOLEAN
 
   BEGIN
 
      CALL CopyMessageHeaders();
 
      CALL CopyEntireMessage();
 
      SET OutputRoot.XML.UDP.V1 = V1;
 
      RETURN TRUE;
 
   END;
 
 
   CREATE PROCEDURE CopyMessageHeaders() BEGIN
 
      DECLARE I INTEGER 1;
 
      DECLARE J INTEGER;
 
      SET J = CARDINALITY(InputRoot.*[]);
 
      WHILE I < J DO
 
         SET OutputRoot.*[I] = InputRoot.*[I];
 
         SET I = I + 1;
 
      END WHILE;
 
   END;
 
 
   CREATE PROCEDURE CopyEntireMessage() BEGIN
 
      SET OutputRoot = InputRoot;
 
   END;
 
END MODULE;
 
 | 
   
 
 
udp1.esql
 
   
	| Code: | 
   
  
	BROKER SCHEMA project.test
 
DECLARE V1 EXTERNAL CHARACTER 'DEFV1' ;
 
 
CREATE COMPUTE MODULE upd_Compute
 
   
 
   CREATE FUNCTION Main() RETURNS BOOLEAN
 
   BEGIN
 
      CALL CopyMessageHeaders();
 
      CALL CopyEntireMessage();
 
      SET OutputRoot.XML.UDP.V1 = V1;
 
      RETURN TRUE;
 
   END;
 
 
   CREATE PROCEDURE CopyMessageHeaders() BEGIN
 
      DECLARE I INTEGER 1;
 
      DECLARE J INTEGER;
 
      SET J = CARDINALITY(InputRoot.*[]);
 
      WHILE I < J DO
 
         SET OutputRoot.*[I] = InputRoot.*[I];
 
         SET I = I + 1;
 
      END WHILE;
 
   END;
 
 
   CREATE PROCEDURE CopyEntireMessage() BEGIN
 
      SET OutputRoot = InputRoot;
 
   END;
 
END MODULE;
 
 | 
   
 
 
 
[/img][/code] | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | MQEnthu | 
		  
		    
			  
				 Posted: Wed Mar 09, 2011 9:41 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Partisan
 
 Joined: 06 Oct 2008 Posts: 329 Location: India 
  | 
		  
		    
			  
				AFAIK... if you edit the UDP values using the Message Flow editor in a flow, the newly edited value is available to all the nodes in that flow....And the new value is not available to the other flow even though they are in same schema... _________________ ----------------------------------------------- 
 
It is good to remember the past,
 
but don't let past capture your future | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | raj12121 | 
		  
		    
			  
				 Posted: Thu Mar 10, 2011 11:50 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 09 Mar 2011 Posts: 8
  
  | 
		  
		    
			  
				| The value was edited using bar editor. How can this be achieved ? Any solution ? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Thu Mar 10, 2011 12:47 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				I do not believe that user defined properties exist outside the context of a given flow.
 
 
Likewise, ESQL SHARED variables are not shared between flows. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | raj12121 | 
		  
		    
			  
				 Posted: Thu Mar 10, 2011 4:59 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 09 Mar 2011 Posts: 8
  
  | 
		  
		    
			  
				Thanks mqjeff, 
 
 
what is the solution for the below requirement .
 
 
Multiple flows in same schema requires a customisable property (e.g database schema) at deploy time. Instead of exposing UDPs for each and every flow .. is there a way to define one customisable property which will be visible to all the flows in the same schema.
 
 
Thanks | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | smdavies99 | 
		  
		    
			  
				 Posted: Thu Mar 10, 2011 10:20 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land. 
  | 
		  
		    
			  
				do you really mean
 
 
and not run time? _________________ WMQ User since 1999
 
MQSI/WBI/WMB/'Thingy' User since 2002
 
Linux user since 1995
 
 
 
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | raj12121 | 
		  
		    
			  
				 Posted: Fri Mar 11, 2011 3:15 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 09 Mar 2011 Posts: 8
  
  | 
		  
		    
			  
				| yes, my bad also should be visible at run time. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Fri Mar 11, 2011 3:29 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				You are not asking how to define a variable that is visible to many flows - you already have that.
 
 
You are asking how to ensure that all of the flows access the same instance of that variable.
 
 
I don't think you can do that from ESQL, because the ESQL runtime is not constructed the same way that a JVM is constructed.
 
 
But I don't think you need to do this, really.  How often is this variable really going to change?  Does it really need to be changed without redeploying things? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | raj12121 | 
		  
		    
			  
				 Posted: Fri Mar 11, 2011 3:36 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 09 Mar 2011 Posts: 8
  
  | 
		  
		    
			  
				| thanks mqjeff, i will go with defining udp for every flow. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | terminator_xyz | 
		  
		    
			  
				 Posted: Tue Aug 19, 2014 4:16 pm    Post subject: one question | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 29 Jul 2014 Posts: 15
  
  | 
		  
		    
			  
				sorry to reopen this topic.
 
 
If i need to use the UDP V1 in 2nd flow, should I still declare this UDP in 2nd flow, and not need to declare in 2nd esql using DECLARE EXTERNAL....? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |