| Author | 
		  Message
		 | 
		
		  | sriram.e | 
		  
		    
			  
				 Posted: Wed May 12, 2010 1:53 pm    Post subject: Collector node help in MB7 | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 14 Nov 2006 Posts: 12
  
  | 
		  
		    
			  
				Hi,
 
 
MB7 on AIX 5.3
 
 
Here is sample input file with fixed format of 8500 bytes,
 
 
   
	| Code: | 
   
  
	
 
R1 NAME1 000101  --|
 
R2 DEPART   XXX    |
 
R3 PROJECT1 010    |  1 inventory
 
R3 PROJECT2 020    | 
 
R3 PROJECT3 030  --| 
 
R1 NAME2 000101  --| 
 
R2 DEPART   YYY    |
 
R3 PROJECT1 010    |  2 inventory 
 
R3 PROJECT2 020  --| 
 
R1 NAME3 000101  --| 
 
R2 DEPART   ZZZ    |
 
R3 PROJECT1 040    |  3 inventory 
 
R3 PROJECT2 020  --| 
 
 
 | 
   
 
 
 
Expected output should be :
 
 
   
	| Code: | 
   
  
	
 
 
R1 NAME1 000101  --|
 
R2 DEPART   XXX    |
 
R3 PROJECT1 010    |  1 inventory message
 
R3 PROJECT2 020    | 
 
R3 PROJECT3 030  --| 
 
 
R1 NAME2 000101  --| 
 
R2 DEPART   YYY    |
 
R3 PROJECT1 010    |  2 inventory message
 
R3 PROJECT2 020  --| 
 
 
R1 NAME3 000101  --| 
 
R2 DEPART   ZZZ    |
 
R3 PROJECT1 040    |  3 inventory message
 
R3 PROJECT2 020  --| 
 
 
 | 
   
 
 
 
Basically, I am planning to read file record by record, accumulating in collector node till next R1 record found, propagating previous saved records in one unit of work as a message.
 
 
Continue the above process until end of file
 
 
I wanted to know, 
 
 
Is it possible to accomplish with collector node?
 
Are there any other option? (not using DB)
 
Is it doable using share variables?
 
 
Any help will be appreciated!! | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | sridhsri | 
		  
		    
			  
				 Posted: Wed May 12, 2010 2:25 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Master
 
 Joined: 19 Jun 2008 Posts: 297
  
  | 
		  
		    
			  
				| I don't see a need for collector nodes (and I don't think it makes sense to use one either). This is a message transformation problem - you'll need two message types (one for source format and one for destination format). Use a compute node and transform it. No collector nodes, shared variables or DB. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Thu May 13, 2010 4:21 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				The reason that sriram.e thinks that a collector node is used is because sriram.e thinks that each *line* of the file will be produced as output from FileInput.
 
 
This is indeed one way to do it.
 
 
Using a proper message model that identifies the whole "message" as a "record" and telling FileInput to output each message as a "record" is a much easier solution. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | sridhsri | 
		  
		    
			  
				 Posted: Thu May 13, 2010 5:32 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Master
 
 Joined: 19 Jun 2008 Posts: 297
  
  | 
		  
		    
			  
				| I'm a little rusty with collector nodes. But don't you have to know how many events you want to "collect" at development time. I don't think there is a way to know that.... | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Thu May 13, 2010 5:39 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				| You'd have to have some way to recognize the "last" record, then you could forward it to a separate input terminal that would close the collection. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | sriram.e | 
		  
		    
			  
				 Posted: Mon May 17, 2010 9:11 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 14 Nov 2006 Posts: 12
  
  | 
		  
		    
			  
				| Thanks for all your quick responses, i think with a combination of fileInput node and file output node, message model, i can accomplish this, but i'm just giving a try. But though i want to know whether batch accumalation is possible in collector node. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |