Configuring email or execute based on results

You can configure the VersaLex application to generate an email based on the results of an action or a host action:

Similarly, you can also configure the VersaLex application to execute a program, script, or operating system command based on the results of an action or a host action. The syntax and rules for execute-on commands are the same as those for the SYSTEM commands (see Using operating system commands in actions), with the following differences:

Below are some Execute-on command examples:

Operating System VersaLex Execute-On command
Windows command.com /c copy x y
Windows cmd.exe /c copy x y
Windows [SuccessCodes=0-1,255] cmd.exe /c copy x y
Unix cp x y

Additionally, selected action commands can also be used in Execute-On fields. PUT and GET action commands are not available for use in Execute-On. Directory listings (LS and DIR commands) are not available for use in Execute-On for FTP protocols. To specify an action command in an Execute-On setting, the command must be preceded with the ‘$’ character. The additional character is to differentiate an action command script from an existing operating system command with the same name. The Wait for Execute On Advanced option is ignored when a SCRIPT command is executed. See SCRIPT Command. Execute-On will always wait for the JavaScript to complete. If needed, new threads may be created within JavaScript which would allow the executed script to return while further processing continues in the new thread. This logic also applies to any other action commands allowed in Execute-On. For instance, to use the local action command LCOPY (instead of the operating system copy command) use the following syntax in the Execute-On field:

$LCOPY x y

A list of multiple commands which may be either all operating system commands or the supported action commands may also be specified. The commands must be separated by either '&' or '&&’ characters. When '&' is used all commands will execute sequentially regardless of the status of the previous command. For example, two LCOPY commands in the Execute-On field could be specified as:

$LCOPY x y & LCOPY a b

where the second LCOPY executes regardless of the status of the first LCOPY. When '&&' commands is used a command will execute if the previous command does not result in an error. For example in:

$LCOPY x y  && LCOPY a b

the second LCOPY will execute only if the first LCOPY does not result in an error. For operating system commands, the ‘&’ and ‘&&’ operator functionality is dependent on the operating system or shell being used.

To set the email and execute properties for all hosts at the system level, refer to Advanced system options.

To set the email and execute properties for a specific host, see Setting advanced host properties.

Note: A property value given at the host level overrides a system level value.