Could you post the code sample you have used for the workitem?
I am using the CommandBasedWSHumanTaskHandler class that is provided by jbpm-human-task-5.1-SNAPSHOT.jar. Attached are the configuration files, and the classes for managing the knowledgebase and mina server.
I am trying to understand and reproduce the problem. I will start with the simple example in http://community.jboss.org/people/bpmn2user/blog/2011/03/25/jbpm5--persistence-hello-process-example and see if I can reproduce the issue.
How do I proceed to re-create the problem?
1.) Start the task server (TaskServer.java).
2.) Start the tasks (e.g modify the code in ProcessTest.java) and shutdown the task server before completing the tasks.
3.) Start the task server and see if the task started in Step2 can be completed (i.e status is set to 'Completed' in database)
Yes those steps are correct, but there is also a 4th step, verify that the bpm continues to the next task once the human task is completed. Currently step 4 is what is faililng for me.
What's exactly the problem? Are you sure that you have the knowledge session that creates the process in memory, so it can be notified?
If the configured persistence does not automatically load the persisted sessions, then no I am not loading the session. From what I read, it looks like I need to use JPAKnowledgeService.newStatefulKnowledgeSession, but it requires the persisted sessions id. What is the best way to get a list of persisted session ids?
Also please note that task handler connects to the task service using a lazy connection approach.
You, however, can connect immediately so that you retrieve the task completion events even before the first task is created. To instantiate the listener using this approach you might modifying your code like this:
CommandBasedWSHumanTaskHandler taskHandler = new CommandBasedWSHumanTaskHandler(ksession);