| Author | 
		  Message
		 | 
		
		  | Fuzzy_mq | 
		  
		    
			  
				 Posted: Wed Oct 17, 2007 7:29 am    Post subject: Filter node - V6 | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 27 May 2004 Posts: 31 Location: US 
  | 
		  
		    
			  
				Hi,
 
 
       I am using Filter node on V6. Below is my sample ESQL. Using this I am able to send messages with John or Jack to true and the others to false. What my requirement is:
 
 
IF 'JOHN' OR 'JACK' 
 
 THEN
 
  TRUE;
 
ELSE IF 'RON'
 
 THEN
 
  FALSE;
 
ELSE
 
  UNKNOWN;
 
END IF;
 
 
Is this possible using filter node, if not what is the best way to do this?
 
 
********Sample ESQL******
 
CREATE FILTER MODULE "Name_Filter"
 
CREATE FUNCTION main() RETURNS BOOLEAN BEGIN
 
RETURN
 
Root.XML.MessageData.ControlData.Name = 'JOHN'
 
OR Root.XML.MessageData.ControlData.Name = 'JACK' 
 
;
 
END;
 
END MODULE;
 
 
Thanks,
 
Suchit | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Wed Oct 17, 2007 7:45 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				
   
	| Code: | 
   
  
	IF Root.XMLNS.MessageData.ControlData.Name = 'JOHN' OR Root.XMLNS.MessageData.ControlData.Name = 'JACK' THEN
 
    return true;
 
ELSEIF Root.XMLNS.MessageData.ControlData.NAME = 'RON' THEN
 
    return false;
 
ELSE 
 
    return UNKNOWN;
 
END IF; | 
   
 
 _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Wed Oct 17, 2007 7:47 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				Is UNKNOWN a valid boolean? I thought you set NULL (if you can set NULL!) to get it to flow from the UNKNOWN terminal.
 
 
Things you learn. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Bill.Matthews | 
		  
		    
			  
				 Posted: Wed Oct 17, 2007 7:52 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Master
 
 Joined: 23 Sep 2003 Posts: 232 Location: IBM (Retired) 
  | 
		  
		    
			  
				a Return UNKNOWN is valid in the filter node _________________ Bill Matthews | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Wed Oct 17, 2007 8:04 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| Bill.Matthews wrote: | 
   
  
	| a Return UNKNOWN is valid in the filter node | 
   
 
 
 
I repeat, the things you learn. 
 
 
(casually editing a load of flows for increased clarity)    
 
 
This board is just so good. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Fuzzy_mq | 
		  
		    
			  
				 Posted: Wed Oct 17, 2007 8:20 am    Post subject: Thanks | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 27 May 2004 Posts: 31 Location: US 
  | 
		  
		    
			  
				Thanks folks. Sample that Jeff provide works great. And yes UNKNOWN is valid in filter node.
 
 
--Suchit | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mgk | 
		  
		    
			  
				 Posted: Wed Oct 17, 2007 11:15 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Padawan
 
 Joined: 31 Jul 2003 Posts: 1647
  
  | 
		  
		    
			  
				FYI,
 
 
UNKNOWN is valid in any ESQL, not just Filter Nodes, as the BOOLEAN datatype in ESQL has 3 states: TRUE, FALSE and UNKNOWN. This maps to the SQL BOOLEAN datatype.
 
 
 
Cheers, _________________ MGK
 
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |