yuuvis® RAD Q&A

0 votes
by (310 points)
edited by

The goal is to rule out that two users work simultaneously on an object and entries are overwritten. Index data should not be editable until the other user has saved the object.

2 Answers

+1 vote
by (1.9k points)

One way to achieve that would be to add a form script that calls rest-ws endpoint "/rest-ws/service/dms/lock/{id}".

But this has 2 problems:
1. The lock is only released if you actually change the index data and save that change.
2. The object is automatically locked every time the form is loaded, which also happens right after you change something in the index data.

To get around this you would have to add some kind of checkbox that would allow you to lock the object when you activate it. Then the lock would automatically be released after save.
But that would mean that every user would have to lock the object manually.

0 votes

@Yannicks proposed way will work but I think its not the best solution. At his suggestion it would be a better way to build a custom action in the context menu to lock this object exclusivly.
However I think optimistic locking is a good way in case of user experience, but the user should get the opportunity to react on other changes. A product solution could be, send the actual version of the dms object while saving the object. The dms service could recognize that the already saved version is higher. I that case the dms service should produce an error message that the client can handle. For example "Sabine Mustermann has changed indexdata, would you get: 1. yours, 2. theirs or 3. merge if possible. "

Maybe a product owner should decide if this a goal to be pursued.

by (14.2k points)
Chistian`s suggestion is in the backlog, but with low priority.