-
1. Persisting Human Task, letting user to complete after server restart.
salaboy21 Apr 22, 2011 7:54 AM (in response to heathcliff)Hi Adam,
I think that you are mixing a lot of concepts here. Don't get me wrong, it usually happens. The concept of save point also includes Human Tasks. Human interactions are considered as long living activities. For that reason the engine need to wait until the task is completed. As you mention all this waiting happens in a database, so you don't need to be worried about the application is running or not. Obviously the task server needs to be up when the user cames back and want's to interact, but it doesn't mean that needs to be up all time. Right now in jBPM5, we keep two different things persisted.
1) A knowledge runtime snapshot (SessionInfo in the database)
2) The status of each particular task inside the task server.
The task server is configured to use persistence by default, but as far as I remember, it's configured to use an in memory database. You should go and change that to a real database like MySQL/Postgres.
For having persistence of your processes status, that you will need if you are using human tasks interactions you need to use JPAKnowledgeService helpers to keep your sessions persisted in a database.
Greetings.
-
2. Re: Persisting Human Task, letting user to complete after server restart.
sridhar532 Nov 7, 2011 7:42 AM (in response to salaboy21)Hi , I am also facing a similar issue. After lauching a process in a session , if i Restart my Human Task Server and try Completing the Task by loading the same session, Tasks get Completed but the Workflow does not move forward. Does somebody have any thoughts ?
-
3. Re: Persisting Human Task, letting user to complete after server restart.
calca Nov 7, 2011 12:55 PM (in response to sridhar532)Hey,
Could you please give more details about how you are making it? I mean, some test case that can help to understand why it is not moving forward.
After re loading the same session, are you registering the CommandBasedWSHumanTaskHandler again to it?
Demian
-
4. Re: Persisting Human Task, letting user to complete after server restart.
salaboy21 Nov 7, 2011 12:58 PM (in response to calca)Yes, as Demian says, you need to re register the listener if the server goes down. Make sure that after the server start again the active session is registered and connected with that instance of the task server.
Cheers
-
5. Re: Persisting Human Task, letting user to complete after server restart.
sridhar532 Nov 7, 2011 11:52 PM (in response to calca)Hey Demain, This is what am doing.
1) Launching the process with a new StatefulKnowledgeSession.
2) Calling ksession.dispose after launching the process.
3) Claiming the Task for a user
4) Restarting my Human Task Server.
5) ksession.dispose() method do not make the session as "null". I could see that ksession is still available during Completing the Task.
6) When I Complete the Tasks gets Completed but the Workflow does not move forward.
-
6. Re: Persisting Human Task, letting user to complete after server restart.
sridhar532 Nov 10, 2011 7:27 AM (in response to sridhar532)I found the solution. After Restarting the Human Task Server we need to load the Session that created the Task and use below code to register the handler once again with the Session and Connect it before performin the Complete Operation
CommandBasedWSHumanTaskHandler wsHumanTaskHandler=new CommandBasedWSHumanTaskHandler(ksession);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task",wsHumanTaskHandler);
wsHumanTaskHandler.connect();