-
1. Re: Using Timers to Interrupt Synchronous Process in jBPM5
dme Oct 28, 2011 2:55 PM (in response to dme)I tried a couple of scenarios to test how timeouts are handled in jBPM5.
- In the first test I added a delay timer (of 1 ms) between 2 sync process calls, once the first process is done, the boundary timer is invoked (probably because there is a delay timer) and timeout is handled correctly
- In the second test I have 3 sync processes in the sub-process. In this case after the first process goes to sleep, the second process is started in another thread which also goes to sleep when the 3rd process is started in a third thread, eventually all 3 processes complete, but the boundary timer is never fired. I was expecting the boundary timer to fire and interrput the processing. Why is the boundary timer not getting fired?
Can someone please help me understand how boundary timers are implemented in jBPM5?
Thanks.
-
2. Re: Using Timers to Interrupt Synchronous Process in jBPM5
dme Nov 3, 2011 10:26 AM (in response to dme)Hi,
Could someone with jBPM expertise please advise me if the ability to not interrupt a synchronous process is by design, or if this is a limitation which would be addressed in a future release? This will help me in designing my process flows a number of which require some kind of timeout interrupts.
Thanks.
-
3. Re: Using Timers to Interrupt Synchronous Process in jBPM5
swiderski.maciej Nov 4, 2011 7:21 AM (in response to dme)Hi,
issue you are facing is due to thread synchronization. You start a process on a thread that does not complete when timer is fired. Timer is executed on separate thread but it cannot continue because it waits until the first operation will release process instance which does not happen so the sleeping time expires in your work item handler and timer does not have opportunity to complete.
Please find attached modified work item handler that moves the work to be done on separate thread and releases the main thread that started the process. With this timer is fired properly and activity is aborted.
HTH
-
TimerTestWorkItemHandler.java.zip 630 bytes
-
-
4. Re: Using Timers to Interrupt Synchronous Process in jBPM5
dme Nov 4, 2011 1:41 PM (in response to swiderski.maciej)Hi Maciej,
Thanks for the solution. It works well for me.