- Create a script in Automation Scripts application.
Select Action > Create Script - Since it is not having any launch point, you cannot specify bindings to a Maximo Business Object. You can only specify LITERAL, MAXVARS and SYSPROP bindings.
- Enter the source code and click on Create.
- Go to > System Configuration > Platform Configuration > Cron Task Setup application and search for cron task with class com.ibm.tivoli.maximo.script.ScriptCrontask.
- If there is no cron task exists, create a New Cron Task and specify the class as com.ibm.tivoli.maximo.script.ScriptCrontask.
- Add a new row in Cron Task Instance section and specify a name, schedule and run as user.
- In the Parameters Section specify the SCRIPTNAME, which you have created in Automation Scripts application and SCRIPTARG, which is the argument you want to pass to the script.
SCRIPTNAME is a mandatory field and SCRIPTARG is optional. SCRIPTNAME will be passed to the automation script as scriptName implicit variable. - In the Cron Task Instances section, click on ACTIVE check box and save the record.
Variable in Automation Script for Cron Tasks
Below are the variables that are available in the Automation Script.
- scriptName: scriptName refers to the name of the script that is run as Cron Task.
- qName: qName refers to the name of the Cron Task instance that is running the Automation Script.
- runAsUserInfo: runAsUserInfo returns the psdi.security.UserInfo java object. You can use this variable to get additional information about the user that is associated with the Cron Task Instance.
No comments:
Post a Comment