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

Vijay K Pandey VPandey at mdes.ms.gov
Mon Nov 23 23:50:36 EST 2009


Yep you made me think twice and looks like I can get this done with the new session AP, I wanted to get hold of the EntityManagerFactory and the current EntityManager set in the environment.

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: Monday, November 23, 2009 7:03 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

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
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



More information about the rules-users mailing list