[rules-users] Dynamic Rules will not be executed

Mark Proctor mproctor at codehaus.org
Tue Feb 5 06:13:18 EST 2008


Michael Katai wrote:
> Hello!
>
> I've googeled and searched the mailing list archive, but i couldn't solve my
> current problem:
> Every time i create a new rule (while runtime) i use:
>
>   PackageBuilder builder = new PackageBuilder();
>   builder.addPackageFromDrl(source);
>   if(builder.hasErrors())
>     ...
>   Package pkg = builder.getPackage();
>   ruleBase.addPackage(pkg);
>   session.fireAllRules();
>
> Every time, fireAllRules is executed, only the last, newest rule will fired.
> Where is my mistake?
>   
It's hard to tell, but I'm guessing that all the existing rules have 
already been fulling matched and fired. Adding more rules will not cause 
those old rules to rematch against existing data.
> ruleBase (and factspace) is created as
>   session = ruleBase.newStatefulSession();
>   factspace = new FactSpace(session);
>
> thanks in advance,
>    michael
>
> _______________________________________________
> 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