[jboss-dev-forums] [jBPM Development] - Re: [jbpm5.1]Can get the current nodeId, correctly??

leo li do-not-reply at jboss.com
Thu Dec 22 21:42:11 EST 2011


leo li [http://community.jboss.org/people/leo87601] created the discussion

"Re: [jbpm5.1]Can get the current nodeId,correctly??"

To view the discussion, visit: http://community.jboss.org/message/642975#642975

--------------------------------------------------------------
The problem had been fixed after we made the StatefulKnowledgeSession as a singleton object.

private  StatefulKnowledgeSession getStatefulKnowledgeSession() throws Exception {
///////////  when we add this return and never dispose the ksession, the problem seems disappare.
                    if ( ksession != null && ksession.getWorkItemManager()!=null ){ 
                              return ksession;
                    }
/////////
  KnowledgeBase kbase = readKnowledgeBase();
  ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); 
  CommandBasedWSHumanTaskHandler humanTaskHandler = new CommandBasedWSHumanTaskHandler(ksession);   
  ksession.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);  
  SystemEventListenerFactory.setSystemEventListener(new SystemEventListener()); 
  TaskClient taskClient = new TaskClient(new MinaTaskClientConnector("MinaConnector",
  new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
  taskClient.connect("127.0.0.1", 9123);
  humanTaskHandler.setClient(taskClient);
  humanTaskHandler.connect();
  return ksession;

}
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/642975#642975]

Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2035]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20111222/91a691d9/attachment.html 


More information about the jboss-dev-forums mailing list