| Author | 
		  Message
		 | 
		
		  | achocks | 
		  
		    
			  
				 Posted: Thu Feb 09, 2012 7:20 am    Post subject: WMB 7.0 Email Node issue creating dynamic emails. | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 28 Nov 2011 Posts: 82
  
  | 
		  
		    
			  
				WMB Guru's - Need your help!
 
 
I have an strange issue with the EamilOutput node.
 
 
Here is what I have in my FLOW.
 
 
A compute node ---out---> EmailOutput node . Also the out1 of compute node is connected to a OUTPUT.
 
 
The issue is , what ever I am setting dynamically in the compture node especially the BODY of  the message is not coming in the email. Rather the the body I entered in the EmaiOutput node properties 'TEST' is coming. I am lost why my information is not passed to the Email out put node or overwritten to the properties..
 
 
Thanks in advance!!!
 
 
 
 
In the compute node I have the following code. 
 
 
 
 
CREATE COMPUTE MODULE EMAIL_NOTIFY_FLOW_CreateEmail
 
	CREATE FUNCTION Main() RETURNS BOOLEAN
 
	BEGIN
 
		DECLARE inputRootPtr REFERENCE TO InputRoot;
 
		DECLARE outputRootPtr REFERENCE TO OutputRoot;
 
		DECLARE EnvRef REFERENCE TO Environment;
 
		DECLARE EnvVarPtr REFERENCE TO Environment.Variables;
 
		CALL CopyMessageHeaders();
 
		
 
		
 
		DECLARE CRLF Character CAST (X'0A0D' as CHARACTER CCSID Environment.Variables.HubControl.CodedCharSetId);
 
		DECLARE TAB Character '	';
 
                DECLARE RECIPIENTS CHARACTER;
 
        
 
                SET RECIPIENTS = 'Test@XXXX.com';		  		   
 
		
 
		
 
		
 
		DECLARE MsgBody CHARACTER;
 
		
 
		SET OutputRoot.EmailOutputHeader.From = 'HubAdmin@XXXXX.com';
 
		SET OutputRoot.EmailOutputHeader.To = RECIPIENTS;
 
                SET OutputRoot.EmailOutputHeader."Subject" = 'Error on Broker ' || SQL.BrokerName;
 
		SET MsgBody = 'Error detected in Hub processing.'||CRLF;
 
		SET MsgBody = MsgBody	|| 'Error on Broker ' || SQL.BrokerName||'.'||CRLF||CRLF; 
 
		SET MsgBody = MsgBody ||'Error Code: '||TAB||COALESCE(CAST(Environment.Variables.HubControl.ErrorCodesTable.ERROR_CODE as CHARACTER),' ')||CRLF;
 
		SET MsgBody = MsgBody ||'Description: '||TAB||COALESCE(Environment.Variables.HubControl.ErrorCodesTable.ERROR_DESCRIPTION,' ')||'.'||CRLF||CRLF;
 
		SET MsgBody = MsgBody || 'Hub Control Record'||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'Operation Name: '||TAB||TAB|| COALESCE(Environment.Variables.HubControl.operationName,' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB||'Service Name: '||TAB||TAB|| COALESCE(Environment.Variables.HubControl.serviceName,' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'Soap Namespace: '||TAB||TAB|| COALESCE(Environment.Variables.HubControl.soapNS,' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'Hub Namespace: '||TAB||TAB|| COALESCE(Environment.Variables.HubControl.hubNS,' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'Message Namespace: '||TAB|| COALESCE(Environment.Variables.HubControl.msgNS,' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'Hub Message ID: '||TAB||TAB|| COALESCE(Environment.Variables.HubControl.HubUUID,' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'Location : '||TAB||TAB||TAB|| COALESCE(Environment.Variables.HubControl.Location,' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'State: '||TAB||TAB||TAB|| COALESCE(Environment.Variables.HubControl.State,' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'Transport Name: '||TAB||TAB|| COALESCE(Environment.Variables.HubControl.TransportName,' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'Transport Message ID: '||TAB|| COALESCE(CAST(Environment.Variables.HubControl.TransportMsgId as Character),' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'Source System ID: '||TAB|| COALESCE(Environment.Variables.HubControl.sourceSystemId,' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'User ID: '||TAB||TAB||TAB|| COALESCE(Environment.Variables.HubControl.userId,' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'Message ID: '||TAB|| TAB|| COALESCE(Environment.Variables.HubControl.messageId,' ')||CRLF;
 
		SET MsgBody = MsgBody ||TAB|| 'Error Reason Code: '||TAB|| COALESCE(Environment.Variables.HubControl.ErrorReasonCode,' ')||CRLF;
 
		
 
        		SET OutputRoot.BLOB.BLOB = CAST(MsgBody AS BLOB CCSID Environment.Variables.HubControl.CodedCharSetId);  		
 
 
	   	PROPAGATE TO TERMINAL 'out' FINAMLIZE NONE;
 
		Set OutputRoot = InputRoot;
 
	        PROPAGATE TO TERMINAL 'out1'FINALIZE NONE;
 
		RETURN FALSE; 
 
		 	
 
	END;
 
 
	CREATE PROCEDURE CopyMessageHeaders() 
 
	BEGIN
 
		DECLARE I INTEGER;
 
		DECLARE J INTEGER;
 
		SET I = 1;
 
		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; | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | lancelotlinc | 
		  
		    
			  
				 Posted: Thu Feb 09, 2012 7:43 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | achocks | 
		  
		    
			  
				 Posted: Thu Feb 09, 2012 7:49 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 28 Nov 2011 Posts: 82
  
  | 
		  
		    
			  
				Thanks lancelotlinc! Realy appreciate your help!
 
 
So I just need to remove the 'TEST' I have in the Email Message Text..correct?
 
 
So that it is not overriding my dynamic value..correct?
 
 
Thanks. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | lancelotlinc | 
		  
		    
			  
				 Posted: Thu Feb 09, 2012 7:51 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | achocks | 
		  
		    
			  
				 Posted: Thu Feb 09, 2012 7:55 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 28 Nov 2011 Posts: 82
  
  | 
		  
		    
			  
				I did attended.
 
 
But the instructor did not touch much on Email Node. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | lancelotlinc | 
		  
		    
			  
				 Posted: Thu Feb 09, 2012 8:56 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA 
  | 
		  
		    
			  
				Its odd that the instructor did not follow the lesson plan.
 
 
Was this an IBM instructor ar a third party? What city was it in?
 
 
To answer your question, if you place a value in the field, it overwrites what is in the message tree. If you do not place a value in the field, the body of the email will be created from the message tree. _________________ http://leanpub.com/IIB_Tips_and_Tricks
 
Save $20: Coupon Code: MQSERIES_READER | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | achocks | 
		  
		    
			  
				 Posted: Thu Feb 09, 2012 9:07 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 28 Nov 2011 Posts: 82
  
  | 
		  
		    
			  
				It was online class by IBM instructor.
 
 
Thanks for your help!
 
 
It Worked!!! | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | lancelotlinc | 
		  
		    
			  
				 Posted: Thu Feb 09, 2012 9:09 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA 
  | 
		  
		    
			  
				
   
	| achocks wrote: | 
   
  
	It was online class by IBM instructor.
 
 
Thanks for your help!
 
 
It Worked!!! | 
   
 
 
 
You might contact your IBM sales rep and get partial credit for the class since the instructor did not cover the required info. _________________ http://leanpub.com/IIB_Tips_and_Tricks
 
Save $20: Coupon Code: MQSERIES_READER | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |