How to Include or Exclude an Object on the First Sunday of the Month in TOM |
The Total Object Manager (TOM) product will not allow a user to use a schedule or calendar entry to include or exclude an object on an unusual period such as the first Sunday of the month. Out of the box it can include or exclude on a day or date for a period. Custom automation is needed to handle as situation such as bouncing an object on the first Sunday of the month. In this document we will provide detailed steps on how to implement a solution that will allow TOM to automatically bounce an object on the first Sunday of a month. There are two steps that must be performed to achieve this goal. They are:
Click on the entry ‘Calendar Entries’ at the bottom of the first column. This will take you to the TCALENT view which shows the calendar entries. We’re going to need twelve calendar entries for this solution. We’ll start with one for the month of April in the year 2020. Check a calendar for 2020: You can see that the date for the first Sunday of that month is the 5th. We need to add a calendar entry named ‘1st_Sunday_April’. We can do this by issuing the ‘ADD’ primary command and having control pass to the following dialog: Here you can see that we have already filled in the entry name of ‘1st_Sunday_April’ and have selected the entry type of ‘Period’. Issue the command ‘NEXT’. On this dialog we specify the date and time which we want this calendar period to cover. As you can see above we have already filled in the date of the first Sunday for April 2020 which is the 5th. We have also supplied 02:00 as the time that the period starts and 06:00 as the time that the period ends. Issue the command ‘END’. Control returns to the calendar entries view. You can see now that we have a new entry for the first Sunday of the month. It occurs on April 5th. It starts at 02:00 and ends at 06:00. This needs to be done for the other eleven months of the year. Now that we have the calendar period entries needed how do we use them? Start by adding/editing an object definition: Notice that there are no schedule entries. Since this is a normal object TOM will keep it up 24 by 7 by default. We want to use the new 1st Sunday of the Month entries to bring the object down and up every first Sunday of the month. We want the object to come down at 02:00 and come back up at 06:00. To take advantage of the 1st Sunday of the Month calendar period entries we want to place an ‘E’ on the ‘Schedules’ line on the dialog. Press ENTER and control is passed to the calendar dependencies dialog: Notice the ‘Include logic’ field on the dialog. By default, ‘AND’ will be selected. ‘AND’ means that if all the schedule statements are true then TOM will include the object. It will be started, and its status will change to ACTIVE. Selecting ‘OR’ means that if only one of the schedule statements are true and that statement includes the object then TOM will start it and change the status to ACTIVE. if the true statement excludes the object then TOM will stop it and change the status to STOPPED. Only one of the schedule statements we will define will be true at any point in time. This is because each calendar period entry specifies a different date. We want the object to come down at the beginning of the period, so we want to make sure that we set the ‘Include logic’ to ‘OR’ instead of ‘AND’. Now we are ready to start adding the period entries. We will need to add all twelve calendar period entries. Here is how we add the entry for January. We start by issuing the ‘ADD’ primary command and control goes to this dialog: Since we want this object to be stopped at the beginning of the period we want to set the ‘Type’ field in the dialog to ‘Exclude’. Placing a question mark in the ‘Period’ field under the ‘During named’ section instructs TOM to provide a list of calendar periods. Press ‘ENTER’ and control transfers to: This is a list of all the calendar period entries. We are interested in the 1st_Sunday_January entry so we will select it and press ‘END’. Control returns to the dialog for specifying calendar dependency entries: You can see that we now have the 1st Sunday entry for January. Press ‘END’ to save the calendar dependency entry. Repeat this process of adding the calendar dependency entry for the other eleven months. When complete you will see: After adding all twelve months press ‘END’ and control returns to the general object information dialog: See that there are twelve schedule entries. Save this object definition and everything is ready. When the next first Sunday arrives, the object will stop at 02:00 and start again at 06:00. The object, barring IPLs, commands to stop it or a stop of its parent, will remain up until the first Sunday after that. As each month passes you will need to update the calendar period entry for that month. Say we have passed the first Sunday in January of 2020. The dates in that entry will no longer be useful. The calendar period entry named 1st_Sunday_January will need to be updated to reflect the date of the first Sunday in January of 2021. After setting up this solution you will only need to invest a minute or less each month to update the passing calendar period entry to update it for the next year. In return for this simple monthly maintenance you do not need an EXEC to calculate the date or a set of time rules to execute the date calculation EXEC each day. If you have any questions about the implementation of this solution or on the solution itself please contact Total Object Manager support. We will be glad to answer any questions that you may have. |