AnsweredAssumed Answered

Activiti service level optimistic locking

Question asked by pkonyves on Nov 24, 2014
Latest reply on Nov 25, 2014 by trademak
Hey,

I have a process variable that many users can modify simultaneusly via their user tasks. For example a list, and users can add and remove elements to it. User A and B both see v1 of variable on their screen, then A updates it. Using RuntimeService, the version information is lost for the variable, and user B can easily overwrite the process variable: no optimistic locking.

I there any way to enforce optimistic locking on process variables in service level like the @version annotation on a JPA entity?
The problem is that when using RuntimeService, TaskService, the version info is lost.

I have 3 options:
- Either try creating my own locks as process variables
- Store the same information for the different users in different process variables then somehow merge them together
- I create a new service api for VariableInstanceEntity-s

Thanks,
Pal

Outcomes