Skip to Content
0
Feb 25, 2021 at 11:01 AM

Lock/Unlock notification from FIORI app

678 Views

Hello guys,

we are creating a FIORI app which is able to change notifications (TA: IW22). This works fine but one open point is the locking concept. As I read in several blogs and questions here, it is not that easy to implement this. I do not want optimistic lock, which lets user to go in change mode and prove at least at save button if he can change data. My goal is pessimistic lock which should work like:

1) User opens a notification in app -> always in display mode

2) There is a change button which enables editing the notification. When clicking on this button ENQUEUE object should happen.

3) When user clicks on save, data will be saved. When clicking on this button app switches to display mode and DEQUEUE object should happen.

For doing this my idea was to create an own lock entity set which gets called when user clicks on both buttons. Problem is the ENQUEUE and DEQUEUE locks only last as long as method gets called. After method call is finished lock will be lost.

I read about some buzzwords like durable locks and drafts, but did not understand how it works. There is always this

/bobf/if_lib_lock_active interface but I dont understand how its linked with the normal DPC class of my odata service? Is there any easy way how to ceate durable locks with the idea I had?

Regards

Michael