Implicit variables

Implicit variables are variables that you do not define. These variables are automatically provided by the framework. Some implicit variables are not associated with any other variables, while other implicit variables are valid only when they are associated with a variable that you declare.

In addition to implicit variables, a Maximo® business object (MBO) is also available to every script. You refer to the current business object by using the mbo reserved word.

Implicit variables that are not associated to another variable are set into the script and you can refer to these variables directly by name. For example, app or mbo are not associated to other variables.

The variables in the following table are not associated to any other variable in use:

Table 1. Implicit variables that are not associated with other variables
Implicit variable Type Description Scope
action String The name of the action that is generated from the action launch point Action
app String The name of the application that the script is running against. The app variable is passed to the script. All launch points
errorgroup String Selects the message group identifier that is defined in the Database Configuration application. The errorgroup variable is set in the script. Together with the errorkey variable, the errorgroup variable points to an error message that is declared in the message repository. All launch points
errorkey String Enables script authors to set an error message from the script into the business application. The script code selects the Message Key identifier that is defined in the Database Configuration application. The errorkey works with the errorgroup and the params implicit variables. The advantage of setting an error message from the messages repository is that translated messages are automatically picked up. The script code sets the error key that is configured in the Database Configuration application. The errorkey variable is set in the script. All launch points
evalresult Boolean Workflow condition evaluation and security conditions scripts return true or false values. The evalresult variable is set in the script. Condition
interactive Boolean Indicates whether the script is running in an active user session or a non-user background session such as integration transaction processing. All launch points
launchPoint String Indicates the name of the launch point for which the script is run All launch points
mbo psdi.mbo.Mbo References the MBO that is currently being worked on All launch points
mboname String The name of the current MBO in the context of the script that is running All launch points
onadd Boolean Indicates whether the business object that the script is running against is being inserted or created. You can use the onadd variable to perform conditional actions or validations based on the state of the MBO. All launch points. Ideally used with object launch points where the script applies to multiple event types such as add, update, and delete.
ondelete Boolean Indicates whether the business object that the script is running against is being deleted All launch points
onupdate Boolean Indicates whether the business object that the script is running against is being updated All launch points
params String[] Holds the final resolved parameters to be applied into the error message posted from the script. The params implicit variable is an array. A message declared in the messages repository might have parameters defined. The contents of the message are fully resolved only at run time in the context of the script code. The params variable is used in conjunction with the errogroup variable and the errorkey variable to prepare the error message to be posted from the script code. The params variable is set in the script. All launch points
scriptHome psdi.mbo.Mbo References the MBO that is currently being worked on. The preferred approach to implementing scripts is to use the mbo keyword in the script code. Action launch point
scriptName String Provides the name of the script that is running All launch points
user String Provides user ID of the user who is currently logged in. The user variable is passed to the script and cannot be set in the code. All launch points
wfinstance psdi.workflow. WFInstance Indicates the workflow instance from which the current action was started Action launch point when the action is launched from a workflow.

Some implicit variables are valid only when they are associated with a variable declared by the user. You use these implicit variables by typing the variable you declared, an underscore and then the implicit variable. For example, if a variable called siteid is specified for a script, the line of code siteid_readonly=True causes the associated siteid attribute of the business object to become read-only. This type of implicit variable is not available for variables bound to the MAXVAR, SYSPROP, or LITERAL binding types.

In the following table, var represents the name of the variable that you explicitly define in the Automation Scripts application. The implicit variable that is associated with the primary declared variable follows the underscore.

Table 2. Implicit variables that are used with a primary variable in automation scripts
Implicit variable Type Description Launch point
var_hidden Boolean Retrieves or sets the hidden flag for the business object attribute. The script can modify the var_hidden variable if the primary variable is of an OUT or INOUT type. All launch points
var_initial The same type as the MBO attribute that the variable binds to. Provides the initial value for an attribute retrieved from the MBO. The var_initial variable is passed to the script. The script cannot modify the var_initial variable. All launch points
var_internal The same type as the MBO attribute that the variable binds to. Provides the internal value for a SYNONYMDOMAIN entry. If the primary variable is associated with a MBO attribute that is associated with a synonym domain, the var_internal implicit variable provides the corresponding internal value for the attribute. The var_internal variable is passed to the script. The script cannot modify the var_internal variable. All launch points
var_modified Boolean Provides a flag that indicates whether the value for an attribute was modified. The var_modified variable is passed to the script. The script cannot modify the var_modified variable. All launch points
var_previous The same type as the MBO attribute that the variable binds to. Provides the previous value for an attribute retrieved from the MBO. The var_previous variable is passed to the script. The script cannot modify the var_previous variable. Attribute launch points but only for the attribute that generated the event.
var_readonly Boolean Retrieves or sets the read-only flag for a business object attribute. The script can modify var_readonly if the primary variable is of an OUT or INOUT type. All launch points
var_required Boolean Retrieves or sets the required flag for a business object attribute. The script can modify var_required if the primary variable is of an OUT or INOUT type. All launch points


Feedback