If you have used Rules Manager, QuickPick or Field Control then you are already familiar with the Automation Script in Maximo. The Automation Script is basically a developers tool to enable you to develop custom business rules without having to develop custom java class in Maximo.
With the Automation Scripts application, you can create scripts to automate tasks based on the events or attributes of a business object, or based on actions or custom conditions. You can create a script in any of several supported scripting languages, and execute the script without having to recompile Java files or restart the server.
Overview of Automation Script
There is already a detailed document on understanding the basics of the scripting engine, so you can read that in detail if you want. There are basic rules that you need to follow for the script to work. The first thing is the concept of a launch point. There are different types of launch points such as an Object launch point, Attribute launch point, Action launch point and a custom launch point. This is where you can select the type you want to automation script to start from. We will be using the Attribute launch point in the tutorial later. So when an attribute is modified the launch point will then be executed on that attribute.
There are also implicit variables that are supplied to the automation script that you can use in your code. These are already defined for you so you can just use them without initializing them. You can read the document for the complete list, but the most important ones are:
- app – Name of the Maximo application which initiated the script execution.
- user – Name of the user whose action initiated the script execution.
- mbo – The current mbo in the context of the script execution. For example in case of the Object Launch Point this will be the Mbo which is generating the events on which the script framework is listening on. For attribute launch point this is the attributes owner mbo. For Action launch point this is say the Escalation or workflows mbo.
- mboname – The name of the current mbo in the context of the script execution.
These will help you modify the MBO’s however you see fit.
Writing your first script
In this tutorial, I will show you how to create your first script. This script will execute from an attribute and based on that attribute, it will update another field. We will check the DESCRIPTION field and if the description is equal to “Test”, we set the WOPRIORITY field to 2.