cancel
Showing results for 
Search instead for 
Did you mean: 

Using Scheduler (which starts at 23:00) to have an End Time (after 2:00AM)

HiveMind
Level 2
Hi all,

My current structure of the automation is the following:
I have two processes: Populate Queue and the Process.

I've set it up in the Scheduler that it first starts the Populate Queue (where it retrieves the items that need to be worked from a workbasket in our internal system), and once it ends, it will start up the Process.

Once the Process ends, it will again start the Populate Queue, to check if there are any new items in the workbasket, if not, it will sleep for 5 minutes, for it to check again.

Once a particular time has been reached, the entire process stops.


However, my process is supposed to start at 23:00 (so 11PM), and then to stop at 2:00 (2:00AM) - So a total runtime of 3 hours.
Whereas I'm aware of using StopAfterTime, I can't use this, as when I set the StopAfterTime to check if    StopAfterTime > 2:00AM, it will immediately stop the process once I start running it at 23:00 (as 23:00 > 2:00).

So what I wonder now is how I would have to go about to make sure that a process, which starts (and loops between the two processes) at 23:00 on, for instance, 23:00 September 1, to be stopping once 2:00AM September 2 has been reached.

The complication comes from these two processes looping between each other upon reaching the End-point of each process (I currently hard-stop it by it going to an Exception once the end time has been reached), and I wonder what calculation I could use to properly determine the correct End Time.


Situation (and current implementation):
1. Populate Queue process starts at 23:00 of every day
2. Once Populate Queue process reaches its End, it's set up in the Scheduler to then start the Process-process.
3. Once Process-process reached its End, it's starting the Populate Queue again.
4. This keeps looping between these two processes, until 2AM (of the next day) has been reached, upon which the entire process stops.

Just simply having a StopAfterTime>2:00 doesn't work, as logically it will determine this to be true when it starts at 23:00.

I hope the above makes sense, and any pointers into the right direction are appreciated.

------------------------------
Hive Mind
------------------------------
1 REPLY 1

bruce.liu
Staff
Staff
Hi Hive Mind,

How about creating a piece of logic using Blue Prism decision stages so that it works in the following manner?

If LocalTime > 23:00 Return Stop = False
Else
       If LocalTime < 02:00 Return Stop = False
          Else
       Return Stop = True

------------------------------
Bruce Liu
Senior Product Consultant, Professional Services
Blue Prism
Australia/Sydney
------------------------------