Understanding Actions
An action is a predefined response to a job event that is triggered by a job in the production schedule. You define event triggers for jobs in the Job Events dialog and associate them to actions. Actions can be linked to multiple jobs and job groups.
There are different types of actions that can be defined within TA. Each type of action can be triggered based on any job’s status, job control by an operator and an event triggered by the system. Furthermore, you can personalize actions from a set of included variables such as system, job, job event, action and user-defined information.
-
Email – An email action is a standard format email message that issues each time the associated job event is triggered. Email can be sent to any user on your network.
-
Alert – An alert action is an alert sent to the Job Activity Console, with one of four separate levels of severity: Critical, Error, Warning and Information. This is the type of action used in this exercise
-
SNMP – An SNMP message action can be sent to any SNMP-compliant manager.
-
SAP Event (SAP only) – Notifies an SAP instance that a specified event occurred in TA. Can be used to trigger an event-based job in SAP.
-
Job – TA can initiate automated job recovery procedures with a job action. The new job action also allows you to override certain command parameter values at submission time.
-
Variable – This variable update action updates user-defined variables. Since jobs can be dependent on variable values, this action can be used to start a job based on a wide selection of events experienced by another job which sets the variable.
-
Log – The log message action posts a user-defined message to the TA logging facility and optionally to the NT Application Events log, viewable from the Logs window and the NT Event Viewer (respectively).
Creating an Alert Action
In the exercise, you define an action that sends an alert to the Job Activity window when the job EDI_Download (created in the previous chapter) ends with a Completed Abnormally status.
To create an Alert action:
-
Click Definitions > Actions on the Navigation pane.
-
Double-click Alert to display the Alert window.
-
Click Add in the TA toolbar.
-
Type this message and select the variables shown in angle brackets from the Variables list. The variables appear between the brackets as <variable >.
The Job <Jobname > , owned by <JobOwner > went to <JobStatus > status on <SysDate.M/d/yy >. <JobOwner > ’s pager number is <JobPager >.
When this action is triggered, an alert record is sent to the Job Activity console for the operator to take action.
Variable |
Path |
Description |
---|---|---|
<JobName> |
Job Variables\JobNAME |
The name of the job that triggered the action. |
<JobOwner> |
Job Variables\JobOWNER |
The name of the user that owns the job. |
<JobStatus> |
Job Variables\JobSTATUS |
The status the Job is in at the time of the message. |
<SysDate.M/d/yy> |
System Variables\System Date\M/d/yy |
The day, month, date, year action was triggered. |
<Job Pager> |
Job Variables Owner’s Pager Number |
The pager number of the owner. |
-
Click OK to accept the action.
Associating the Action to the Job
You can assign the action to the EDI_Download job through the Job Events dialog.
To associate the action to the job:
-
Click Definitions > Events on the Navigation pane to display the Events window.
-
Double-click Job Events to display the Job Events window.
-
Click Add in the TA toolbar.
-
Enter Job Failed in the Event Name field.
-
Choose Job Completed Abnormally from the Event Trigger list.
-
Highlight Job Failed in the Available Action(s) list and click left arrow or drag-and-drop the Job Failed action to the Selected Action(s) section.
-
Click the Associated Job(s) tab to associate the EDI_Download job to the job event.
-
Choose EDI_Download from the list, then click Add.
Note: Click the Public option, if not already selected. This makes your event available to other TA users.
-
Click OK.
The EDI_Download job is now linked to the Job Failed alert action through the Job Failed job event.
Changing the edi.bat file to Fail
To change the edi.bat file:
-
Right-click the Edi batch file and click Edit from the context menu. The Edi.bat file opens in Microsoft Notepad
-
Change the last line of the file ocsexit 0 to ocsexit 1
-
Click Exit on Notepad’s File menu. A Notepad dialog appears.
-
Click Yes to save your changes.
-
Insert the job into the schedule by right-clicking the EDI_Download job and selecting Insert Job into Schedule from the context menu. The Insert Job Into Schedule dialog appears.
-
Click OK.
-
Click Operations > Job Activity on the Navigation pane to display the Job Activity window.
Watch as the job goes into the Active state and runs. The job eventually terminates with an Completed Abnormally status, initiating the action you defined and changing the Alerts status light at the bottom of the console to red.
Changing the Status of the Alert
To change the status of the alert:
-
Click Operations > Alerts on the Navigation pane, to display the Alerts window.
-
Double-click the alert to display the Alert Detail dialog.
-
Choose the Acknowledged option.
Note: You can enter a response or comment in the Response field.
-
Click OK to close the dialog.