Thursday 8 October 2015

Chapter 25: Working with User-defined Job Types


Chapter 25: Working with User-defined Job Types


User-Defined Job Types 
CA Workload Automation AE lets you define simple user-defined jobs. A user-defined
job type is similar to a command job except that each user-defined job type is
associated with a custom program/script/adaptor. For example, a new job type can be
defined to perform FTP. For this to work, a custom program/script/adaptor has to be
provided which does FTP by taking a few arguments. Jobs using the user-defined job
type may optionally specify arguments to the command defined in the user-defined job
type. For example, if we define FTP job type as '2', a custom program, script, or adaptor
must be provided as part of the definition of type 2.
insert_job_type: 2
command: /home/scripts/myftp
When jobs of type 2 are defined, all of them execute /home/scripts/myftp when those
jobs are run.
insert_job: ftp_test
job_type: 2
machine: localhost
std_in_file: /tmp/ftp_params
When a new version of FTP script is used, only the definition of job type has to be
modified.
You can use the following jil commands to create, update, and delete user-defined job
types.
■ insert_job_type
■ delete_job_type
■ update_job_type
 User-Defined Job Types






Only three attributes are associated with user-defined job types:
job_type
Defines the user-specified job type.
Limits: This value can be a singe-digit number (0-9).
command
Defines the command to associate with the job type.
Limits: This value can be up to 510 characters in length.
The command attribute in the job definition is optional. If you do not specify the
command attribute in the job definition, the job type uses the command attribute
of the job definition. If you specify the command attribute in the job definition, it
appends the command attribute to the job type command.
description
Defines a description of the job type.
Limits: This value can be up to 256 characters in length.
Any other attribute is rejected and JIL fails.
Note: You must define a job type before you can use it to define a job. For more
information, see the Reference Guide.
Example: Use insert_job_type to Add a User-Defined Job Type
This example creates an association between a user-defined job type and an executable.
insert_job_type: 5
description: Web Service Adapter
command:ws.exe
Example: Use delete_job_type to Delete a User-Defined Job Type
This example verifies that no jobs are currently using the specified job type, and deletes
the job type.
delete_job_type: 5 Create a New Job Type



Example: Use update_job_type to Modify a User-Defined Job Type
This example modifies an existing job type, changing the values of the description and
command attributes.
update_job_type: 5
description: WorldView Adapter
command: wv.exe
Example: Pass Arguments To a User-Defined Job Type Command
This example creates a new job type. Two jobs are defined that run with different
arguments. The user-defined job is defined to run the command /bin/sleep. Each job
specifies the sleep time as an arugment that is appended to the command. For example,
the job sleep_5 would be executed with a command /bin/sleep 5.
update_job_type: 7
description: sleep for a spell
command: /bin/sleep
insert_job: sleep_5
description: sleep for 5 seconds
job_type: 7
machine: localhost
command: 5
insert_job: sleep_30
description: sleep for 30 seconds
job_type: 7
machine: localhost
command: 30
Create a New Job Type
You can create new job types. For example, you have an adapter binary and you want to
create 300 jobs that invoke the adapter. You can create 300 command jobs and specify
the command each time or you can define a single job type (for example '0') that
represents the adapter command and define 300 jobs of type '0'.
Follow these steps:
1. Insert_job_type:0.
2. Enter the following command: special_adapter.
3. Enter the following description: This is a job type to run special adapter commands.
The new job type is created.
After you create a new job type, you must define a job to use it.
Follow these steps:
1. Insert_job:test.
2. Enter job_type:0.
3. Enter machine name: localhost.
The newly created job type can be used.
CA Workload Automation AE also supports delete_job_type and update_job_type. You
can use the delete_job_type to delete a user-defined job type, and the update_job_type
when you want to modify an existing user-defined job type.

No comments:

Post a Comment