Automating routine tasks with automation scripts
You use automation scripts to implement object rules, attribute validations, workflow or
escalation actions, and workflow and security condition logic for applications. Automation scripts can
reduce the time that you spend on automating tasks because you do not need to recompile files or
restart the server.
Automation scripts
Automation scripts are small, targeted pieces of code that can extend the product. An automation script consists of a launch point, variables with corresponding binding values, and the source code. You use wizards to create the components of an automation script. You create scripts and launch points or you create a launch point and associate the launch point with an existing script.
Creating automation scripts
You create automation scripts to automate routine application tasks. You can use the supplied wizards to create scripts and launch points with associated variables and bindings. You can also use the wizards to associate launch points with existing scripts.
Example: Automating assigning service requests to service groups
The development team at a manufacturing facility is asked to implement a business rule into the production system. When a pipeline leaks in the facility an operator creates a service request to report the leak. The pipeline volume determines the service group that is assigned to the service request. The development team creates a script that assigns the service request to the appropriate service group. If the volume of the pipeline is greater than a specified limit, the team must also ensure that a work log is created.
Launch points
A launch point is a complete script configuration. The configuration consists of the target application or context, the variables that are passed between the application and the script, and the body of the script.
Examples of Maximo Business Rules (MBR) scripts
Several examples are provided to illustrate how to use Maximo® Business Rules (MBR) language in several common scripting scenarios.
Variables in automation scripts
Variables determine how information is passed into or received from a script. You can configure the variables for the script in the wizards instead of declaring variables within the source code. By using variables, you reduce the complexity of the source code and make it easier to reuse the source code for different purposes.
Gathering user input by using choice messages in automation scripts
A choice message gathers user input, which can then be used in the automation script. You can use choice messages in automation scripts to create an interactive user experience. For example, a message can say that a record does not exist and ask if the record should be created.
Reusable library scripts in automation scripts
A library script is a reusable piece of programming logic that automation scripts can invoke from within the body of their code. Creating library scripts can save time and effort. Library scripts are stored in the database in the AUTOSCRIPT table.
Scheduling automation scripts to run as part of cron tasks
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.
Adding scripts that run as asynchronous jobs
You can add scripts that can run as asynchronous jobs in the product. Use the asynchronous job framework to submit jobs that need to be run one time asynchronously, such as when you want to run something quickly in the background.
Automation scripts for integration
You can use automation scripts to customize the processing transactions of integration messages by implementing object structure, publish channel, enterprise service, and invocation channel integration components.
Debugging with automation scripts
You debug a script to remove any issues before you customize applications. Print statements can be placed in a script to capture the logs that are specific to a script. Log statements in the scripting framework are automatically sent to the autoscript logger.
Error messages for users
You can display error messages to users from inside a script. For example, you can display an error message for users to see in the Assets application when an asset number does not follow the rules for naming assets.