- 20 Jan 2022
- 3 Minutes to read
- Print
- DarkLight
Object Lock Services
- Updated on 20 Jan 2022
- 3 Minutes to read
- Print
- DarkLight
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:
Step | Description |
---|---|
LockObject | Locks an object in place, via input of an object Id and a lock For Time setting, which allows Designers to specify the time duration. |
IsLocked | Checks if an object is locked and takes an input of object Id. |
ReleaseLock | Takes in object Id and is used to release the lock of the currently locked item. |
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.
- From the Designer Studio, right-click a Designer Project and select Create Folder. Name it 'DocRequests'.
- In the parent Designer Folder, select create a Flow. Once completed, it will automatically open in the Flow Designer.
- From Toolbox > FAVORITE STEPS, attach a Fetch Entities step to the Start step.
- Navigate to the Fetch Entities step's Properties tab, then define the ENTITY FETCH DEFINITION by selecting Folder for Type Name.
- Select ADD under Fetch Criteria and set the Field Name to 'fullPath' and Query Match Type to Contains, then, click OK.
- Constant map 'DocRequests' to INPUTS > full Path. This ensures that the Object locked by the Object Lock Services steps is the 'DocRequests' Folder.
- Connect the No Results path to the End step.
- 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.
- On the Next path, add an IsLocked step from INTEGRATION > INTERNAL SERVICES > OBJECTLOCKSERVICE.
- From the Properties of the IsLocked step, map Item.EntityFolderID to INPUTS > object Id.
- Attach a Show Form to the True path. From the Show Form's Properties, select PICK OR CREATE FORM.
- 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.
- Connect the Done path to the ForEach Step.
- On the False path, attach a LockObject step from INTEGRATION > INTERNAL SERVICES > OBJECTLOCKSERVICE in the Toolbox tab.
- 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].
On the Done path of the LockObject step, add a Show Form step from the FAVORITE STEPS category of the Toolbox panel.
Navigate to the Show Form step's Properties tab and select PICK OR CREATE FORM.
Create a Form with the Label stating, "Object is now locked," and a Done Button. Then, save and close the Form.
Connect the Done path of the Object is locked Form to the ForEach Step.
Save the Flow, then if desired, close out via X.
Debug
- From the Flow Designer, select the Debug link from the top Action bar.
- 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. - Click CREATE NEW SESSION.
Unlocking an Object
To unlock a locked Entity, following alongside this example.
- Repeat steps 2-8 in the prior example in a new Flow. Ensure the Fetch Entities step's Input grabs the locked Entity.
- On the Next path, add a ReleaseLock step found in INTEGRATION > INTERNALSERVICES > OBJECTLOCKSERVICES.
- Open the ReleaseLock's Properties, and map the object ID Input to Item.EntityFolder.ID.
Debug
- From the Flow Designer, select the Debug link from the top Action bar.
- Click START DEBUGGING.
Upon completing the Flow, the locked Object is now released.