cancel
Showing results for 
Search instead for 
Did you mean: 

Environmental Locking

ShubhamSemwal
Level 3
Suppose there is environmental locks setup for a particular excel now if the 2 bot are running the same process. Assume that the lock is in an excel while one bot is accessing the excel the first bot will lock the excel until its work of excel is done and puts the data into the work queue. Now the first bot finishes the work of excel and the second bot runs and and again fetches the data it will also put the data into the work queue but here how will the process run because as per the code both the bot will put the data into the queue.
I apologize for this silly question but how will this work I want to have the understanding of this, as I am not aware of this. I want to have a clear understanding of this.

------------------------------
Shubham Semwal
Software Engineer
Larsen & Toubro Infotech
Asia/Kolkata
------------------------------
4 REPLIES 4

james.man
Staff
Staff
The second bot should skip the "put data into the work queue" step if it cannot get the lock, and go directly into working the items in the work queue.

There are also different process designs where you can pull out the "add data to work queue" into its own separate process, and the actual working from items in the work queue into a separate process.

------------------------------
James Man
Professional Services
Blue Prism
Asia/Hong_Kong
------------------------------

nobu
Staff
Staff
Hi Shubham,

> how will this work I want to have the understanding of this,
I believe you are asking how "Environmental Lock" works in your situation. If so, Blue Prism Locks an Environmental key while the first process is running and leases the key when the it's done. Please be aware that Blue Prism does NOT lock the Excel file. See the following example. 

17768.png
You can check the status when the Environmental key was lock in "System" --> "Environmental Locks".
17769.png

In this logic, the second process can't Lock the environmental key when it was locked (When the first process was still working). Therefore, you can make sure that only 1 process accesses to the Excel file. I attached the process (BPA Process - Process Template 1 - Basic.xml) just for your reference. 

If you are asking other things, please let me know.

Cheers,

Nobu





------------------------------
Nobuhiro Tokushige
Product Specialist
Blue Prism
Australia/Sydney
------------------------------

JerinJose
Level 10
for multi bot scenario it is better to have a separate process for adding items to the queue and and define logic of the item processing workflow to fetch pending item from the target Queue and work on them.

in scheduling you could have two different tasks two run them one after other 
* task 1 run process to add items to queue assigned to resource 1
* on completion of task 1 set the schedule config to run task 2 which is defined to run the main process to run parallel on resources 1-10
* in task 2 config set the on completion stop the task


------------------------------
Jerin Jose
RPA Product SME
EY
Asia/Kolkata
"If you find this post helpful, please press the "Recommend" Button.
------------------------------

John__Carter
Staff
Staff
Another simple yet effective design is for bot1 to do something with the data so that bot2 won't load it. If the data is in a file, this can be done simply by moving the file to another location, for example unread files are added to a New folder, then moved to an Old folder after loading (and before releasing the env lock).

Other techniques are marking the data in such a way that bot2 knows not to touch it, or loading cases 1 by 1 and checking whether they have already been loaded into the BP queue.

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------