To run a custom application from Applications Manager, you create a program type and a matching program type script.
To run a custom application within the Applications Manager environment, a program type must exist to support the application. The function of the program type is to set up the environment necessary for the program to run properly as well as pass desired data to the program.
To provide a link between the Applications Manager program type and the program you want to run, you write a custom program type script. While this requires that you do some scripting, you write only one script that can be used for all programs run by the program type. This is in keeping with the Applications Manager object-oriented approach.
Six Main Tasks
The program type script must perform all the main work of running the task. Specifically, the interface script must accomplish six main tasks:
How Applications Manager Uses Program Type Scripts
When a job is submitted, the agent creates the pm<seq_no>.sh file where <seq_no> is a unique sequence number determined by the $seq_no variable for UNIX or %seq_no% for Windows. The agent then launches the BODY script. After any applicable SYSOUT and PREFIX scripts are run, the BODY script executes the program type script named by the Applications Manager environment variable $host_command. This variable holds the name of the program type script. For example, if the SHELLS program type script is used, then $host_command will equal SHELLS. This is the section of the BODY script where the actual task is run. The program type script passes the job prompts contained in the pr<seq_no>.sh file to the program. All remaining lines of the BODY script deal with evaluating execution requirements, updating statuses, and running COMPLETION, TROUBLE, and SUCCESS scripts. The sequence of events is illustrated below.
The table below describes the processes that occur in each of the stages shown above.
Stage | Process | Results |
---|---|---|
1 |
Automation Engine |
Checks status and runs BEFORE conditions. |
2 |
Agent |
Creates PR file (pr<seq_no>.sh) and PM file (pm<seq_no>.sh). Checks status. |
3 |
PM Script |
Tests environment and launches BODY script. |
4 |
BODY Script |
Runs SYSOUT (System Output) and PREFIX run-time scripts. |
5 |
Program Type Script |
Runs program and passes PR file (pr<seq_no>.sh). |
6 |
Program Automation Engine |
Generates report output files and return code. Automation engine checks DURING and DELETED conditions. |
7 |
Program Type Script |
Reads return code, checks errors, registers output. |
8 |
BODY Script |
Checks status. Runs TROUBLE, SUCCESS, and COMPLETION run-time scripts |
9 |
Agent |
Reads final status. |
10 |
Automation Engine |
Runs AFTER conditions and writes a record to History. |