| Author | 
		  Message
		 | 
		
		  | Chuck831 | 
		  
		    
			  
				 Posted: Fri Feb 18, 2005 8:42 am    Post subject: Copying Headers using subflows | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 23 Dec 2002 Posts: 28
  
  | 
		  
		    
			  
				Hi,
 
 
Could someone point me in the right direction.  I'm attempting to create a library of common procedures that could be called from individual message flows.  The first one I have attempted is a CopyHeaders procedure.  It appears to work correctly when called from the message flow.  But when it writes to the output queue it fails because the MQMD or Properties are missing.  When I debug it the MQMD, Properties, and the XML are all there after the compute node.  What could I be missing?
 
 
WBIMB V5 CSD 4
 
 
Flow:  Input ----> Compute ----> Output
 
 
 
   
	| Code: | 
   
  
	CREATE COMPUTE MODULE CEM1_Compute
 
   
 
   CREATE FUNCTION Main() RETURNS BOOLEAN
 
   BEGIN
 
      Declare x Reference to InputRoot; 
 
      Declare y Reference to OutputRoot; 
 
      CALL com.bge.CopyHeaders(InputRoot, y);
 
      CALL ProcessMessage(); 
 
      RETURN TRUE; 
 
   END; 
 
   
 
   CREATE PROCEDURE ProcessMessage() BEGIN
 
      Declare LastName Char;
 
      
 
      Set LastName = 'Duck';
 
      Set OutputRoot.XML.DataArea.Fname = InputRoot.XML.DataArea.Fname;
 
      Set OutputRoot.XML.DataArea.Lname = LastName;
 
      Set OutputRoot.XML.DataArea.Date  = CURRENT_DATE;
 
 
   END;
 
   
 
END MODULE; 
 
 | 
   
 
 
 
   
	| Code: | 
   
  
	BROKER SCHEMA com.bge
 
CREATE PROCEDURE CopyHeaders (IN InputRoot REFERENCE, INOUT OutputRoot REFERENCE)
 
BEGIN
 
   DECLARE C INTEGER; 
 
   SET C = CARDINALITY(InputRoot.*[]); 
 
   DECLARE I INTEGER; 
 
   SET I = 1; 
 
   WHILE I < C DO
 
      SET OutputRoot.*[I] = InputRoot.*[I];
 
      SET I=I+1;
 
   END WHILE; 
 
END; 
 
 | 
   
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | EddieA | 
		  
		    
			  
				 Posted: Fri Feb 18, 2005 10:04 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles 
  | 
		  
		    
			  
				Put a Trace node between the Compute and Output to see exactly what you built.
 
 
Cheers, _________________ Eddie Atherton
 
IBM Certified Solution Developer - WebSphere Message Broker V6.1
 
IBM Certified Solution Developer - WebSphere Message Broker V7.0 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Chuck831 | 
		  
		    
			  
				 Posted: Fri Feb 18, 2005 10:39 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 23 Dec 2002 Posts: 28
  
  | 
		  
		    
			  
				Eddie,
 
 
