External Program
External Program action tasks are used to launch and execute other programs, which can be useful when you wish to process your job file in a way that is not possible with the standard PReS™ Workflow tasks.
As with any task that can refer to network resources, it is important to understand the considerations involved with paths and permissions of these resources. Please refer to the Network Considerations page in the Advanced Configuration and Options chapter (Reference Guide, in English only).
There are some important things to consider when using the External Program Action Task:
- The executable file must accept so-called "command-line options" and be able to run without any sort of user interaction. Only certain programs are able to do this and may refer to it as "command-line" or "automation" features.
- The process will always wait for the executable file to finish before it continues to the next task, and does not have any timeout setting. This mean that if your program fails to exit for any reason, your process will hang.
Input
Any active data file, in any format.
Processing
The external program is executed using the parameters provided. Note that the current data file is not "sent" to the executable file, however you can refer to the full path of the data file using %F.
Output
If the external program modifies the job file using the full path, the modified file is the output of this software. Otherwise, the output is the same as the input. Metadata is not modified in any way. Job Infos may be modified, depending on the options set in the task's properties.
External Program action task properties are as follows:
General tab
- Program group
- Executable file: Enter the name and path of an executable file (exe or com extension), batch file (bat extension), or command script (cmd extension) that can run in command mode. Note that the program will be run without user interaction. Although it may display progress information, it is better if the application has no user interface.
- Parameters: Enter parameters that will be passed to the external program when it is launched. Each parameter should be enclosed in quotation marks and separated by a space ("Param1" "Param2" "Param3") except command line options (such as -f, /n). The exact parameters accepted are unique to the executable and defined in its documentation if it exists.
- Start in: Enter the folder in which the external program is to run. This is important, for example, if the program is to generate files that are to be picked up in a specific location for further processing, or if it requires resources that are located in a specific folder. Leave blank to run the program in the folder of the executable file.
- Run minimized: Select to prevent a window (a DOS box, for instance) from being displayed on the desktop. When selected, the program runs in a background window.
- Program output capture group
- Log the program output: Check to store the program output (messages generated by the execution of the external program) inside of a job info or variable.
- Store the program output in variable: Use the drop-down to select which variable or job info to will be used to store the program output.
- Exit Code group
- Store the exit code in job info: Use the drop-down to select which variable or job info will be used to store the program's exit code. The exit code is a numerical value generated by the program which will indicate whether its execution was a success or if errors were encountered.
- Verify return value: Check to enable the group and react whenever specific exit codes are returned by the software.
- If exit code is: Use the drop-down to select how to compare to the exit code. This numerical comparison is either equal, greater than or lower than.
- Value: The numerical exit code that will be verified.
- Return: Use the drop-down to select whether this exit code should define a success or a failure of the external program. If "Failure" is chosen, exit codes that match the condition set will cause the On Error tab to be triggered and any other exit code will be considered a success. Inversily, if Success is chosen, exit codes that match the condition set will cause be considered a success and any other exit code will cause the On Error tab to be triggered.
On Error Tab
By default, any action task, branch, splitter or condition that generates an error will simply be ignored, and the task just under it (not within a branch) will be given control of the job file without any modification. Any initial input task that generates an error will stop the process from running as a whole, and output tasks will not generate output. The On Error tab can be used to overwrite the default behaviors.
- Send to Process: Check this option to send the job file to an error management process.
- Error Process drop-down: Enabled only when the Send to Process option is checked. Lists any process of which the initial input task is the Input Error Bin task.
- Action Group: This group is disabled in the initial input tasks and defaults to Stop Process. In all other tasks where the On Error tab is present, the following options are available:
- Ignore: The task is ignored as if it did not exist, and the job file is passed on to the next task in the process.
- Stop Branch: If the task is in a branch of the process, the branch is stopped and the job file is returned to the process after the branch. The branch will not produce any output.
- Stop Process: The process is stopped and no more processing is done. No further output is produced.
- Log Message: Check this option to enable logging a custom error message in the PlanetPress Suite Workflow Tools' log file.
- Message: Enabled only when the Log Message option is checked. Enter a message that will be logged in the PlanetPress Suite Workflow Tools' log file. You can use any variables available in PlanetPress Workflow to customize the message.
- Store the message in variable: Select in which jobinfo, local or global variable you want to store the message content.
- ID: Enter an error ID. This ID will be visible in the Windows Event Viewer. However, the ID is not visible in the PlanetPress Suite Workflow Tools' log file.
- Store the ID in variable: Select in which jobinfo, local or global variable you want to store the error ID.
- Reset to defaults: Resets all options in this tab to their default values.
If storing the message or ID, if they are store in a jobinfo they will be available in any error handling process where errors are being forwarded. In all cases, if your process continues after the error, the contents of the variables selected in this window will be available for the rest of your process, or whenever they are overwritten.
Common Errors
Though some error messages are specific to a task in particular, others may apply to any and all tasks because they are related more to the system than to PlanetPress itself. Some examples would be W3813, W3830, W3991, W4005. These correspond to issues such as not having any space to write files, permission errors on folders or files, etc.
Comments Tab
The Comments tab, added in PlanetPress Suite 7.5, is common to all tasks. It contains a single text area (Task comments) that lets you write comments about the task. These comments are saved when the dialog is closed with the OK button, and are displayed in The Task Comments Pane.