Intrinsic Macros

The table below lists macros that are available to all programs regardless of how it is invoked:

Intrinsic Macros
Macro Meaning

USER

User of the current context. When used within a shell command, USER is the user ID from the operating system, which is not necessarily the same as the session user.

VAULT

Vault of the current context. Not available on relationship triggers since relationships can connect objects in 2 different vaults. (But is available on to/from/connect/disconnect events on business objects.)

INVOCATION

Tells how the program was invoked. Can have the following values: method, program, format, check, action, override, range, load, validate, prologue, epilogue, button, autoactivity, observer.

ARGCOUNT

Number of program parameters

TRANSACTION

Where the program was executed in terms of transaction boundaries. Potential values are read, update or an empty string, which means that it was executed outside of transaction boundaries.

HOST

Name of host machine that launched the current program

APPLICATION

Name of the application that launched the current program. Possible values are MQL, matrix, or BOS.

LANGUAGE

Language as defined in the initialization file in the variable MX_LANGUAGE_PREFERENCE.

HOME

User's home directory

PATH

Path statement of the operating system

MATRIXHOME

Directory that contains the connection file

MATRIXPATH

Path to the executable file

SELECTEDOBJECTS

List of currently selected objects to be passed to any program. This macro is populated whenever a program or method is invoked from the toolbar, right-mouse menu or Methods dialog. The macro is also populated when certain dialogs are launched via the appl command (appl icons, details, indented, star and indentedtable), as long as a dismiss program is defined. The macro's value consists of a single string of space-delimited business object IDs for the objects that are selected at the time the program or method is invoked. (For a method, this macro is redundant--it is equivalent to the OBJECTID macro--but it is populated nevertheless for consistency.)

The SELECTEDOBJECTS macro can be read into a Tcl string or list variable as follows:

# this reads the macro as a single Tcl string

set sObjs [mql get env SELECTEDOBJECTS]
# this reads the macro into a Tcl list.

set env lObjs [split [mql get env SELECTEDOBJECTS]]     

When no objects are selected, the macro is created, but holds an empty string.

WORKSPACEPATH

Directory that is used as the base directory for upload/download. For programs run through the server, it is evaluated by combining the enovia.ini settings MX_BOS_ROOT and MX_BOS_WORKSPACE, and appending a unique temporary directory for the session that runs it to avoid collisions across sessions. For desktop client configurations, it is set to the enovia.ini setting TMPDIR. These settings guarantee that the client has access to the files on the server.