|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  At what point, the inpupt root is copied into outputroot | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | jeevan | 
		  
		    
			  
				 Posted: Tue Jan 02, 2007 9:32 pm    Post subject: At what point, the inpupt root is copied into outputroot | 
				     | 
			   
			 
		   | 
		 
		
		   Grand Master
 
 Joined: 12 Nov 2005 Posts: 1432
  
  | 
		  
		    
			  
				I am having problem to get my message model working for my output.  I can read input correct correctly ( which is in comma delimited text). But I am trying to put it in fixed length format but having  problem. 
 
 
 
When I step into the sources ( through debug session), it seems alright until it carries out the  CopyMessageHeaders process. But when it reaches the first line of CopyEntireMessage(), I saw the whole Inputroot be copied into Outputroo.  The first line is supposed to build only one element in the Outputroot.MRM.......   but instead, it copies the whole strcture of the inputroot into outputroot.  
 
 
The first line ;
 
 
SET OutputRoot.MRM.Name.FN = InputBody.Rec.Name.FN;
 
 
REMAINING LINES
 
SET OutputRoot.MRM.Name.LN = InputBody.Rec.Name.LN;
 
SET OutputRoot.Properties.MessageSet = 'MSETFORTDS';
 
SET OutputRoot.Properties.MessageType = 'NameOut';
 
SET OutputRoot.Properties.MessageFormat = 'TDS1';
 
		
 
 
Note: I have put the copying inside the while loop to copy the whole message
 
 
Questions:
 
 
Is this common? I mean in copying ( in fact just assigning) one element, snould the whole message be copied? 
 
 
If yes, how can I get rid of this and build output structure of the message?
 
 
Thanks | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | elvis_gn | 
		  
		    
			  
				 Posted: Tue Jan 02, 2007 9:47 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Padawan
 
 Joined: 08 Oct 2004 Posts: 1905 Location: Dubai 
  | 
		  
		    
			  
				Hi jeevan,
 
The copyMessageHeaders() copies the Properties and MQMD entirely.
 
 
The copyEntireMessage() copies the Properties, MQMD and Body(MRM,XML..) entirely.
 
 
Don't put any of your code into these procedures...
 
 
If you want to create your own message body, then use only the copyMessageHeaders. and then write your code after that.
 
 
Please paste your entire code, if you need further help.
 
 
Regards. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | jeevan | 
		  
		    
			  
				 Posted: Tue Jan 02, 2007 10:31 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Grand Master
 
 Joined: 12 Nov 2005 Posts: 1432
  
  | 
		  
		    
			  
				This is my project details. 
 
 
Input message (comma delimited)
 
 
 
AAAAA,BBBB
 
11111,CCCC
 
DDDDD,EEEE
 
FFFFF,2222
 
GGGGG,HHHH
 
XXXXX,YYYY
 
33333,IIII
 
JJJJJ,OOOO
 
* please do not use *,LLLL
 
44444,MMMM
 
 
and convert it to a fixed length message as follows:
 
 
AAAAABBBB
 
11111CCCC
 
DDDDDEEEE
 
FFFFF2222
 
GGGGGHHHH
 
XXXXXYYYY
 
33333IIII
 
JJJJJOOOO
 
* please do not use *
 
44444MMMM
 
 
I developed a TDS message set for reading input message. It works fine but the message set for converting the message to fixed length format is producing a parse error. 
 
 
input root structure looks like as follows:
 
Inputroot
 
 MRM
 
   Name 
 
     FN
 
     LN
 
 
 
and I want the message in the same format except with fixed lengths instead of comma delimited data. So I thought, copying inputroot into output root and setting appropriate properties fields, would work. But it did not. 
 
 
 
 
The output message set is as follows:
 
 
 
Message :NameOut 
 
 Name ( local element reference, this repeats)
 
 
 
properties:
 
 
 
physical 
 
 
 
Repeating Element Delimiter <CR><LF>
 
 
logical
 
Max Occurs -1
 
 
 
Type
 
NameOut : complexType
 
 
NameType
 
   FN local element
 
   LN local element
 
 
 
properties
 
 
 
logical
 
 
 
physical 
 
Length 5
 
Length 4
 
Left Justified
 
Padding Character 0
 
 
 
 
 
 
When I walked through the debug, it works fine till the end but I can not execute the following line:
 
 
 
