[rules-users] Multuple AgendaFilter is not possible

Wolfgang Laun wolfgang.laun at gmail.com
Mon Feb 24 04:30:23 EST 2014


There's no FireAllRulesCommand in the stable API. I would not
go beyond that.

It's not exactly rocket science to combine two or n filters into
another filter. Do you need the Java code in full?

class CombinedAgendaFilter implements AgendaFilter {
    CombinedAgendaFilter( AgendaFilter... filters ){ ... }
    boolean accept(Match match)
       //...
    }
}

-W

On 24/02/2014, ismaximum <mnrz57 at gmail.com> wrote:
> Hi
>
> I'm trying to add multiple FireAllRulesCommand, each with different
> AgendaFilter:
>
>         for(Object obj: objs) {
>             cmds.add(CommandFactory.newInsert(obj));
>         }
>         cmds.add(CommandFactory.newStartProcess(processName));
>         FireAllRulesCommand pre = new FireAllRulesCommand(new
> PreAgendaFilter());
>         FireAllRulesCommand post = new FireAllRulesCommand(new
> PostAgendaFilter());
>         cmds.add(pre);
>         cmds.add(post);
>
>
> but it seems ksession.execute() only executes the first FireAllRulesCommand
> and ignores the subsequent ones in the list. In this case only 'pre' ...
> and
> if I change the order and add the 'post' before 'pre' it only executes the
> 'post' command...
>
> Is this a bug or something else behind it?
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Multuple-AgendaFilter-is-not-possible-tp4028261.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list