Reading variables from database, losing data

Hi. I’m new to camunda, and I’ve got an recent issue to solve.

I’ve got a problem reported, about one task being claimed by few people, and losing data.

I figured out that that the problem is in cache usage. First one persone claimed the task, then te second one took over and added some comment (which I can see is save to db), but then first person, who is accepting and completing the task is getting variables from his cache, and when he completes that task, then his cached stated is saved.

Is there any way to load the data from database when refreshing the page? Or maybe there is another idea concerning this problem. Any tips would be welcome.

Thanks and kind regards,

Hi @DanTrv,

how are you saving the form? By default, the save button in Tasklist only stores the current status into the browser storage and not into the database.

thanks for reply.
Yes I’m aware of save button function.
To save the form I use Complete button and everything works just fine when the task is claimed and changed by one person.
But when several people work on one task and they change some fields, add description etc. I’m using custom scripts to save the variables.

Problem occurs when the following workflow is executed:
Person A - claims the task, add some description (saved to cache and db by custom script)

Person B - claims the same task (didn’t have the cache of this task, so data is taken from database and person’s A description is visible), add another description (saved to cache and db by custom script)

Person A - claims the task, don’t add anything, just hit the complete button (data is taken from persons’s A cache, so person’s B description is missing)

So I’m wondering if there’s some good way (instead of adding some data refreshing for all the fields in custom scripts) of refreshing the data when opening the task that already has data in cache or any other idea how to address this issue.

Hi @DanTrv and @martin.stamm.

Having read your recent discussion here, I would like to ask a question about a personal issue in case you could give me some hints.
I’ve been trying to be able to save (temporarily) the state of a user task form but without any success until now :neutral_face:
I’ve tried to apply the following GitHub example (about Save button) here:

but it doesn’t play in my case.
Do you know please if I must write something additional inside the following script ?

camForm.on('store', function(evt) {
      // handle store
      // may prevent the store from being executed
      evt.storePrevented = true;

Thank you in advance for your time,