cancel
Showing results for 
Search instead for 
Did you mean: 

Exceptions and troubles when using time cycles

billbaroud
Champ in-the-making
Champ in-the-making
Hi Activiti users Smiley Happy

I'm trying to use Timer Catching Events with time cycles and I'm getting a lot of exceptions and problems Smiley Sad

For example, I implemented a very simple example of a workflow displaying on the standard ouput the current time every minute on the 30th second (the corresponding time cycle I used being R/2010-01-01T12:00:30Z/PT60S). I wrote a unit test that deploys this workflow and starts it 4 times, just to see if the correct output is coming.

I attached the workflow XML file and its picture, the JAVA unit test file and the output I get when running the test (with and without the exceptions).

I get the following problems:

- A lot of exceptions are raised (see stacktrace_with_exceptions.txt)
- The timers are not always fired on the 30th second of each minute, they are sometimes too early or too late (see stacktrace_no_exceptions.txt)
- Sometimes, only 2 or 3 of the 4 timers are fired (see stacktrace_no_exceptions.txt)

Of course I always clean the whole Activiti database before starting the test and I make sure that no other process is accessing it.

Am I doing something wrong ? Did someone already have problems with these timers ?

Thanks a lot Smiley Happy
2 REPLIES 2

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
The activiti JobExecutor is not meant to be used for realtime or even near real-time executions. The jobExecutor checks for jobs every 5 seconds and each job within that interval is selected, but if something is run, it is also selecting additional jobs that are due within the next period afaik.  So it could be a job is 0-5 seconds early or late. And the default number of threads for the jobExecutor is 3, might also have something to do with it…

But what a strange process if I may say so… (or I might miss something). You have a repeated timer, but the script task that is executed afterwards loops back to the same timer…

billbaroud
Champ in-the-making
Champ in-the-making
Hi and thanks a lot for the quick answer Smiley Happy

So the 5 seconds interval explains the fact that timers are sometimes not perfectly fired on schedule.

However, I still don't get why I am getting so many exceptions and why some jobs are not executed anymore after a while… (in output_no_exceptions.txt, you can see that only 3 of the 4 process instances I started are triggered by the end). Do you have an idea about that ?

As for the process I posted, it is only a very simple subset of the complex workflow I'm using, so it doesn't really makes sens in this form. However, there is no reason for this simple example not to work, is there ?

Thanks a lot for helping  Smiley Happy
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.