Property Expressions Exercise 8
Exercise 8: Multiple Time Windows
Objective
To create a job that can run in multiple time windows with the use of an expression.
Summary
Utilize an expression and a Property called FAKETIME to prevent a job from running unless it is between 2 AM and 5 AM, 11 AM and 2 PM, or 5 PM and 8 PM.
Instructions
Create the Property
- Create a Global Property called
FAKETIME
with a value of0
.
Create the Schedule
- Create a Schedule named Multiple Time Windows.
Create the Jobs
- Create a NULL Job that contains is constained by three Time windows.
- Use the
[[FAKETIME]]
Global Property that will allow us to manually update the Time. - Between
2
and5
am - Between
11
am and2
pm - Between
5
and8
pm (ToInt([[FAKETIME]]) > 02 && ToInt([[FAKETIME]]) < 05) || (ToInt([[FAKETIME]]) > 11 && ToInt([[FAKETIME]]) < 14) || (ToInt([[FAKETIME]]) > 17 && ToInt([[FAKETIME]]) < 20)
Build the Schedule
- Build the Schedule.
- Verify that the Job did not run.
Manipulate the Property
- Update the Property to a value between
02
and05
- Verify that the Job ran.
- Update the Property to a value between
05
and11
. - Restart the Job.
- Verify that the Job is waiting.
- Update the Property to a value between
11
and14
. - Verify that the Job ran again.
- Update the Property to a value between
14
and17
. - Restart the Job.
- Verify that the Job is waiting.
- Update the Property to a value between
17
and20
. - Verify that the Job ran again.
- Update the Property to a value btween
20
and24
. - Restart the Job.
- Verify that the Job is waiting.
note
In the real world, a Latest Start Time
would be used.