CMD Heater – executing an external program
With the CMD Heater you can dynamically execute programs or scripts during an import/export run. FlowHeater processing will pause until the external program / script is complete.
The exit code returned by the application on completion is given as FlowHeater data type INTEGER. By use of the Stop Heater together with a conditional test of the exit code the run can be aborted if an error is encountered. It is possible to access the output of the program / script using FlowHeater Parameters, check out our video.
Execute when: You can choose here when then external program/script should be executed. The options available are:
Start: The program/script is invoked only once, before running the Definition begins.
Each row/record: The program/script is started for each data record processed.
End: The program/script is invoked only once, after running the Definition is completed.
Do not execute in test mode: When this option is checked the program/script will not be executed in test mode.
Execute: Enter here the program/script to run. If an EXE file is specified then the path for the file will include searching in the Windows PATH environment variable (Windows system setting). If this EXE file is available in the search path, then it is sufficient to name the program (incl. the .exe extension).
Parameter: If the program requires command line parameters, they can be entered here. If the CMD Heater has incoming values these can be dynamically passed on here by using numbered placeholders: $1 = first incoming value, $2 = second incoming value, etc. The Heater also supports FlowHeater Parameters ($PARAMETER-NAME$) and Windows system environment variables (%VARIABLE-NAME%) that are also substituted here dynamically prior to execution.
Use shell execute: This option is automatically dependent on the executable command extension: EXE = no shell execute, anything else = use shell execute. In the case of specifying/executing scripts (Perl, PHP, Powershell, etc.) the registered script interpreter is run in the background.
No popup window: When you check this option no result window is shown. This option is not available in combination with “Use shell execute”.
Wait until completion: If this option is unchecked, the Heater will not wait for the started application/script to finish. FlowHeater processing will continue as soon as the external process has started: Warning: Use this option with caution. If appropriate, together with an "Execute when" condition for the execution, see below.
Execute when: This enables you to use a FlowHeater parameter to control whether the external application/script should be executed or not. If a FlowHeater Parameter is specified here, the external application/script will only be executed when the value of the FlowHeater parameter has the Boolean value TRUE.
In order to make use of the output within import/export processing, you can select these options to redirect output channels into FlowHeater Parameter values for use in subsequent processing. Note: This feature is not available in combination with “Use shell execute”. If you require the output of a script for subsequent processing then you must directly address the script interpreter (e.g. “Perl.exe”) and the respective script parameters manually.
Save standard output in: The standard output channel is redirected to the FlowHeater Parameter specified.
Save standard error in: The standard error channel is redirected to the FlowHeater Parameter specified.