Object Lock Services
  • 17 Oct 2022
  • 2 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Object Lock Services

  • Dark
    Light

Article summary

Overview

The system has locking mechanisms built-in. The steps used for this are found in the Flow Designer under Integration > Internal Services > ObjectLockServices.

There are three important steps that will work in tandem to achieve lock and release behavior.  

Unless a Flow is built to display a warning and/or prevent access, users will be able to access a locked object when it's selected in the Portal. 
Step:Description:
LockObject StepThis is the step used to lock an object in place which has an input of ID and a Lock For Time setting allowing designers to specify the time duration. 
IsLocked StepThis is the step used to check if an object is locked and takes an input of object Id. 
ReleaseLock StepTakes in Object ID and is used to release the lock of the currently locked item. 

2019-10-16_095022.PNG

Example

Below is a downloadable example to import into Decisions.


  1. In a Designer Folder, select CREATE FLOW. Name the Flow and select Create.
  2. Add a Fetch Entities step from the Integration > Entity Framework category in the Steps panel.
  3. Under Type Name, configure this step to fetch the Folder
  4. Set the Fetch Criteria to Folders whose fullPath Contains "DocRequests." 
  5. Connect the NoResults outcome path to the End step.  

    2019-10-16_105331.PNG

  6. On the Results path, add a ForEach step. 
  7. Configure the Collection to be the output of the Fetch Entities step "EntityResults."
  8. Connect the Done outcome path to the End step.

    2019-10-16_105401.PNG

  9. On the Next path, add an IsLocked step from the Integration > Internal Services > ObjectLockServices category in the Steps panel. For Inputs > object Id select Item.EntityFolderID.

    2019-10-16_105420.PNG

  10. Add a Show Form step from the Favorites Category in the Steps panel. This Form has a Label stating "Object was already locked" with a Button labeled "Done." 
  11. Connect the Done outcome path to the ForEach step.

    2019-10-16_110425.PNG

    2019-10-16_131500.PNG

  12. On the False path, add a LockObject step from the Integration > Internal Services > ObjectLockServices category in the Steps panel. 
  13. Using this step, the Flow will lock the object to prevent any other changes to the object from being made while editing the object. 
  14. Under Inputs > lock for Time choose to lock the object for 1 minute.

    2019-10-16_105511.PNG

  15. On the True outcome path from the IsLocked step, add a Show Form step from the Favorite Step category in the Steps panel. 
  16. This Form has a Label stating "Object is now locked," with a Button labeled "Done." 
  17. Connect the Done outcome path to the ForEach step.

2019-10-16_105540.PNG

Debug

  1. Select Debug in the top action panel.

    2019-10-16_105813.PNG

  2. In the Debugger, see that most Folders went down the False path and the LockObject step locked the Folders.

    2019-10-16_110538.PNG

  3. Run the Debugger again to test and make sure the Folders were locked in the previous run, this is true as they all go down the True path.

    2019-10-16_110553.PNG


Was this article helpful?