Environment locking

Environment Locking - Click for a larger image

Environment Locks provide a way for a Blue Prism session to 'lock' access to a particular resource or a critical section of the process, ensuring that any other sessions are made to wait for it to release the lock.

Typical uses of locks might be to assert control of the resource PC on which the session is running for a short period, or to ensure that only one session at a time attempts to update a file on the network.

A lock is created automatically when it is acquired, if it does not already exist. They can only be deleted by utilising the Locking panel in System Manager.

Each lock, when held, is tied to the session which acquired it. If the session ends, either normally, or due to an exception, any locks that it still holds are released and the managed resource is made available to other sessions which are attempting to acquire the lock.

If a resource is unable to reach the database when its session ends (eg. it has crashed the operating system, or the hard disk has failed), the lock will be orphaned – it will remain locked, and will not be automatically released.
Orphaned locks can be released from within System Manager using the Locking panel in the Workflow section.

Internal business object

The locking functionality in Blue Prism is implemented within an internal business object called "Environment Locking". This object has 3 actions, namely:

  • Acquire Lock
  • Release Lock
  • Query Lock

See the business object documentation for further details on the specifics of the action – this can be viewed by creating an action stage, selecting the business object and pressing the information icon – a page with all the inputs, outputs and details of the actions will be displayed.