- 12 Jul 2021
- 2 Minutes to read
- Print
- DarkLight
Object Lock/Release
- Updated on 12 Jul 2021
- 2 Minutes to read
- Print
- DarkLight
Overview
Object Lock and Release is a useful feature to lock an object, process, or Flow so that multiple processes aren't utilizing the same object at the same time. This can prevent issues from occurring such as duplicate IDs if two processes utilized the same object, but did not run in sequence. When an object is locked, it can't be opened unless the lock is released.
Example
This example will explore the use of the IsLocked and LockObject step in a Flow, with an explanation of how the ReleaseObject step would work if it is needed.
- In a Designer Folder, select the CREATE FLOW button from the bottom Action Bar.
- Use the Default Flow template and click CREATE, name the Flow, then click CREATE again.
- In the Flow Designer, click the orange arrow on the Done path from the Start step and navigate to Integrations > All Integrations > Internal Services > ObjectLockService in the Step Catalog window.
- Add an IsLocked step to the Flow.
- Click the orange arrow on the False path and use the same path to add a LockObject step to the Flow.
- Connect the Done path from the LockObject step to the End step.
- Select the IsLocked step to populate the Properties for this step on the right.
- In the Inputs section, change the object Id mapping type from Unknown to Constant and paste the copied Object ID in the text box that appears.
- Select the LockObject step and locate the Inputs section in the step Properties.
- Change the lock For Time mapping type from Unknown to Constant and use the dials or number boxes to set an appropriate lock duration for the Object.
- Change the object Id mapping type from Unknown to Constant and paste the copied Object ID in the text box that appears.
- Compare the step configuration to the screenshot below, save and close the Flow once complete.
Example Results
- Find the Decisions Object with which the ID was used in the Object Lock/Release Flow.
- Attempt to edit that Object within the timeframe set on the LockObject step.
- Notice that upon attempt, an Object is Locked window appears.
At this point, the Object Lock can be broken by selecting YES. Otherwise, another Flow can be created that uses the ReleaseObject step to perform the same function as this pop up if a different timing convention is used for the ObjectLock step.