cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a daily quota for instances that anonymous account can start

vasilnedev
Champ in-the-making
Champ in-the-making
Hi,

I am developing a frontend app in AngularJS. What is the best way of setting a daily quota for the number of instances that a demo (or any) user can start? The demo user is anonymous and hence I am afraid of somebody attacking the Engine via my app.

Thanks and regards

Vasil
4 REPLIES 4

vasile_dirla
Star Contributor
Star Contributor
Hi,

so you want to have a quota only for your client application (the one you are working on) or the quota should be global ? (which will affect all the client applications)

—-
Please note that a process could be started by a timer event. (and it could be configured in the process definition XML so you should do it in the engine globally in order to restrict the engine from creating too many instances.)

vasilnedev
Champ in-the-making
Champ in-the-making
Hi,

I am looking for a global solution.

Thanks!

pmsevestre
Champ in-the-making
Champ in-the-making
Two ways to to it:

1. Add a system task in your process that executes a query on Activiti´s historic data and allow/forbid it to continue

2. Create a global event listener that checks for the creation os new process instances and kill them on some condition.

vasile_dirla
Star Contributor
Star Contributor
Thanks pmsevestre for your contribution;
I have some comments:
(killing a instance after it was created maybe is not a very nice solution since he want to prevent creation)

@ vasilnedev, since you want to prevent creation of process instances maybe you could put some code inside StartProcessInstanceCmd.java in order to prevent instance creation if quota is reached. (as pmsevestre said for the first solution, by checking the historic data)