[rules-users] [droolsflow] JPAKnowledgeService - how do you reload a Session with Processes?

Bill Tarr javatestcase at yahoo.com
Wed Oct 21 13:48:22 EDT 2009


How do I FULLY reload my session with JPAKnowledgeService?  Specifically, shouldn't my session still know it's processes after reloading?

I'm using JPAKnowledgeService to persist my sessions and processes, after running, I have the following DB rows:
   
   SessionInfo - 1
   ProcessInstanceInfo - 3 (1 ClaimFlow, and 2 subflow DocFlows)

I get a session properly with loadStatefulKnowledgeSession: 

   StatefulKnowledgeSession session = JPAKnowledgeService.loadStatefulKnowledgeSession( 1, knowledgeBase, null, env );

but this statement returns an empty collection:

   Collection<ProcessInstance> instanceCollection = session.getProcessInstances();

There is no key link between @Entity SessionInfo and ProcessInstanceInfo, so that result makes sense.... but shouldn't restoring the session restore the links to the active process within that session?

I can get the processes by id, but I'm not sure grabbing a subflow works in this example, I really want the session:

    ProcessInstance processClm = session.getProcessInstance(1);

Is there actually some other way to retrieve the processes from reloaded session?

As always, thanks for the help!

Bill

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the rules-users mailing list