Practice: Create A Threshold
Objective
To use a Threshold to trigger a job to run and use Notifications to let you know that the threshold is incrementing and decrementing.
Instructions
Create the Threshold
- In Library > Administration, select Thresholds.
- Click Add.
- In the Thresholds pop-up:
- In the Name field, enter
TrainingThreshold
. - In the Value field, enter a value of
0
. - In the Description field, enter in some documentation.
- Click the Save button.
- Click Back.
Create the Schedule
- In Library > Administration, select Master Schedule.
- Click Add button.
- On the Master Schedule Definition screen:
- In the Schedule Name field, enter
Threshold Schedule
. - Add Documentation
- Monday - Sunday are working days.
- Do NOT use the Master Holiday Calendar.
- Auto Build
7
days in advance for1
days. - Auto Delete
7
days ago.
Create the Jobs
- In Studio, select Threshold Schedule and click View.
- In the side menu, select Add Job.
- In the Master Job Definition screen:
- In the Name field, enter
Threshold Dependency Job
. - In the Job Type drop down, select Windows.
- In the Machine Selection section, select the desired machine from the Machines or Machine Group drop down.
- In the General section, select the desired user from the User Id drop down.
- Under the Run section, type the following in the Command Line box:
timeout /t 10
- Add Documentation.
- In the Frequency section, create or add desired Frequency.
- Click Back to get back to the Studio.
- Utilizing the Copy function, copy Threshold Dependency Job to add a second job called, Threshold Update Job.
Create Threshold Dependencies and Updates
- In Studio, select the Threshold Dependency Job.
- In the side menu, select Add Threshold Dependency.
- In the Threshold pop-up window:
- In the Threshold drop down, select TrainingThreshold.
- In the Operator drop down, select =.
- In the Value field, enter
2
. - Click Save.
- In Studio, select the Threshold Dependency Job.
- In the side menu, select Add Threshold Update.
- In the Threshold pop-up window:
- In the Threshold drop down, select TrainingThreshold.
- In the Job Status drop down, select Finish OK.
- In the Value field, enter
0
. - Click Save.
- Click Back.
- In Studio, select the Threshold Update Job.
- In the side menu, select Add Threshold Update.
- In the Threshold pop-up window:
- In the Threshold drop down, select TrainingThreshold.
- In the Job Status drop down, select Finish OK.
- In the Value field, enter
2
. - Click Save.
Create NULL Jobs and Define the Notify Events
- In the side menu in Studio, select Add Job
- On the Master Job Definition screen:
- In the Name field, enter
Initial Value Notification
. - In the Job Type field, leave it as Null Job.
- Add Documentation.
- In the Frequency section, create or add the desired Frequency.
- Click Save.
- Click Back to get back to the Studio.
- Utilizing the Copy function, copy the Initial Value Notification job to create 2 more jobs. One called, After Update Job and the other called Final Value Job.
- Select the Initial Value Notification, click the Wrench icon and enter Admin Mode.
- In the Event section, click +
- In the Event pop-up window:
- In the Send Event On dropdown, select Job Status.
- In the Job Status dropdown, select Finished OK.
- In the Event Template dropdown, select
$NOTIFY:EMAIL
and update the Events parameters as follows:- In the To, enter desired email.
- In the Subject, enter
Initial value of TrainingThreshold
- In the Message, enter
Initial value of TrainingThreshold is [[TH.TrainingThreshold]]
- Click the Save button.
- Click the Save button in Master Job Definition.
- Click Back
- Select the After Update Job, click the Wrench icon and enter Admin Mode.
- In the Event section, click +
- In the Event pop-up window:
- In the Send Event On dropdown, select Job Status.
- In the Job Status dropdown, select Finished OK.
- In the Event Template dropdown, select
$NOTIFY:EMAIL
and update the Events parameters as follows:- In the To, enter desired email.
- In the Subject, enter
After the Update
- In the Message, enter
After the update the value of TrainingThreshold is [[TH.TrainingThreshold]]
- Click the Save button.
- Click the Save button in Master Job Definition.
- Click Back
- Select the Final Value Job, click the Wrench icon and enter Admin Mode.
- In the Event section, click +
- In the Event pop-up window:
- In the Send Event On dropdown, select Job Status.
- In the Job Status dropdown, select Finished OK.
- In the Event Template dropdown, select
$NOTIFY:EMAIL
and update the Events parameters as follows:- In the To, enter desired email.
- In the Subject, enter
Final value of TrainingThreshold
- In the Message, enter
Final value of TrainingThreshold is [[TH.TrainingThreshold]]
- Click the Save button.
- Click the Save button in Master Job Definition.
- Click Back
Add Job Dependencies
- Select the Final Value Job, click Add Dependency in the side menu.
- In the Job Dependency pop-up window, select Threshold Dependency Job.
- Click Save.
- Select the After Update Job, click Add Dependency in the side menu.
- In the Job Dependency pop-up window, select Threshold Update Job.
- Click Save.
- Select the Threshold Update Job, click Add Dependency in the side menu.
- In the Job Dependency pop-up window, select Initial Value Notification.
- Click Save.
Build the Schedule
- In Operations, build the Schedule Released for today.
- Be sure the Threshold Schedule is Completed.
- Open the email client and check the inbox.
- You should find
3
new emails. Open the emails and check the contents.
tip
Once all the dependencies and events have been configured, your workflow should look something like this: