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

Edson Tirelli tirelli at post.com
Wed Jul 25 08:41:48 EDT 2007


   Technically it is possible and supported to serialize working memories.
Although, we did faced problems with large serializations due to a known
recursion issue in JDK. There is a JIRA for that, but I don't have the link
right now.

    Now, if you want to reassert objects without firing rules, maybe what
you can do is call WorkingMemory.clearAgenda() after reasserting the
objects. Not sure if that will give you the results you expect.

    []s
    Edson


2007/7/25, Arjun Dhar <dhar_ar at yahoo.com>:
>
> <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
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  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/20070725/c6841b2b/attachment.html 


More information about the rules-users mailing list