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 Step | This 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 Step | This is the step used to check if an object is locked and takes an input of object Id. |
ReleaseLock Step | Takes in Object ID and is used to release the lock of the currently locked item. |
Example
Below is a downloadable example to import into Decisions.
- In a Designer Folder, select CREATE FLOW. Name the Flow and select Create.
- Add a Fetch Entities step from the Integration > Entity Framework category in the Steps panel.
- Under Type Name, configure this step to fetch the Folder.
- Set the Fetch Criteria to Folders whose fullPath Contains "DocRequests."
- Connect the NoResults outcome path to the End step.
- On the Results path, add a ForEach step.
- Configure the Collection to be the output of the Fetch Entities step "EntityResults."
- Connect the Done outcome path to the End step.
- 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.
- 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."
- Connect the Done outcome path to the ForEach step.
- On the False path, add a LockObject step from the Integration > Internal Services > ObjectLockServices category in the Steps panel.
- Using this step, the Flow will lock the object to prevent any other changes to the object from being made while editing the object.
- Under Inputs > lock for Time choose to lock the object for 1 minute.
- On the True outcome path from the IsLocked step, add a Show Form step from the Favorite Step category in the Steps panel.
- This Form has a Label stating "Object is now locked," with a Button labeled "Done."
- Connect the Done outcome path to the ForEach step.
Debug
- Select Debug in the top action panel.
- In the Debugger, see that most Folders went down the False path and the LockObject step locked the Folders.
- 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.