SET OutputRoot = InputRoot,
 
 
 
My belief was that both the input message and output message has a similar structure so that the input message could be copied to the output message. But it is producing the following error message, 
 
 
 
Text = Mandatory element has no value or default value assigned
 
 
 
Using the following esql :
 
 
 
SET OutputRoot = InputRoot;
 
SET OutputRoot.Properties.MessageSet = 'Fixed_Msg_Set';
 
SET OutputRoot.Properties.MessageType = 'CustomerOut';
 
SET OutputRoot.Properties.MessageFormat = 'TDS1';
 
 
 
(note This code did not work. )
 
 
When I tried map the element individually, and just for test did one and observed it in debug session, I saw the whole inputBody be copied in to OutputRoot when the first line of the following text is implemented.
 
 
SET OutputRoot.MRM.Name.FN = InputBody.Name.FN; 
 
 
REMAINING LINES 
 
SET OutputRoot.MRM.Name.LN = InputBody.Rec.Name.LN; 
 
SET OutputRoot.Properties.MessageSet = 'MSETFORTDS'; 
 
SET OutputRoot.Properties.MessageType = 'NameOut'; 
 
SET OutputRoot.Properties.MessageFormat = 'TDS1';
 
 
This is complete code in copy message body procedure.  The header is copied before this already. 
 
 
 
Observation:
 
 
Before pointer (control) comes to this procedure, I can see, MQMD and properties in OutputRoot, but when the above line was executed, two things happened:
 
MRM was built into OutputRoot
 
The  whole MRM content was copied into MRM of the OutputRoot. 
 
 
My understanding was that the body of the output root is not build automatically until and unless, we do 
 
OutputRoot=InputRoot;
 
 
But to my wonder, it copied everything.
 
 
Questions:
 
1. When both messages (input message def and output message def) have similar structure, can not we execute this command?
 
 
OutputRoot=InputRoot 
 
 
 
But this did not work
 
 
2.. When there was not MRM in OutputRoot and I give the following command what will happen?
 
 	SET OutputRoot.MRM.Name.FN = InputBody.Name.FN;
 
 
 
Thank you very much for your help | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Wed Jan 03, 2007 2:28 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				Troubleshoot the error. 
 
 
WHICH mandatory element has no value or default value assigned? _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | kimbert | 
		  
		    
			  
				 Posted: Wed Jan 03, 2007 2:40 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Jedi Council
 
 Joined: 29 Jul 2003 Posts: 5543 Location: Southampton 
  | 
		  
		    
			  
				Hi jeevan,
 
 
You are getting confused because you are trying to solve too many problems at the same time. You only have one real problem - your input message is not being parsed correctly. When you solve that, you will be able to solve the other problems. Until then, it is pointless to even try.
 
 
I have read your thread on the DeveloperWorks forum. That's fortunate, because this post fails to mention the most difficult aspect of your scenario : you have an input message which can take either of two formats. I suggest that you get your message flow working with the simple scenario ( all fields on the same line ). First make sure that you are getting the correct message tree after the input node. You can either use the debugger or insert a trace node.
 
 
When the simple scenario is working I can show you how to handle the case where the line can sometimes be split into two lines. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | kimbert | 
		  
		    
			  
				 Posted: Wed Jan 03, 2007 2:40 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Jedi Council
 
 Joined: 29 Jul 2003 Posts: 5543 Location: Southampton 
  | 
		  
		    
			  
				Hi jeevan,
 
 
You are getting confused because you are trying to solve too many problems at the same time. You only have one real problem - your input message is not being parsed correctly. When you solve that, you will be able to solve the other problems. Until then, it is pointless to even try.
 
 
I have read your thread on the DeveloperWorks forum. That's fortunate, because this post fails to mention the most difficult aspect of your scenario : you have an input message which can take either of two formats. I suggest that you get your message flow working with the simple scenario ( all fields on the same line ). First make sure that you are getting the correct message tree after the input node. You can either use the debugger or insert a trace node.
 
 
When the simple scenario is working I can show you how to handle the case where the line can sometimes be split into two lines. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | jeevan | 
		  
		    
			  
				 Posted: Wed Jan 03, 2007 4:59 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Grand Master
 
 Joined: 12 Nov 2005 Posts: 1432
  
  | 
		  
		    
			  
				Kimbert,
 
 
