cancel
Showing results for 
Search instead for 
Did you mean: 

Real Time Requests - Advance Queue

SamLima
Level 7

@devneetmohanty07

could you please explain what is Real Time Requests? I understand the uses and main concept but need more explaination

Thanks in advance



------------------------------
Sam Lima
------------------------------
1 BEST ANSWER

Best Answers

Hi @SamLima,

I have created a sample process​ exhibiting a basic real time requests concept for you and for the sake of simplicity our use case is same as that of the use case I created for you in my prior thread implementing the Parent Child Queue relationship: Parent Child Queue Relationship.

Now, in order to run this process successfully you need to place the input files somewhere in your local machine along with the creation of an archive folder and also have a valid outlook account and an email setup to which you can send out notifications on your machine which are shown below and also setup the environment variable for the input directory as well:

33692.png

33693.png33694.png

Now coming to the components of the use case, the below components are a part of it:

33695.png

So now as you can see, in my solution I have used only one queue called as 'Real Time Requests Queue' which you need to set up as follows:

33696.png

As you can also see that I have two separate processes here called as 'Real Time Requests - Dispatcher' and 'Real Time Requests - Performer'. Here, these processes will be running separately on individual machines. In a production setup, our dispatcher process basically is going to run everyday let say at some time around 1 AM and it will stop at around 3 AM that day. Now, this stop time I have setup as a environment variable so this can be configured as and when required so when you are testing this solution remember to change this time according to the time when you are running it.

So, this dispatcher process essentially first checks if the current time is less 3 AM or not. If the time is less than 3 AM, the bot checks if the input and archive directory exists or not. If they don't exist bot throws an exception and ends the process sending out an exception email to the recipient configured in the environment variable. If the folders are available, the bot is going to create a sub directory with current run's date under the archive folder first as below:

33697.png
The bot then fetches all the file information and the loads the data from each file into the queue. Whenever, all the data from a file has been added to the queue the bot will move that file into the current date's archive folder which was created in the earlier step and then will also send out an email notification to the user saying that the contents of the current file name were added to the queue with a date time stamp so that the user gets notified immediately as soon as the file was received by the bot.
As soon as all the files have been processed and their respective emails have been sent out, the bot waits for 10 minutes and then again polls in to check whether the current time is 3 AM or not. So basically this bot is going to run till 3 AM no matter if the files are available or not and will always keep checking the files. Even if any user drops in the file during the bot run before 3 AM, the bot will still pick it up as it keeps checking the file after every 10 min interval. 

Similarly, the performer is going to be scheduled to run on a definite period, let say 30 min in between 1 AM and 3 AM in a separate VM or bot machine where it will be continuously check for the work queue items to be available which will always be added by the dispatcher and the performer is then going to process each data item and after marking every item as completed the performer also checks if there are any pending items for the current file or not. As soon as the bot confirms that all the items belonging to a particular file has been processed, it will send out a notification to user that all the items present in the current input file as been processed with the current date and time stamp.

NOTE: Here we can also run the performer on a polling basis as well if we want but I haven't included that logic since our use case is fairly straight forward so we can just create a normal process which can be designed to run on a scheduled interval basis.

So here as you can see in a real time request workflow the essential components are that your process should be as follows:

1) It should be continuously polling for inputs and check if data is available or not.

2) Secondly, prompt notifications need to be sent out as such processes are SLA bound both during the time when the input was received and the time when the output was generated as the users expect deadlines to be met at all the times.

3) Thirdly, such solutions would require multiple robots or VM's to work on the same time in order to meet the inbound load of data that needs to be processed and added to the queue and they can run for indefinite periods within a day continuously.

4) From an operation standpoint, there always need to be a contingency plan that is if let say the bot was not able to perform so and so steps then what needs to be done from a manual standpoint to make sure that the deadlines related to that item are met by the end of the TAT (Turn Around Time)

