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&...]