I did put a trace node there.  Here is the results from that:
 
 
   
	| Code: | 
   
  
	(
 
  (0x01000000):Properties = (
 
    (0x03000000):MessageSet      = ''
 
    (0x03000000):MessageType     = ''
 
    (0x03000000):MessageFormat   = ''
 
    (0x03000000):Encoding        = 546
 
    (0x03000000):CodedCharSetId  = 437
 
    (0x03000000):Transactional   = TRUE
 
    (0x03000000):Persistence     = TRUE
 
    (0x03000000):CreationTime    = GMTTIMESTAMP '2005-02-18 15:28:36.460'
 
    (0x03000000):ExpirationTime  = -1
 
    (0x03000000):Priority        = 0
 
    (0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
 
    (0x03000000):ReplyProtocol   = 'MQ'
 
    (0x03000000):Topic           = NULL
 
  )
 
  (0x01000000):MQMD       = (
 
    (0x03000000):SourceQueue      = 'TEST.IN'
 
    (0x03000000):Transactional    = TRUE
 
    (0x03000000):Encoding         = 546
 
    (0x03000000):CodedCharSetId   = 437
 
    (0x03000000):Format           = 'MQSTR   '
 
    (0x03000000):Version          = 2
 
    (0x03000000):Report           = 0
 
    (0x03000000):MsgType          = 8
 
    (0x03000000):Expiry           = -1
 
    (0x03000000):Feedback         = 0
 
    (0x03000000):Priority         = 0
 
    (0x03000000):Persistence      = 1
 
    (0x03000000):MsgId            = X'414d51204745544d51312020202020208c200a4220ad6f2f'
 
    (0x03000000):CorrelId         = X'000000000000000000000000000000000000000000000000'
 
    (0x03000000):BackoutCount     = 0
 
    (0x03000000):ReplyToQ         = '                                                '
 
    (0x03000000):ReplyToQMgr      = 'GETMQ1                                          '
 
    (0x03000000):UserIdentifier   = 'MQSIADMIN    '
 
    (0x03000000):AccountingToken  = X'16010515000000c6bb507a8078f53107e53b2bb731000000000000000000000b'
 
    (0x03000000):ApplIdentityData = '                                '
 
    (0x03000000):PutApplType      = 11
 
    (0x03000000):PutApplName      = 'C:\WINNT\system32\mmc.exe   '
 
    (0x03000000):PutDate          = DATE '2005-02-18'
 
    (0x03000000):PutTime          = GMTTIME '15:28:36.460'
 
    (0x03000000):ApplOriginData   = '    '
 
    (0x03000000):GroupId          = X'000000000000000000000000000000000000000000000000'
 
    (0x03000000):MsgSeqNumber     = 1
 
    (0x03000000):Offset           = 0
 
    (0x03000000):MsgFlags         = 0
 
    (0x03000000):OriginalLength   = -1
 
  )
 
  (0x01000010):XML        = (
 
    (0x01000000):DataArea = (
 
      (0x01000000):Fname = (
 
        (0x02000000): = 'Donald'
 
      )
 
      (0x01000000):Lname = (
 
        (0x02000000): = 'Duck'
 
      )
 
      (0x01000000):Date  = (
 
        (0x02000000): = DATE '2005-02-18'
 
      )
 
    )
 
  )
 
)
 
 
 | 
   
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Bill.Matthews | 
		  
		    
			  
				 Posted: Fri Feb 18, 2005 10:42 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Master
 
 Joined: 23 Sep 2003 Posts: 232 Location: IBM (Retired) 
  | 
		  
		    
			  
				What you are wanting to do cannot be done in this manner.  While it appears that  all the folders are there, what you cannot see is that these folders are no longer associated with their respective parsers (i.e, properties, mqd and the xml parser).
 
 
Sorry,
 
Bill _________________ Bill Matthews | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Fri Feb 18, 2005 2:09 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				
   
	| Bill.Matthews wrote: | 
   
  
	| what you cannot see is that these folders are no longer associated with their respective parsers (i.e, properties, mqd and the xml parser). | 
   
 
 
 
But that should be fixable with appropriate use of CREATE FIELD... right? _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | martinrydman | 
		  
		    
			  
				 Posted: Sat Feb 19, 2005 10:20 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 30 Jan 2004 Posts: 139 Location: Gothenburg, Sweden 
  | 
		  
		    
			  
				Yes, correct. I ran across this trying to create a XML root folder in a referenced and passed OutputRoot, and was equally baffled until I explicitly created it with CREATE FIELD using the DOMAIN clause. Should work for the rest of the folders, although I wouldn't know from experience the domain names, but it sholuld be 'Properties', 'MQMD' and so on. Am I right, gurus?
 
 
As an aside, it's really hard to understand why this is necessary. I guess that WBIMB does a lot of work for us behind the scenes, which for some obscure reason isn't performed when the references are passed to a PROCEDURE outside the COMPUTE MODULE.
 
 
/Martin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | EddieA | 
		  
		    
			  
				 Posted: Sat Feb 19, 2005 11:56 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles 
  | 
		  
		    
			  
				
   
	| Quote: | 
   
  
	| But that should be fixable with appropriate use of CREATE FIELD... right? | 
   
 
 
As long as you know what parsers to use.  Now, is the 3rd tree an RFH, or is it an RFH2, or is it some other MQ header.     
 
 
Cheers, _________________ Eddie Atherton
 
IBM Certified Solution Developer - WebSphere Message Broker V6.1
 
IBM Certified Solution Developer - WebSphere Message Broker V7.0 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Sat Feb 19, 2005 1:50 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				
   
	| EddieA wrote: | 
   
  
	As long as you know what parsers to use.  Now, is the 3rd tree an RFH, or is it an RFH2, or is it some other MQ header.      | 
   
 
 
Isn't the rule that each child of Root is named after the parser name, unless it's the body (which is always the last child)?
 
 
So FIELDNAME should help with that, yes? _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |