JBoss Community

Re: What happens if the TaskServer is shutdown between Created and Complete states?

created by Kris Verlaenen in jBPM - View the full discussion

The engine registers itself to the task service when you initialize your WSHumanTaskHandler.  Assume you need to recreated your session and task service (for example due to failure), the state of your process instances and of your human tasks are persisted in the session and task service respectively.  So you can restore them from database.  When reconnecting the session to the task service, the listener will also be restored.

 

There used to be an issue where there was one listener for each requested task.  The fix as applied in JBRules-2002 now uses a generic listener for all tasks.  This is also how it works in jBPM 5.0.

 

Note that the task handler usually only lazily connects to the task service (so the first time the session tries to create a task).  To make sure you connect immediately (so you can retrieve task completion events even before the first task is created), do handler.connect() after registering it.  This will instantiate the listener.

 

Kris

Reply to this message by going to Community

Start a new discussion in jBPM at Community