I can see only one solution (besides hacking Jess itself). It would require
that the right hand sides of all rules would have to be written as an if
statement, with the condition testing some global variable ?*fire*. To
update the rules, stop the engine, remove all rules, set ?*fire* to false,
batch the clp's, call (run), set ?*fire* to true and rununtilhalt() again. -
Clumsy, but how else?
-W
On 5/20/08, ivo jonker <[EMAIL PROTECTED]> wrote:
>
> Hello everyone,
>
> For a proof-of-concept application i'm trying to re-load a directory filled
> with .clp files whenever the state of the directory changed (either, file
> changed, removed or added).
>
> This, i try to do when the engine is rununtilhalt().
>
> I did this by:
> 1. removing all rules ( rete.eval (bind ?iter ((engine)
> listDefrules))(while (?iter hasNext) (bind ?rule (?iter next))(undefrule
> (?rule getName))) )
>
> 2. reloading all rules ( RETE.batch("file.clp") )
>
> The problem with this solution is that; because all rules are removed - and
> re-insterted, all (true) rules will be executed again...
>
> My question now, is there another - better way of refreshing my rules
> during runtime?
>
> Kind regards,
> Ivo Jonker
>