As I mentioned, I got my simple flow working with one line comma delimited input data. 
 
 
AAAAAAAAAA.BBBBBBBBBB
 
CCCCCCCCCCCc,DDDDDDDD
 
 
 
I succeeded to build the input treee.  So, I have left reading two lines input. Now I am working on putthing this message in fixed length output.  My basic questions is about this.
 
 
I read example, and saw that the item ( like firstname or FN) does not have to have a default value.  I refer fixed 4.3 sample gallary sample application.
 
 
 
I am unable to build the output tree.  I got error when I tried 
 
 
OutputRoot = INputRoot;
 
 
or mapping the element individually. 
 
 
One of my questions was that when I just carry out mapping one individual element, the whole inputroot.MRM is copied into OutputRoot.MRM and there is not effect of the command to set the one element in the outputroot. 
 
 
Once I resolve the problem in building the outputroot, I think I can resolve my problem.  
 
 
I am using debug to observe.  My main questions is when I tried to map one element to outputroot, why the whole inputroot.MRM is copied in OutputRoot.MRM. 
 
 
Once I get it working, i can the mapping of outoutroot.MRM element in loop and copy the whole.  For the moment, I am trying to copy just one line (FN and LN ) in outputroot.MRM. 
 
 
For you information, I am using debug.  
 
 
thanks | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | jeevan | 
		  
		    
			  
				 Posted: Wed Jan 03, 2007 5:00 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Grand Master
 
 Joined: 12 Nov 2005 Posts: 1432
  
  | 
		  
		    
			  
				Kimbert,
 
 
As I mentioned, I got my simple flow working with one line comma delimited input data. 
 
 
AAAAAAAAAA.BBBBBBBBBB
 
CCCCCCCCCCCc,DDDDDDDD
 
 
 
I succeeded to build the input treee.  So, I have left reading two lines input. Now I am working on putthing this message in fixed length output.  My basic questions is about this.
 
 
I read example, and saw that the item ( like firstname or FN) does not have to have a default value.  I refer fixed 4.3 sample gallary sample application.
 
 
 
I am unable to build the output tree.  I got error when I tried 
 
 
OutputRoot = INputRoot;
 
 
or mapping the element individually. 
 
 
One of my questions was that when I just carry out mapping one individual element, the whole inputroot.MRM is copied into OutputRoot.MRM and there is not effect of the command to set the one element in the outputroot. 
 
 
Once I resolve the problem in building the outputroot, I think I can resolve my problem.  
 
 
I am using debug to observe.  My main questions is when I tried to map one element to outputroot, why the whole inputroot.MRM is copied in OutputRoot.MRM. 
 
 
Once I get it working, i can the mapping of outoutroot.MRM element in loop and copy the whole.  For the moment, I am trying to copy just one line (FN and LN ) in outputroot.MRM. 
 
 
For you information, I am using debug.  
 
 
thanks | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | kimbert | 
		  
		    
			  
				 Posted: Wed Jan 03, 2007 11:56 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Jedi Council
 
 Joined: 29 Jul 2003 Posts: 5543 Location: Southampton 
  | 
		  
		    
			  
				This error 
   
	| Quote: | 
   
  
	| Mandatory element has no value or default value assigned  | 
   
 
  is a bit misleading. It simply means that the TDS writer could not find one of your fixed-length elements. The usual reason is that the output message tree does not match the structure of your message definition.
 
   
	| Quote: | 
   
  
	| When I tried map the element individually, and just for test did one and observed it in debug session, I saw the whole inputBody be copied in to OutputRoot when the first line of the following text is implemented. | 
   
 
I can assure you that copying one field from InputRoot to OutputRoot does not cause the entire message tree to be copied. If you want to be really certain about the contents of the output tree, insert a trace node before the output node and trace ${Root}. The debugger can be a useful tool, but a trace node never lies! | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | jeevan | 
		  
		    
			  
				 Posted: Wed Jan 03, 2007 1:20 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Grand Master
 
 Joined: 12 Nov 2005 Posts: 1432
  
  | 
		  
		    
			  
				Kimbert,
 
 
Thank you for your suggestion.  Hopefully, I will fix it now. | 
			   
			 
		   | 
		 
		
		  | 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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |