[rules-users] Updating the knowledge base manually...

Edson Tirelli tirelli at post.com
Thu Jun 18 11:18:20 EDT 2009


   First of all, your approach does not sound like a good approach. If you
are removing all rules and adding new ones, why not simply create a new
knowledge base?

   Anyway, by default, drools fires all rules right after a rulebase is
updated. To disable this behavior, you need to set a knowledge base
configuration. Unfortunately setting this property now requires a down cast:

KnowledgeBaseConfiguration conf = ...
((RuleBaseConfiguration)conf).setRuleBaseUpdateHandler( null );

   I will add an option API to allow the configuration without the cast.

   []s
   Edson



2009/6/18 Pablo Navais <pnavais at gmail.com>

> Hi,
>
> I'm very new to Drools and don't know if this is possible, but i'm trying
> to
> manually update the knowledge base with the following steps :
>
> 1. Retrieve a knowledge builder from KnowledgeBuilderFactory
> 2. Load a drl rules file into builder
> 3. Create a knowledge base with the knowledge packages from the builder
> 4. Create a session from the kbase
> 4. Insert objects into the working memory => Activations are created
> 5. Fire all rules => Rules are launched , objects are created by rules and
> asserted into the WM
> 6. Retract objects generated by rules from the WM
> 7. Remove knowledge packages from the kbase
> 8. Generate another builder, load a different drl rules file and add the
> knowledge pacakges to the kbase => Activations are created automatically
> just after adding new packages but objects are created by rules and
> asserted
> into the WM.
> 9. Fire all rules -> Te agenda is empty , no rules are launched.
>
> Are the 8th and 9th steps the expected behaviour or i'm just doing
> something
> wrong ? The same seems to happen when
>
> Thanks in advance.
> Pablo.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090618/ba4981ea/attachment.html 


More information about the rules-users mailing list