cancel
Showing results for 
Search instead for 
Did you mean: 

Timers are not deleted after workflow completion causing performance issues

mreyem
Champ in-the-making
Champ in-the-making
Hi,
I've developed a workflow using Activiti and Alfresco 4.2 that uses some timers (of type TimerCatchingEvent). Every time a timer fires a new entry is created in the ACT_RU_JOB table of Activiti, but I've read from the Activiti forums that this is the expected behaviour.
The problem is that after the workflow correctly ends the associated timer entries remain in the ACT_TU_JOB table. So after some days of workflows running the number of lines in the table becomes huge (may workflow has 3 timers. After 2 days I had > 15300 records in the table).
On top of that the Activiti scheduled job that checks if there are timers to trigger waste almost the entire CPU causing terrible performances even if there are no active workflows. If I manually empty the ACT_RU_JOB table then the CPU usage retruns to normal values.

Has someone faced the same problem? Is it a bug or is there any configuration that can be done on the Activiti scheduled job that queries the timers?

Thank you

Andrea
1 REPLY 1

jservajean
Confirmed Champ
Confirmed Champ
Hi

I had the same kind of problem.
I would use a boundaryevent to set a timer on a validation task (I wanted the files to be archived at a further date after the validation done).

<blockcode>
    <boundaryEvent id="validationTaskBoundarytimer" name="" cancelActivity="true" attachedToRef="validationTask">
      <timerEventDefinition>
        <timeDate>${wmase_dueDate}</timeDate>
      </timerEventDefinition>
    </boundaryEvent>
</blockcode>

My first way of achieving this was to set an
executionListener
on the
sequenceFlow
wiring the boundaryEvent with the endEvent, and do all the copying stuff in it.
Well, the code would execute but the files remained in the same place and the timer job still there too.
In other words, the transaction was never commited !

I solved the issue by plaing my script in a new javascript task (
<serviceTask id="archivageTask" name="Archivage" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
) between the boundaryEvent and the endEvent, and it turned out to work (don't ask me why…) !

Hope it helps.