Gareth Edwards [https://community.jboss.org/people/garethed] created the 
discussion

"Re: Problem with multiple sessions"

To view the discussion, visit: https://community.jboss.org/message/806908#806908

--------------------------------------------------------------
I have tidied up the code and removed any thing that I think might be causing 
the issue.
The WorkflowCurrentTaskHandler is now not really doing anything as an 
experiment.
also the WorkflowEventListener is just logging the node name.

I'm still getting the same behavior.



            public void startWorkFlow(boolean startProcess, final User user) {
                 this.completed = false;
                     JPAWorkingMemoryDbLogger logger = new 
JPAWorkingMemoryDbLogger(ksession);
                  String connectorName = "Hornet" + 
UUID.randomUUID().toString();

                  final AsyncHornetQHTWorkItemHandler humanTaskHandler = new 
AsyncHornetQHTWorkItemHandler(new AsyncHornetQTaskClient(connectorName), 
ksession, OnErrorAction.LOG);
                  humanTaskHandler.setIpAddress(ipAddress);
                  humanTaskHandler.setOwningSessionOnly(true);
                              final CMTDisposeCommand dc = new 
CMTDisposeCommand();
                              dc.setWorkitemhandler(humanTaskHandler);
  
                              
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", 
humanTaskHandler); 
                              
ksession.getWorkItemManager().registerWorkItemHandler("UpdateWorkflowCurrentTask",
 new WorkflowCurrentTaskHandler(null, ksession.getId(), null));
                              ksession.addEventListener(new 
WorkflowEventListener(null, ksession.getId(), null));
                              ksession.addEventListener(new 
DefaultProcessEventListener(){
                                @Override
                                        public void 
afterProcessCompleted(ProcessCompletedEvent event){
                                     log.info("~~~~~~~~~Workflow Session:" + 
ksession.getId() + " Completed~~~~~~~~~");
                                                  log.info("Disposing of " + 
event.getProcessInstance().getProcessName() + "!");
                                                  ksession.execute(dc);
                                                  completed = true;
                                                  
workflowSettings.setCompleted(true);
                                        }
                              }); 
  
                              if (startProcess)
                                        
ksession.startProcess(workflowSettings.getWorkflowName(),workflowSettings.getWorkFlowData());
                    }
--------------------------------------------------------------

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

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

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to