Did you restore your session from the db after you restarted the server and BEFORE you completed the task?
The session must be in memory so the HT Server can communicate with it.
no I did not.
But it's strange, sorry if i say those words ... but if i'm playng with client api invoking mothods such as client.complete(taskId...) why I have to restore session (on the server side)
that is an information that server can retrieve on task table using taskid such as key ... however I tried your suggestion and it works.
tx a lot
The answer is because you where interacting with Human Task API but not with process runtime API. Strange as it sounds, the relation between HT server and session is loosly-coupled. When you complete a task the HT server informs this event to all the registered listeners. If you didn't restore the ksession, there is no listener there.
Ok Esteban, I hope that this discussion doesn't going to be a "fight" (sorry for my bad english ...) and may be useful to enhance this great project. But there is something that doesn't sound good for me, let me try to expplain, may be that there is something I don't see in the API architecture/design.In order to restore the session I have to know the bpmn file i'm using to describe the process because if i don't read (again) the bpmn file i get e nullpointer excption about the process.
So that means that the restore operation has to be perfomed by the "thread" or client application that is performing client.complete(...) operation too. Thus this restoring can't be performed by the server its self ...
my 2 cents
The restore operation must be performed before the task is completed but not necesarelly by the same thread or application. In order to restore a session you need a kbase containing the definition of the process.
Let's asume you have 1 kbase per application, what you could do is: when the application is started, you restore all the ksessions you have (this information is not easy to retrieve from jbpm's predefined DB and I usually store it myself) using the kbase.
I know that u r sayng but the difficulty is, in my case that I have 4 types of process (4 bpmn files), to link the sessions to be restored with their related bpmn file.
However i will follow your suggestion to store the association (sessionId,"bpmn file") outside the standard db tables.
Tx Esteban for your very clear responses!