[jboss-user] [jBPM] - Problem with multiple process instances and HumanTasks

Thomas Nakken do-not-reply at jboss.com
Mon Dec 12 04:53:14 EST 2011


Thomas Nakken [http://community.jboss.org/people/thomastn] created the discussion

"Problem with multiple process instances and HumanTasks"

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

--------------------------------------------------------------
Hi

I have a process involving 3 HumanTask nodes and 2 CustomService nodes. All works fine if I just run one instance of this process, when I try to setup 2 instances, strage things starts to happend. Looks like the processes influence with each other. My question is how to setup session and knowlegde base to support mulitple instances of my process.

I use this strategy to setup my session and prosesses - is this correct?

1) When application starts up we read the knowlegdebase (only done once)

2) After 1 is completed we setup the session (global session reused)
session = kbase.newStatefulKnowledgeSession() - global and reused trough application

3) When we need to start a new process, a new instance is created with the global session
     Have tried different solutions, right now this is what's done when starting up a new process instance:     

     //Register two custom work nodes
    session.getWorkItemManager().registerWorkItemHandler("START", new ApplicationWorkManager()); 
    session.getWorkItemManager().registerWorkItemHandler("APPROVED", new ApplicationWorkManager());

     //Register Human Task handler
    CommandBasedWSHumanTaskHandler handler = new CommandBasedWSHumanTaskHandler(appsession);
    session.getWorkItemManager().registerWorkItemHandler("Human Task", handler);

     WorkflowProcessInstance process = (WorkflowProcessInstance) appsession.startProcess("no.my.Process",parameters);


With just one active process things are fine, starting a second process - strage things starts to happend. E.g process number 2 skips the first Human Task which is active in process 1. Is the setup I use correct? Shall I just register WorkItemHandler once? How can i reuse my session for difference process instances?

Hope someone can help out here.. I think (and hope) JBPM is able to handle multiple instances of a process.
--------------------------------------------------------------

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

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111212/cbf3f288/attachment-0001.html 


More information about the jboss-user mailing list