Object Lock Services
  • 20 Jan 2022
  • 3 Minutes to read
  • Dark
    Light

Object Lock Services

  • Dark
    Light

Article Summary

Overview

Steps within the Object Locks Services category enable users to lock, unlock, and other locking related functionalities onto an Object

Locking an Object prevents editing, either from all accounts or those specified, for the specified amount of time. Use cases of locking an object may involve preventing simultaneous edits of the same Object by different accounts or preventing editing altogether during scheduling testing and/or maintenance.

For the full list of Object Lock Services steps, refer to the Integration Step Glossary's section on this category.

Of the steps available, there are three important steps that work in tandem to achieve lock and release behavior:

StepDescription
LockObjectLocks an object in place, via input of an object Id and a lock For Time setting, which allows Designers to specify the time duration.
IsLockedChecks if an object is locked and takes an input of object Id.
ReleaseLockTakes in object Id and is used to release the lock of the currently locked item.
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. 



Locking an Object

The following example demonstrates locking and unlocking with the Lock Object, Is Locked, and ReleaseLock steps. If wishing to examine the completed example, please import the file provided.

The examples attached were developed to be instructional and were not developed as officially supported components. For more information or to engage our service team to develop fully supported, production quality solutions, please contact services@decisions.com. Import the project below to a Decisions environment on version 7.9.0 or later. Importing to earlier versions may produce errors.


  1. From the Designer Studio, right-click a Designer Project and select Create Folder. Name it 'DocRequests'.
  2. In the parent Designer Folder, select create a Flow. Once completed, it will automatically open in the Flow Designer.
  3. From Toolbox > FAVORITE STEPS, attach a Fetch Entities step to the Start step.
  4. Navigate to the Fetch Entities step's Properties tab, then define the ENTITY FETCH DEFINITION by selecting Folder for Type Name.
  5. Select ADD under Fetch Criteria and set the Field Name to 'fullPath' and Query Match Type to Contains, then, click OK.
  6. Constant map 'DocRequests' to INPUTS > full Path. This ensures that the Object locked by the Object Lock Services steps is the 'DocRequests' Folder.
  7. Connect the No Results path to the End step.
  8. From Toolbox > ITERATION, add a ForEach step to the Results path. Navigate to the Properties for the ForEach step, then map EntityResults to INPUTS > Collection.
  9. On the Next path, add an IsLocked step from INTEGRATION > INTERNAL SERVICES > OBJECTLOCKSERVICE.
  10. From the Properties of the IsLocked step, map Item.EntityFolderID to INPUTS > object Id.
  11. Attach a Show Form to the True path. From the Show Form's Properties, select PICK OR CREATE FORM.
  12. Create, design, and save a Form containing a Button control labeled 'Done' and an additional Label control stating 'Object was already locked'. Close the Form via X
  13. Connect the Done path to the ForEach Step. 
  14. On the False path, attach a LockObject step from INTEGRATION > INTERNAL SERVICES > OBJECTLOCKSERVICE in the Toolbox tab. 
  15. Navigate to the LockObject step's Properties and map Item.EntityFolderID, to object Id. Then, set lock For Time to a Constant value of 1 Minute[s].

  16. On the Done path of the LockObject step, add a Show Form step from the FAVORITE STEPS category of the Toolbox panel.

  17. Navigate to the Show Form step's Properties tab and select PICK OR CREATE FORM. 

  18. Create a Form with the Label stating, "Object is now locked," and a Done Button. Then, save and close the Form.

  19. Connect the Done path of the Object is locked Form to the ForEach Step.

  20. Save the Flow, then if desired, close out via X.

Debug

  1. From the Flow Designer, select the Debug link from the top Action bar.
  2. Click START DEBUGGING.

    The Flow will fetch the 'DocRequests' Folder, send it through the ForEach step, and check if its locked. This result returns False thus sending it to the Lock Object step to be locked before landing at the End step.

  3. Click CREATE NEW SESSION.
Upon running a second time, the Is Locked step assesses the DocRequests Folder's status as locked, and thus sends it through the True path towards the End step.



Unlocking an Object

To unlock a locked Entity, following alongside this example.

  1. Repeat steps 2-8 in the prior example in a new Flow. Ensure the Fetch Entities step's Input grabs the locked Entity.
  2. On the Next path, add a ReleaseLock step found in INTEGRATION > INTERNALSERVICES > OBJECTLOCKSERVICES.
  3. Open the ReleaseLock's Properties, and map the object ID Input to Item.EntityFolder.ID.

    Debug

    1. From the Flow Designer, select the Debug link from the top Action bar.
    2. Click START DEBUGGING.

Upon completing the Flow, the locked Object is now released.





Was this article helpful?