[rules-users] Drools Flow 5.1 - How to get hold of WorkingMemory inside the WorkItemHandler

Kris Verlaenen Kris.Verlaenen at cs.kuleuven.be
Mon Nov 23 20:02:56 EST 2009


Yes, but why do you need a reference to the old WorkingMemory interface?
What do you want to do with it that you can't to using the new public
session API?

Kris

Quoting Vijay K Pandey <VPandey at mdes.ms.gov>:

> Thanks Kris. I hope this is the right way of getting hold of the
> WorkingMemory before we call the startProcess method on the session.
> 
> 
>         StatefulKnowledgeSession ksession =
> JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
> 
>         CommandBasedStatefulKnowledgeSession sess =
> (CommandBasedStatefulKnowledgeSession)ksession;
> 
>   StatefulKnowledgeSessionImpl sessImpl = 
> (StatefulKnowledgeSessionImpl) ((KnowledgeCommandContext)   
> sess.getCommandService().getContext()).getStatefulKnowledgesession();
> 
>         WorkingMemory wm = sessImpl.session;
> 
> 
> 
> Vijay
> 
> 
> 
> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org
> [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Kris
> Verlaenen
> Sent: Sunday, November 22, 2009 8:29 PM
> To: Rules Users List; Vijay K Pandey
> Subject: Re: [rules-users] Drools Flow 5.1 - How to get hold of
> WorkingMemory inside the WorkItemHandler
> 
> 
> 
> No, not really.  But you can easily set / inject this working memory
> 
> when instantiating your work item handler, so you can use this
> reference
> 
> later.
> 
> 
> 
> Kris
> 
> 
> 
> Quoting Vijay K Pandey <VPandey at mdes.ms.gov>:
> 
> 
> 
> > Hi,
> 
> >
> 
> > In Drools Flow (5.1) is there any way of getting hold of the
> 
> > org.drools.WorkingMemory inside the WorkItemHandler?
> 
> >
> 
> > Thanks
> 
> > Vijay
> 
> >
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
> 
> _______________________________________________
> 
> rules-users mailing list
> 
> rules-users at lists.jboss.org
> 
> https://lists.jboss.org/mailman/listinfo/rules-users
> 




Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



More information about the rules-users mailing list