Generic Jobs

This subtype of the JOBS object defines generic, reusable processing steps to be carried out only in either a Windows or a UNIX target system. Like all other job objects (JOBS), Generic jobs can run independently or they can be added to a group (JOBG) or to a workflow. Generic jobs run only on Windows and UNIX agents.

Defining Generic Jobs

A Generic job definition is made up of the following pages:

Generic jobs do not have a platform-specific tab. The platform in which the job runs and the agent the jobs uses are parameters that are passed to the object at runtime. The Agent field in the Attributes page is not defined because Generic jobs use the value of the variables &AGENT# or &OVERWRITE_AGENT#. These parameters can be defined in a PromptSet or can be inherited from a variable. For more information, see Inheriting Object and PromptSet Variables.

The Process page of the job template that is delivered with the system is populated with a custom template that expects a platform-specific script. This template is a case statement that executes a case block depending on the platform.

Example

You can build and reuse a single Generic job that takes over all your file renaming tasks.

:SWITCH &$PLATFORM#

:CASE "WINDOWS"

ren "&SRC#" "&DST#"

@set retcode=%errorlevel%

@if NOT %ERRORLEVEL% == 0 goto :retcode

:CASE "UNIX"

mv "&SRC#" "&DST#"

:OTHER

:ENDSWITCH

Information such as which file has to be renamed, on which agent, using which Login object are parameters that are passed to the job at runtime. The values for the variables &SRC# (source) and &DST# (destination) and the name of the Login object can be defined in a PromptSet or can be inherited from a variable.

You can use :PUT_ATT in the Pre-Process page to overwrite either of the agent variables.

Important!

You can also use :PUT_ATT to set platform-specific attributes.

Example

:SWITCH &$PLATFORM#

:CASE "WINDOWS"

:PUT_ATT WIN_WORK_DIR= "c:\temp"

dir

:CASE "UNIX"

:PUT_ATT UNIX_SHELL= "bash"

ls

:OTHER

:ENDSWITCH

See also: