Practice: Create A Resource
Objective
To use a Resource in order to prevent multiple jobs from kicking off at the same time.
Instructions
Create the Resource
- In Library > Administration, select Resources.
- Click the Add button.
- In the Resources pop-up:
- In the Name field, enter
TrainingResource
. - In the Description field, enter in some documentation.
- In the Maximum field, enter a value of
4
. - Click the Save button.
- Click Back.
Create the Schedule
- In Library > Administration, select Master Schedules.
- Click the Add button.
- On the Master Schedule Definition screen:
- In the Schedule Name field, enter
Resource Schedule
. - Add Documentation to your Schedule.
- Monday through Sunday are working days
- Do NOT use the Master Holiday Calendar.
- Auto Build
7
days in advance for1
days - Auto Delete
7
days ago - Click the Save button.
- Click Back.
- Select Resource Schedule in the Schedule List,
- Click View.
Create the Jobs
- Select Add Job button in the side menu.
- On the Master Job Definition screen,
- In the Name field, enter
Use 2 Job A
. - 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
- Click the Save button.
- Click the Lock icon to enter Admin Mode.
- In the Documentation section, add some documentation.
- In the Frequency section, create or add desired Frequency. Click Save.
- Click Back.
- Utilizing the Copy function, copy job Use 2 Job A to create Use 2 Job B and Use 4 Job.
Create the Resource Dependency
- In Studio, select Use 2 Job A
- In the side panel, select Add Resource Dependency
- In the Resource pop-up:
- In the Resource drop down, select TrainingResource.
- In the Value textbox, enter
2
. - Click the Save button
- Click the Save button in Master Job Definition
- Repeat Steps 18-20 to add the Resource Dependency of 2 to Use 2 Job B.
- Repeat Steps 18-20 to add the Resource Dependency of 4 to Use 4 Job.
- Close Library
- Close Studio.
Create the Notification
- In Library > Management, select Notification Triggers.
- Select Manager Groups.
- On the Manage Groups screen, click Add.
- In the Name field, enter
TrainingResource
- In the Type dropdown, select Schedule.
- In the Schedule List, select Resource Schedule.
- Click Save.
- Return to the Notification Triggers main screen.
- Click Add.
- In the bottom of the Notification Triggers screen:
- In the Group Name dropdown list, select TrainingResource.
- In the Trigger Name dropdown list, select Job Running.
- Click the + button for an Email alert.
- In the Email pop-up window:
- In the To field, enter desired email (or property if you created one).
- In the Subject field, enter
Resources in Use for TrainingResource when [[$JOB NAME]] is running
- In the Message field, enter
Number of Resources for resource TrainingResource => [[RU.TrainingResource]]/[[RM.TrainingResource]]
- Click the OK button.
- Click the Save button.
- Close Library.
Build the Schedule
- Build the Schedule Released for today and view the Schedule and Job results in Processes.
- Be sure the Resource Schedule is Completed
- Open the email client and check the inbox. You should find
3
new emails. - Close Operations