So in a very layman term if I have to explain, just think of this concept as having two people assigned with the task of filling water balloons for an event where one person is always filling up the water in a bucket and giving to his partner while he again goes to fill up the bucket once he has given his partner the bucket full of water that is what the dispatcher is doing. While the partner after receiving the bucket filled with water, uses that bucket to fill up some water balloons and keep them ready for some event that they are gonna have ahead which is exactly what the performer does in this case.

Hopefully this clears your doubt around this concept!





------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

View answer in original post

9 REPLIES 9

SamLima
Level 7
how to implement this queue?


------------------------------
Sam Lima
------------------------------

Hi @SamLima,

I have created a sample process​ exhibiting a basic real time requests concept for you and for the sake of simplicity our use case is same as that of the use case I created for you in my prior thread implementing the Parent Child Queue relationship: Parent Child Queue Relationship.

Now, in order to run this process successfully you need to place the input files somewhere in your local machine along with the creation of an archive folder and also have a valid outlook account and an email setup to which you can send out notifications on your machine which are shown below and also setup the environment variable for the input directory as well:

33692.png

33693.png33694.png

Now coming to the components of the use case, the below components are a part of it:

33695.png

So now as you can see, in my solution I have used only one queue called as 'Real Time Requests Queue' which you need to set up as follows:

33696.png

As you can also see that I have two separate processes here called as 'Real Time Requests - Dispatcher' and 'Real Time Requests - Performer'. Here, these processes will be running separately on individual machines. In a production setup, our dispatcher process basically is going to run everyday let say at some time around 1 AM and it will stop at around 3 AM that day. Now, this stop time I have setup as a environment variable so this can be configured as and when required so when you are testing this solution remember to change this time according to the time when you are running it.

So, this dispatcher process essentially first checks if the current time is less 3 AM or not. If the time is less than 3 AM, the bot checks if the input and archive directory exists or not. If they don't exist bot throws an exception and ends the process sending out an exception email to the recipient configured in the environment variable. If the folders are available, the bot is going to create a sub directory with current run's date under the archive folder first as below:

33697.png
The bot then fetches all the file information and the loads the data from each file into the queue. Whenever, all the data from a file has been added to the queue the bot will move that file into the current date's archive folder which was created in the earlier step and then will also send out an email notification to the user saying that the contents of the current file name were added to the queue with a date time stamp so that the user gets notified immediately as soon as the file was received by the bot.
As soon as all the files have been processed and their respective emails have been sent out, the bot waits for 10 minutes and then again polls in to check whether the current time is 3 AM or not. So basically this bot is going to run till 3 AM no matter if the files are available or not and will always keep checking the files. Even if any user drops in the file during the bot run before 3 AM, the bot will still pick it up as it keeps checking the file after every 10 min interval. 

Similarly, the performer is going to be scheduled to run on a definite period, let say 30 min in between 1 AM and 3 AM in a separate VM or bot machine where it will be continuously check for the work queue items to be available which will always be added by the dispatcher and the performer is then going to process each data item and after marking every item as completed the performer also checks if there are any pending items for the current file or not. As soon as the bot confirms that all the items belonging to a particular file has been processed, it will send out a notification to user that all the items present in the current input file as been processed with the current date and time stamp.

NOTE: Here we can also run the performer on a polling basis as well if we want but I haven't included that logic since our use case is fairly straight forward so we can just create a normal process which can be designed to run on a scheduled interval basis.

So here as you can see in a real time request workflow the essential components are that your process should be as follows:

1) It should be continuously polling for inputs and check if data is available or not.

2) Secondly, prompt notifications need to be sent out as such processes are SLA bound both during the time when the input was received and the time when the output was generated as the users expect deadlines to be met at all the times.

3) Thirdly, such solutions would require multiple robots or VM's to work on the same time in order to meet the inbound load of data that needs to be processed and added to the queue and they can run for indefinite periods within a day continuously.

4) From an operation standpoint, there always need to be a contingency plan that is if let say the bot was not able to perform so and so steps then what needs to be done from a manual standpoint to make sure that the deadlines related to that item are met by the end of the TAT (Turn Around Time)

