cancel
Showing results for 
Search instead for 
Did you mean: 

how to change expiration query on workitem based on a parameter

bk1
Champ in-the-making
Champ in-the-making
Dear Activiti team,
    I have a use case where Iam sending a parameter during the execution time , this parameter is successfully getting saved on the ACT_RU_VARIABLE table . Now the use case is on my timer expiration I want to delete the work items which match with the parameter which i have set. How do I add this additional where clause on the expiration query ? It will be great if you can please point me to the documentation as to how to do it. Is it a setting on the BPMN file or can I change the expiration query execution at the run time.

Really appreciate your help Thanks in advance
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
Am I understanding you correctly that you want to fire a timer when a certain variable has been set?
If so, I'm afraid that's not an easy change … most likely it'll be a change in https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/resources/org/acti..., which could be overridden through the DbSqlSessionFactory.

Also, do take in account that joining with the variables table will have an impact on performance).

sanjeevsaxena
Champ in-the-making
Champ in-the-making
Thanks for you reply.

We have an application deployed on two application servers so as to ensure failover scenarios. Each application server is connected to its respective database. That means we have two oracle database which is synced up using golden gate. And Activiti Engine on each of these app servers.
Problem is that both the Activiti Engine picks up the same transaction which has expired and deletes the same record in its respective DBs. Due to this, the golder gate, when tries to sync up the data/deletes the record (which has been already deleted), it throws error and golden gate crashes as it is unable to delete the data.

Q1 Is the framework designed to handle such configuration somehow by updating the record with some attributes to prevent other Engine to pick up the same record?
Q2 If not, then is it possible to do something such that when one Activiti Engine picks up the record, the other Activiti Engine should not pick up the same record?

Thanks in advance

jbarrez
Star Contributor
Star Contributor
> Problem is that both the Activiti Engine picks up the same transaction which has expired

I'm not following that. How is that possible (I don't know anything about golden gate)

Q1: yes, the engine is designed to work in clustered mode and make sure jobs are executed on one node