Implicit variables

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

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 with 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 with other variables.

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

Table 1. Implicit variables that are not associated with other variables
Implicit variable Type Scope Description
action String Action launch point Indicates the name of the action that is generated from the action launch point.
app String All launch points Indicates the name of the application that the script is running against. The app variable is passed to the script.
domainid String Use this variable only when the attribute launch point implements the retrieve list event. Specifies the domain that is used to provide the list of values that are shown for the attribute launch point.
errorgroup String All launch points 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 identifies an error message that is declared in the message repository.
errorkey String All launch points Enables script authors to set an error message from the script into the business object. 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.
evalresult Boolean Condition launch point Set in the script. Workflow condition evaluation and security conditions scripts return true or false values.
interactive Boolean All launch points Indicates whether the script is running in an active user session or a non-user background session, such as integration transaction processing.
launchPoint String All launch points Indicates the name of the launch point for which the script is run.
listErrorGroup String Use this variable only when the attribute launch point implements the retrieve list event. Specify the listErrorGroup and listErrorKey variables together and use the messages facility in the Database Configuration application to select the message that is stored in the MAXMESSAGES table. Identifies the group ID of the message that the user sees when the retrieve list event fails.
listErrorKey String Use this variable only when the attribute launch point implements the retrieve list event. Specify the listErrorGroup and listErrorKey variables together and use the messages facility in the Database Configuration application to select the message that is stored in the MAXMESSAGES table. Identifies the key ID of the message that the user sees when the retrieve list event fails.
listOrder String Use this variable only when the attribute launch point implements the retrieve list event. Set to any ORDER BY attribute names that are used to order the results of the retrieve list event.
listWhere String Use this variable only when the attribute launch point implements the retrieve list event. Establishes which set of result data is displayed and which filter is set before the results are shown. Set the listWhere variable to a WHERE clause that uses the related MBO.
mbo psdi.mbo.Mbo All launch points References the MBO that is being worked on.
mboset psdi.mbo.MboSet Object launch points of Allow Create type References the MboSet that the new MBO will be added to.
mboname String All launch points Indicates the name of the current MBO in the context of the script that is running.
mbovalue psdi.security.UseriInfo All attribute launch point events An instance of the MBO attribute for the attribute launch point.
onadd Boolean All launch points. Ideally used with object launch points where the script applies to multiple event types such as add, update, and delete. 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 that are based on the state of the MBO.
ondelete Boolean All launch points Indicates whether the business object that the script is running against is being deleted.
onupdate Boolean All launch points Indicates whether the business object that the script is running against is being updated.
params String[] All launch points Holds the final resolved parameters to be applied into the error message that is posted from the script. The params implicit variable is an array. A message that is declared in the messages repository might have parameters that are 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 with the errogroup variable and the errorkey variable to prepare the error message that is posted from the script code. The params variable is set in the script.
relationObject String Use this variable only when the attribute launch point implements the retrieve list event. Typically used with the srcKeys and targetKeys implicit variables. Applies to the related MBO that is searched from the current MBO.
relationWhere String Use this variable only when the attribute launch point implements the retrieve list event. Typically used with the srcKeys and targetKeys implicit variables. Establishes the criteria that is used to perform the retrieve list event. Set to a WHERE clause that queries the related MBO.
scriptHome psdi.mbo.Mbo Action launch point References the MBO that is worked on. The preferred approach to implementing scripts is to use the mbo keyword in the script code.
scriptName String All launch points Provides the name of the script that is running.
service com.ibm.tivoli.maximo. script.ScriptService All launch points Added to a script by the scripting framework at run time.
srcKeys String[] When the attribute launch point implements the retrieve list event Applies to the set of attribute names from the current MBO that is used to lookup a related record in another related or target MBO. For example, the set of attribute names from the current MBO might be used to look up that FAILURECODES field from the ASSET business object.
thisvalue MBO attribute for the attribute launch point Use this variable as the init value and the init access restriction for attribute launch points Represents the current attribute. For example, thisvalue="abc" sets the current value to abc.
targetKeys String[] When the attribute launch point implements the retrieve list event Applies to the set of attribute names in the target MBO that is looked up from the current MBO on which the attribute launch point is defined.
user String All launch points Provides the user ID of the user who is logged in. The user variable is passed to the script and cannot be set in the code.
userinfo psdi.security.UserInfo All launch points Provides the object for the current context.
wfinstance psdi.workflow. WFInstance Action launch point when the action is started from a workflow. Indicates the workflow instance from which the current action was started.

Some implicit variables are valid only when they are associated with a variable that you declare. You use these implicit variables by typing the variable that 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 that are 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 Scope Description
var_hidden Boolean All launch points 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.
var_initial The same type as the MBO attribute that the variable binds to. All launch points Provides the initial value for an attribute that is retrieved from the MBO. The var_initial variable is passed to the script. The script cannot modify the var_initial variable.
var_internal The same type as the MBO attribute that the variable binds to. All launch points Provides the internal value for an 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.
var_modified Boolean All launch points 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.
var_previous The same type as the MBO attribute that the variable binds to. Attribute launch points but only for the attribute that generated the event. Provides the previous value for an attribute that is retrieved from the MBO. The var_previous variable is passed to the script. The script cannot modify the var_previous variable.
var_readonly Boolean All launch points 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.
var_required Boolean All launch points 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.