I need some insight. In one of my projects, the Bot runs for 48 hours. However, the Bot needs to stay idle or pause for exactly 1 hour from 11 am to 12 pm IST, and then continue the process until 11 am, after which it should idle again. How can I achieve this?
Create multiple triggers with your required running periods and mention how long the bot should run. Assuming in your case the bot actually starts running at 12pm and ends at 11pm end set the scheduling time for 11 hours and stop option if you are dealing with queues.
@jai_kumar2 Idle means you want to run another process through same bot or just want to wait for 1 hr!?
If you want to resume the process and trigger it again from the same point you can use Resume After Delay Activity
→ Download a package UiPath.Persistance.Activities Version 1.4.6
→ Add If Activity before getting the next transaction item
→ Condition: Now.Hour>=11 Or Now.Hour<=12
→ Add Resume After Delay Activity before getting the next transaction item,
→ Value for Resume Activity:CDate(Now.ToString("MM/dd/yyyy 12:00:00"))
Hi, thanks for the reply. I’m currently working on implementing an if condition where the process should go to the ‘else’ part if the time is between 1:20 AM and 2:31 AM. I’m using the following condition:
DateTime.Now.TimeOfDay >= New TimeSpan(1, 20, 0) AndAlso DateTime.Now.TimeOfDay <= New TimeSpan(2, 31, 0)
However, it seems that the process is not behaving as expected. It’s going to the ‘else’ part at the wrong time. Any insights on what might be causing this issue?
The Condition which you provided is correct, I tried it!
DateTime.Now.TimeOfDay >= New TimeSpan(1,20,0) AndAlso DateTime.Now.TimeOfDay <= New TimeSpan(2,31,0)
It is giving me expected output!
Screenshot for your reference:
I think, this condition is not executing in between 1:20 AM to 2:30 AM, that why it is not going to then part.
For actual implementation you have to run above query between that time.
or try below query:
DateTime.Now.AddHours(9).TimeOfDay >= New TimeSpan(1,20,0) AndAlso DateTime.Now.AddHours(9).TimeOfDay <= New TimeSpan(2,31,0)
Note: While executing above query time was 17 hr & 13 mins that’s why I added 9 hrs to satisfy the condition as mentioned in below screenshot. (You can change accordingly)