Hello OutSystems forums, I want to ask about a specific case regarding execution records for the database.
Let's say we have a workflow application that have parallel approval features and multiple users can do their approval action (Approve/Revise) within a single request record. In this case, we try with two different users and each user execute a different action; User A is approving, User B is revising. Turns out each of them successfully executing the logic and its CRUD and making the approval is invalid.
Although the difference might be only a split second, we want to stop the second execution of the same single request (record). We have tried logic validation by checking the record value like the sample below but it didn't solve this case:
A BPT might be a solution for this but AFAIK it does not support workflow customization outside the source code/via programmatically (where there will be a user that can modify the workflow through master data), hence why we are not using it.
Is there any other solution to solve this execution parallel case?
Thanks,
Aditya
Hi,
Can you try with GetForUpdate entity action. Instead of GetProcessForm you should use GetProcessFormForUpdate. This method provide a lock on the record and only single user can make update the record at a time.
regards
Hi Aditya Eka Prabowo,
Hi believe this is snenario you are looking for, have a look on this link
https://success.outsystems.com/documentation/how_to_guides/data/how_to_handle_concurrent_updates_on_application_data_records/
Hope that it helps you
Hi Vikas & @Alexandre Yip , thank you for the response.
We did use the Get_table_ForUpdate action, but since the logic contains a various of tables and has a long process flow it still didn't work. Does the ForUpdate action can hold the entire logic execution?
Hi @Aditya Eka Prabowo ,I think you can introduce the assign functionality, on the click request will be assigned to a particular user, and before that, you will also need to verify that the request is not assigned to anyone then it will proceed.Regards,Anubhav