[rules-users] Re: Load working memory with "old/existsing" facts

Arjun Dhar dhar_ar at yahoo.com
Wed Jul 25 08:04:16 EDT 2007


 <tom <at> bergstein-soraic.de> writes:

> 
> 
> I've a use case that is similar to the TroubleTicketExample that is part of 
the drools examples.  
> In this examples new tickets are inserted via workingMemory.assertObject
(ticket). However, tickets are usually managed and stored in a ticketing system 
(Remedy, Peregrine, etc). When I stop the drools engine, I assume that the 
state of the working memory is lost. When I start the engine again, I'd like to 
load the working memory with the tickets that are stored in the ticketing 
system, but I don't want to fire all rules, since I'd to avoid that rules are 
executed again (e.g., rule "Escalate" -> send a e-mail), which have been 
already executed before the drools engine has
>   been stopped. Existing tickets in the ticketing system are important facts 
for the rules!
>   and therefore the need to be loaded into the morking memory.
> 
>  
> Is there a way to build up the working memory with initial facts? 
> Can I persist the state of the working memory and load it later again? 
> 
>  
> Many thanks in advance, 
>   Tom 
> 

Hey my two bits,

Assuming I dont know much about StatefulSessions holding objects I wanted to 
check with you, is this safe? I'm not sure over a period of time if your 
objects would be released with a StatefulSession/WorkingMemory, would recommend 
you 'soak test' (test over a period of time with consistent load)

But here is the possibility:
Well the interface WorkinfgMemory -- extends --> Eventmanager which extends 
Serializable.

You could try serializing the object, or query your WorkingMemory for its state 
and save it to a database. Am assuming you are using StatefulSession so you 
will have access to WorkingMemory.

Conceptually I just think its worng to use a Rule Engine to persist state over 
a such a long period of time. Any expert opinion?

regards,
Arjun




More information about the rules-users mailing list