Technical Blog Post
A Simple Automation Script
There are times when you may wish to set a default value for a new attribute on an application, but using a default control or a
crossover domain does not work to set this default value. If you wish to automatically copy a value from one attribute to another
as you are entering the record, then sometimes the best way to do this is with an Automation Script. An Automation Script may
sound daunting but you can create a simple script with only a single line of code that will copy the value from one attribute to another.
Once you are done submitting your script it gets executed immediately and there is no need to restart your server or rebuild/redeploy
the maximo.ear file.
In the following example in the Person application, we have added a user defined attribute called CURRENTPHONE, and we wish to
automatically copy the value from PRIMARYPHONE to CURRENTPHONE when the new Person record is being entered. We will use
an Attribute Launch Point script that can be used to customize field validations and actions.
1) Go To – System Configuration – Platform Configuration – Automation Scripting – click on Select Action – Create –
Scripting with Attribute Launch Point:
2) Then enter the following values:
Click on the 'Next' button.
3) Within the 'Create Script with Attribute Launch Point : Step 2 of 3' add the following:
Description: Setting Current Phone from Primary Phone
Script Language: jython
5) Within the Variables pane, click on New Row. Add the following:
We don't actually need to explicitly define the PRIMARYPHONE variable since it is already available implicitly inside the script
as the attribute on which the script is listening as defined in step 2. However sometimes it makes scripts easier to follow if all
Click on the Create button and your script should be completed. Please note that the Status value on the main (Automation Script)
tab will be set to Draft but this does not currently have any functionality on the script. The script will still run with this status value set
to Draft. Within the Launch Points tab – the Active? checkbox controls the logic if the Launch Point is executed, and is set to checked
(active) by default. To disable the Launch Point, uncheck the Active? checkbox and click on Save.
7) You can test your script by either adding or modifying an existing Primary Phone value in the Person (People) application.
Once you tab out of the Primary Phone attribute or save the record, the phone number value will be copied automatically from the
This is a simple example of a script but shows how you can create a script using only a few lines of code and that you don't need to be
an experienced script writer to do this.