OK so you realise that the working memory will be shared with all users? And
all state from the objects you pass into the working memory will be kept ?

Basically, the common way rules are refreshed are to create a
newWorkingMemory from the new rulebase. In your case this will not be so
easy, but I need to clarify that you are using it in the way you mean to.

On 1/4/06, Keith Marshall <[EMAIL PROTECTED]> wrote:
>
> Your assumption is correct. No I am not doing a working mem per request.
> We are using STRUTS what we have done is create a listener class that
> initiates the working memory on application startup. At that time the
> ruleBase, per say is put into application scope. When we require
> processing with rules the rulebase is removed from the context and then
> the appropriate object is asserted.  See code below:
>
>
>         ServletContext ctx = request.getSession().getServletContext();
>                 WorkingMemory mem =
> (WorkingMemory)ctx.getAttribute(Constants.RULES_ENGINE);
>
>         ...
>         ...
>
>                 //Assert the User object to the Rule Engine to process
>                 //the ApprovalProcessEntry rules. A single assertion
> here will
>                 //provide the User object with the values required for
> all tests
>                 //to follow for access to this module
>                 mem.assertObject(user);
>                 //Execute the Agenda on the object asserted
>                 mem.fireAllRules();
>
>
>                 //start page-view if
>         if (user.getCanUseApprovalProcess() ) {
>
>                 ...
>
>
> Keith A. Marshall, B.Sc. | Java Contractor, eCommerce | Ext: 1089
>
> -----Original Message-----
> From: Michael Neale [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 03, 2006 2:37 PM
> To: [email protected]
> Subject: Re: [drools-dev] JNDI
>
> HI Keith.
>
> I assume you need to change rules on the fly. Are you doing a
> workingmemory per request pattern? (ie a request comes in, you create a
> new working memory from the rule base, process the rules and then
> continue?)
>
>
>
> On 1/4/06, Keith Marshall <[EMAIL PROTECTED]> wrote:
> >
> > Michael,
> >
> > I have to find a solution for the following recommendation. However, I
>
> > am not able to find adequate documentation.
> >
> >
> >
> > "Instead of storing the object under application scope on startup,
> > clients would have to do a JNDI lookup per request to get the object.
> > If we can figure out how to do the former, it would probably be
> > simpler than using custom code. "
> >
> >
> > Keith A. Marshall, B.Sc. | Java Contractor, eCommerce | Ext: 1089
> >
> > -----Original Message-----
> > From: Michael Neale (JIRA) [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, December 29, 2005 10:37 PM
> > To: [email protected]
> > Subject: [drools-dev] [jira] Resolved: (DROOLS-469) Create new
> > ReteDumper so people do not access Dumper in reteoo directly
> >
> >      [ http://jira.codehaus.org/browse/DROOLS-469?page=all ]
> >
> > Michael Neale resolved DROOLS-469:
> > ----------------------------------
> >
> >     Resolution: Fixed
> >
> > > Create new ReteDumper so people do not access Dumper in reteoo
> > > directly
> > > --------------------------------------------------------------------
> > > --
> > > -
> > >
> > >          Key: DROOLS-469
> > >          URL: http://jira.codehaus.org/browse/DROOLS-469
> > >      Project: drools
> > >         Type: Bug
> >
> > >   Components: io, Examples
> > >     Versions: 2.5
> > >     Reporter: Michael Neale
> > >     Assignee: Michael Neale
> > >      Fix For: 2.5
> >
> > >
> > >
> > > New Dumper lives in IO module.
> > > Examples changed to use it.
> > > Was causing a problem as new RuleBase is wrapped with a serializable
> > proxy.
> > > Users need to use ReteDumper.
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > If you think it was sent incorrectly contact one of the
> administrators:
> >    http://jira.codehaus.org/secure/Administrators.jspa
> > -
> > For more information on JIRA, see:
> >    http://www.atlassian.com/software/jira
> >
> >
> >
> >
>
>
>

Reply via email to