So in a very layman term if I have to explain, just think of this concept as having two people assigned with the task of filling water balloons for an event where one person is always filling up the water in a bucket and giving to his partner while he again goes to fill up the bucket once he has given his partner the bucket full of water that is what the dispatcher is doing. While the partner after receiving the bucket filled with water, uses that bucket to fill up some water balloons and keep them ready for some event that they are gonna have ahead which is exactly what the performer does in this case.

Hopefully this clears your doubt around this concept!





------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

Thank you so much @devneetmohanty07 





why did add sleep stage here?

33698.png



------------------------------
Sam Lima
------------------------------

I can see that Dispatcher has a mechanism to still check on time and load the work, but how Performer will still continuously work files will arrive after get next item stage is already run?


------------------------------
Sam Lima
------------------------------

Hi Sam,

1) Sleep stage needs to be added so that we do not continuously keep on polling unnecessarily, since we would simply end up using  the system resources all the time and that would exhaust your memory at some point as every actions we implement do utilise some memory and resources of your system in order to perform the check of your input data availability. Usually it is always recommended that while having a polling logic always put a well defined interval in between of few minutes that is decided upon the frequency of the arrival of your input data by business and technical team together so that by next period bot can be ready to pick to things up.


2) Performer is going to work on the data items that got loaded in the queue by Dispatcher and that is why I have added a comment do any sort of work since here you can put anything as per your requirement to work with the items. Performer is only checking up your queue items and the item key of the queue items tells it which file exactly does that queue item belongs to. Here, it is not like everytime the Performer necessarily execute the steps as described after Get Next Time all the time. For Example, At 1 AM let say dispatcher saw 3 files were there then it will load them up in the queue. Whenever Performer works on the queue to check the items, it will find the items belonging to those 3 files and it will start processing on them while identifying at the same time which file consists of those queue items based on the Item Key. Now let say by 1:30 AM, all items got worked successfully but no more files were placed till 2 AM then Dispatcher won't be adding any further items in the queue for that period of 30 min even when it will be polling continuously. Performer will also be directly going to your 'Close Up' page stage after Get Next Item stage as in the queue ite won't find any items and hence from 1:30 AM till 2 AM basically both our performer and dispatcher would just be not working on anything.

------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

Thank you but I mean the sleep stage n populate queue before archiving the file

@devneetmohanty07

33719.png


------------------------------
Sam Lima
------------------------------

I mean first time performer will work, it will fetch the file is already in the queue but next file how it will be fetched? should I built a circular loop in Performer so it will continuously check on or repeat on get next item stage?

@devneetmohanty07



------------------------------
Sam Lima
------------------------------

You should be ideally putting some sort of sleep stage before any activity which is related to copying, moving or deleting the files as it takes some time to perform such operations. Imagine if you manually need to move a very huge file worth of GB's, you yourself will end up with a popup that shows you a timer from Windows OS itself. Hence, for a bot as well if you don't put that delay it might execute so fast that even the file might not be moved completely but it would end up working on the next step by that time.

------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

Sam, there is already a circular loop in your workflow. The Get Next Item and the Work Steps are a circular loop in itself and I already mentioned that performer is going to be run on a schedule basis every 20 or 30 min. You can even reduce the time interval between each run for the schedule. So for each run, at that point whatever is the number of items present in the queue it is going to work on that many items at that point of time.

Also, the benefit is that if during the one run of the performer itself let say dispatcher initially added data items of all the 3 files then performer is always going to work on those items but also if by the time performer works on all the items in the queue, if Dispatcher finds more files being added it will also keep on adding those additional items of these files in the queue and the performer will be able to work on those items as well before it's run ends. Ideally, both these processes are running parallely at any given point of time otherwise it will pick those items up and work on them in the next run.

Think of it like this:

1) Dispatcher: The trigger point is the source directory with Input Files.

2) Performer: The trigger point is the queue filled up by dispatcher regularly with work queue items from that folder.

------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------