cancel
Showing results for 
Search instead for 
Did you mean: 

Real-time Environment Locking - what are the use cases?

DipinDevP
Level 6

Hi All,

Thanks for addressing my question!

Kindly anyone share a real time scenario were environment locking concept needs to be used. Everywhere we can see environment locking concept is explaining with Load Queue process. It would be great, if anyone can explain any other process in detail.

Thanks,

Dipin Dev P
RPA Professional

 

16 REPLIES 16

I understand that, but do you have any methods that you use to make sure that only selected process steps are executed only once, regardless of the number of resources on which the process is launched. I would like something that will block selected process steps once they have been executed and that steps will not be longer available to execute for the process on the rest resources.

For example, you launch process X has that steps:
1. Step A (duration 8 min)
2. Step B (duration 8 min)
3. Step C (duration 8 min)
4. Step D (duration 25 min)

in the following order:
on Resource 1 - 9:00 AM (process performed Step A, B, C and go to step D)
on Resource 2 - 9:30 AM (process on resource 1 still working and I would that this process avoid steps A, B, C and perform step D)
on Resource 3 - 10:00 AM (processes on resource 1 and 2 still working and I would that this process avoid steps A, B, C and perform step D)
on Resource 4 - 10:30 AM (processes on resource 1, 2 and 3 still working and I would that this process avoid steps A, B, C and perform step D)

Of course I have a solution (eg. I use env variable to store flags if some steps was done), but I would like to know others tips.

Many thanks,

M

Michael_S
Community Team
Community Team

Hey everyone, just dropping to say that this is a really interesting discussion with lots of fantastic, practical advice - so I'm going to feature it on our homepage banner. 

Thanks @DipinDevP for kicking this off, thanks @Denis__Dennehy@devneetmohanty07@Chakkravarthi_PR for excellent input and thank you @Ernest1 for asking even more interesting questions!

 

Hi Ernest1, Another way to design your solution solution where different steps can only be done once and you want different resources to be able to do the work if they have capacity would be to have a separate work queue for each step.  Your process is created with the logic to work 4 queues instead of 1 depending on the priorities of the separate queues and the work search logic you build within your process.

Denis__Dennehy
Level 16

Hi Dipin
The Blue Prism developer training has exercises related to adding items to work queues that use environment locks.
The flow is:
Robot Resource 1, running Process A:  Gets Environment Lock called "My Work Queue Loading Lock"
Robot Resource 1, running Process A: Runs logic to load work into my Work Queue.
Robot Resource 2, also running Process A:  Tries to get Environment Lock called "My Work Queue Loading Lock" but cannot,  so it cannot load work at the same time as Robot 1.  Being prevented from loading work means 2 robots cannot load work at the same time which might duplicate work incorrectly.  Instead it either goes on to do work in the queue or into waiting logic that waits for work to be in the queue.
Robot Resource 1, running Process A:  Releases Environment Lock called "My Work Queue Loading Lock"

My previous example with 10 robots all working in the same windows desktop environment would be like this:
Robot Resource 1, running Process A:  Gets lock called "Foreground Interface Lock - Process A"
Robot Resource 1, running Process A:  Then performs an action that requires the windows foreground.  For example activating a window and sending a global keystroke.
Robot Resource 1, running Process A: Gets lock called "Foreground Interface Lock - Process A"
Robot Resources 2 to 10, all also running Process A:  If any of the other robots running in the same environment needs to use the foreground they will also try to get the lock but fail.  they will go into a loop that tries to get the lock again every few seconds.

Ernest1
Level 5

Hi Denis, my process from example was created and is running on one queue (two in total: Parent and Child) and I can run that process on different resources/users on the same time/or different time and they work on the same queues and then not duplicate any works/items.

I have prepared logic that does not repeat steps at the beginning of the process (especially for Populate Queue) and at the end (especially for creating reports and moving files to arch).
I used various available options: environmental locks, checking if there is any element in the queue, before adding an element to the queue if there will be a duplicate, etc.). However, I would still like to know if it is possible to execute a fragment of the process only once if this process is running in parallel on other resources in given time or range time (e.g. once on given day) and how to do this? Any more tips?

Many thanks,

 

 

It should be possible Earnest,  can you simply get an environment lock at the start of a process sub-page and if it is already use exit the process sub-page immediately instead of of going through the actions in that page.  If you only want each page to be run once per day have a work queue item just for recording when the page is worked so that the last timestamp on that could also be checked.
However, it very much seems the solution we are talking about makes set and fast decisions within the process about how and when the work is worked.  Maybe think about a solution where those decisions about how many robots can do the work and on which machines is something the controllers can make at run time,  and change their mind depending on business need.

Ernest1
Level 5

Thanks Denis, timestamp I think it might be a good solution, alternatively I also considered using properties values (from Credentials) ​​and when a sub-page is executed by one process it inserts a flag or something like status into the properties value (like Sub-Page Status = Worked / Not Worked) and then all robots check this flag every time when they call to the Sub-page.