When an automation script runs as part of a cron task,
the automation script does not require a launch point. You reference
the com.ibm.tivoli.maximo.script.ScriptContask Java™ class in your cron task definition,
and then you can attach an automation script to the cron task.
About this task
Cron tasks are jobs that run automatically on a fixed
schedule on the application server. For example, the ESCALATION cron
task processes escalations to ensure that critical tasks are processed
on time. You can use several predefined cron tasks and you can also
define new cron tasks. For new cron tasks, you must provide a Java class implementation that contains
the business logic that is executed on a schedule. By using this Java class reference in your cron
task definition, you can attach an automation script that provides
the business logic that is executed by the cron task.
Procedure
- In the Automation Scripts application, on the List tab,
select the action.
- Specify a name, description, and log level for the script.
- If the script requires variables, in the Variables section,
add new rows to declare the variable and bindings. You
cannot specify bindings to a Maximo® business
object. You can specify only LITERAL, SYSPROP, and MAXVAR bindings.
- Enter the source code of the automation script and click Create to
save the automation script in the database.
- In the Cron Task Setup application, create a new cron task
definition.
- In the Class field, enter com.ibm.tivoli.maximo.script.ScriptCrontask.
- Create the cron task instance that runs the automation
script.
- In the Cron Task Instances section, add a row.
- Specify the cron task instance name.
- Set the schedule for when the cron task is run.
- Select Run As User. The
security authorizations that are granted to the specified user determines
whether business logic that is related to Maximo business object can
run in the script code. For example, a value cannot
be set in a record unless the specified user has the security authorization
to write values into that record.
- In the Parameters tab, in the SCRIPTARG
row, specify a value that represents an argument for the cron task.
- In the SCRIPTNAME row, specify the name of the script that
you created to run as part of the cron task. SCRIPTNAME
is a mandatory parameter that must be populated. The script name that
you specify is passed to the automation script in the form of the scriptName implicit
variable.
- In the Details section, select the Active check
box to activate the cron task instance.
- Save the record.