[rules-users] Making my own agenda Filter

Anstis, Michael (M.) manstis1 at ford.com
Mon Mar 10 10:03:30 EDT 2008


Your anonymous sub-class isn't entered or it doesn't run as expected?

In your "accept" override you compare object references - type == "AGENDA".
Is this what you really want?


-----Original Message-----
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Mehak
Sent: 10 March 2008 13:49
To: rules-users at lists.jboss.org
Subject: [rules-users] Making my own agenda Filter


Hi I am using this code to make my own agenda filter. In this case if the
type of rule is agenda then agenda filter to focus on that agenda is set
else agenda filter for rule is set.

private static AgendaFilter buildAgendaFilter(RuleConfig rule)
{	final String searchName = rule.getRuleName();
	final String type = rule.getRuleType();
	AgendaFilter filter = new AgendaFilter() // The control doesnt go
inside
this code
    {
        public boolean accept(Activation activation)
        {	if(type == "AGENDA")
        	{
        	
if((activation.getRule().getAgendaGroup()).equalsIgnoreCase(searchName)) 
        		{  System.out.println(searchName);
        			return true;
        		}                
        			return false;
        	}
        
          	else
           {
 
if((activation.getRule().getName()).equalsIgnoreCase(searchName)) 
        	  {  
              return true;
        	  }                
            return false;
       	   }
        }
    };
    return filter;

The problem is that the control doesnt go inside the new agenda creation.
Please let me know if something is wrong with the way I have used it.
Thanks
-- 
View this message in context:
http://www.nabble.com/Making-my-own-agenda-Filter-tp15950765p15950765.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 7206 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20080310/1ecfa4b4/attachment.bin 


More information about the rules-users mailing list