Object Lock/Release
  • 12 Jul 2021
  • 2 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Object Lock/Release

  • Dark
    Light

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.

Obtain an Object ID
All objects created in Decisions will have a GUID ID or an ID the represents the name of the item. Either way, this ID can be accessed by right-clicking the specified item and navigating to Manage > Get [Object] ID in the Action Menu. Obtain the Object ID of any Flow in the Decisions environment to use in this example.
  1. In a Designer Folder, select the CREATE FLOW button from the bottom Action Bar. 
  2. Use the Default Flow template and click CREATE, name the Flow, then click CREATE again.

  3. 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. 
  4. Add an IsLocked step to the Flow. 
  5. Click the orange arrow on the False path and use the same path to add a LockObject step to the Flow.

  6. Connect the Done path from the LockObject step to the End step. 
  7. Select the IsLocked step to populate the Properties for this step on the right.
  8. 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.
  9. Select the LockObject step and locate the Inputs section in the step Properties. 
  10. 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. 
  11. Change the object Id mapping type from Unknown to Constant and paste the copied Object ID in the text box that appears.
  12. Compare the step configuration to the screenshot below, save and close the Flow once complete.
Alternate Mapping Options
This example uses a Constant mapping type with a specified Object ID. Add a piece of Flow Input Data called ID of the type String [Text] at the Start step. This piece of data can now be mapped to the Object ID so that this Lock/Release process can be used as a Subflow. For information on how to setup Flow Input Data, please visit the Adding Flow Input Data section of the Create Your First Flow article.

Example Results

  1. Find the Decisions Object with which the ID was used in the Object Lock/Release Flow. 
  2. Attempt to edit that Object within the timeframe set on the LockObject step.
  3. 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.


Was this article helpful?