Email and Execute-On Configuration in VersaLex
You can configure the VersaLex application to generate an email based on the result of an action or host action under the following conditions:
- On any type of failure
- On each successful send of a file
- On each successful receive of a file
- On each successful copy of a file using
LCOPY - When overall conditions are met for a
CHECKcommand (VLTrader and Harmony only) - When overall conditions are not met for a
CHECKcommand (VLTrader and Harmony only)
Execute-On Program, Script, or Command Execution
VersaLex can also be configured to execute a program, script, or operating system command based on the result of an action or host action.
The syntax and rules for Execute-On commands are similar to those used with the SYSTEM command (see Using operating system commands in actions), with the following differences:
- The word
SYSTEMis not used in the Execute-On string. - When using macro variables, the Execute-On context is used instead of the SYSTEM command context.
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 |
Using Action Commands in Execute-On
Selected action commands can also be used in Execute-On fields, with the following restrictions:
-
PUTandGETare not supported. - Directory listing commands (
LS,DIR) are not supported for FTP protocols.
To specify an action command in Execute-On, prefix the command with $. This distinguishes it from an operating system command with the same name.
Example:
$LCOPY x y— uses the VersaLexLCOPYaction instead of the OS-levelcopy.
Chaining Multiple Commands
You can specify multiple commands in the Execute-On field using the following operators:
-
&— Executes all commands sequentially, regardless of the success or failure of the previous command.
Example:$LCOPY x y & LCOPY a b
→LCOPY a bruns even ifLCOPY x yfails. -
&&— Executes the next command only if the previous command succeeds.
Example:$LCOPY x y && LCOPY a b
→LCOPY a bruns only ifLCOPY x ycompletes without error.
Note: For operating system commands, the behavior of
&and&&depends on the shell or OS being used.
SCRIPT Command Behavior
- The Wait for Execute-On Advanced option is ignored when a
SCRIPTcommand is executed.
See SCRIPT command for more information. - Execute-On will always wait for JavaScript execution to complete.
- JavaScript may spawn new threads, allowing the script to return while additional processing continues in the background.
- This behavior applies to all action commands allowed in Execute-On.
Setting Email and Execute Properties
- To configure these properties system-wide, see Advanced system options..
- To configure them for a specific host, see Setting advanced host properties.
Note: Host-level property values override system-level values.
Comments
0 comments
Please sign in to leave a comment.