cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti task processing in act_ru_exection, act_ru_task, act_ru_variable

jain_shweta5
Champ in-the-making
Champ in-the-making
Hi,

In my application, I have lots of fixed variables in process and task. So when I retrieve them from act_ru_task and act_ru_variable table it is a performance hit. So I am thinking of putting a trigger when insert /update/delete happens in act_ru_variable. In order to do that I should be knowing flow of when insert/update/delete happens in different cases like parallel gateway , subprocess, so that I can write my own trigger working properly.

Thanks
Shweta
6 REPLIES 6

jbarrez
Star Contributor
Star Contributor
Sounds like http://activiti.org/userguide/index.html#eventDispatcher might fit that use case.

jain_shweta5
Champ in-the-making
Champ in-the-making
Thanks for the reply,
Seems it may help. I have a timer which automatically complete the task. I thought of using TASK_COMPLETED event, but I can not see it working, so thought of using ENTITY_DELETED, when task gets completed.
Please let me know when task gets completed ,every time ENTITY_DELETED must fired , or it may fire only ENTITY_UPDATED. Thanks.

frederikherema1
Star Contributor
Star Contributor
What do you mean with "TASK_COMPLETED , does not work"? We have unit-tests for this behaviour and unless you have a failing unit-test, I'm quite confident such an event is thrown when task is completed.

You can always use ENTITY_DELETED and check for TaskEntity as the payload. This ensures you get notified when a task completes normally and is deleted preemptively (e.g.. multi-instance reached completionCondition or process instance is deleted).

jain_shweta5
Champ in-the-making
Champ in-the-making
Just to let you know , that I have a userTask, which is having timer in it, that means if user does not action on that for 30S , the task should get completed automatically. To catch this event, I have used following configuration

property name="typedEventListeners"
      map
      entry key="TASK_COMPELTED"
          list
            bean class="com.xms.workflow.CatchTaskCompeleted"
          list
        entry
      map
    property

and class is implementing ActivitiEventListener

On method public void onEvent(ActivitiEvent event) {
}

I am expecting TASK_COMPELETED should get fired, which is not. I have seen ENTITIY_DELETED works.

May be TASK_COMPLETED is not expected here.

frederikherema1
Star Contributor
Star Contributor
You're making a mistake here. A boundary timer event on a task with cancelActivity="true" does NOT complete the job, it cancels the activity. For a usertask this means deleting it without completing…

jain_shweta5
Champ in-the-making
Champ in-the-making
Thanks.
Now I have used TIMER_FIRED event instead of ENTITY_DELETED. Please confirm , if it is right. Thanks.