i aslo have this problem, do you have the solution?
my timer is aslo can't interrupt the action handler execution if it running for a long time.
If I got it well, this could be solved by defining tracking actions for node-enter and node-leave events.
In the node-enter you can capture the start time and use it in the node-leave event, to determine if the node actions were executed on time.
interupting long runnning things is not different in jBPM then in any other java application.
Make actionhandlers that can receive events (non-jbpm events) and act upon them. Have your timer send one of these events then..
But it might be a nice addition to jBPM I think to be able to cancel long running async things when they are already running (timers can be cancelled when not started yet)
There was a change in the requirements so instead of having to interrupt the execution I had to generate an alert (send an email notifying an operator of the delay in the execution).
I associated a timer to the execution of the actions, and injected the implementation of the alert/notification. I used java.util.Timer and the Timer.schedule method.
Right now I am sending an email notifying the delay in the execution, but I guess that if the requirements change once again I could create a new implementation and inject it instead of the email alert.
Ronald, I think my solution is similar to what you were suggesting with the exception that my timer is associated to the task but in your case it seems to me it would be independent. Is that correct ?
If so... how would you link the timer with the execution of the action ?