Dynamic timer can be implemented by using a custom ActionHandler,
defined in an action that is set on the timer-create event.
The custom ActionHandler can then retrieve the Timer from the database, and change its values.
Is there a "timer-create" event? I cannot seem to find the option in the GPD. I would like to give each timer that is created for each instance of a task, a different name.
Eg. statically, the timer is given a name with the following declaration:
<timer duedate="0 seconds" name="Document Review Reminder" repeat="24 hours"> <action class="workflow.jbpm.TaskReminder"></action> </timer>
I would like to then dynamically change the name of each timer, for example: "Document Review Reminder 1" and "Document Review Reminder 2" etc. This is to workaround a jbpm bug (http://jira.jboss.org/jira/browse/JBPM-1170).
Anyone got any ideas?
Hmmm...I tested changing the name of the timer in the action class that the timer calles, by calling executionContext.gettimer().setName("NewName");
It updates the name of the timer, but now when the task instance ends, the timer is not removed. Im guessing the original name as defined in the static xml file is used to remove/end timers. That's doesn't help.
Looks like I may need to dynamically create the timer in the first place.
It seems if I dynamically create the timer, they are not ended/removed when the task instance ends.