Execute Process Object
The Integrator Execute process object allows Integrator to execute system commands as subprocesses of Integrator. It provides the capability of embedding command scripts in Integrator that get executed as part of an Integrator run. These scripts may fetch external data for Integrator, or run other applications, such as the DI Builder, to process output from Integrator. The Execute process object does not process any data but simply launches another application.
NOTE: Since the introduction of DI-Production, DI highly recommends using the Production Execute process node instead of the Integrator Execute process object (see Execute Process Node).

On OS/400, the commands are in the format of Q-shell commands rather than Command Line commands. This setup allows the use of Q-shell utility functions, such as "cat", "rm", etc. DI programs such as Builder and Integrator can be executed by giving the full Integrated File System (IFS) path name to the program object. For example:
/QSYS.LIB/ATLANTIS.LIB/BUILDER.PGM /home/di_solution/sales/ programs/sales.dsc
Command Line commands can be executed by using them as the argument to the "system" command. For example:
system "CRTLIB ATLANTIS"
Integrator uses the PATH environment variable (set using ADDENVVAR or CHGENVVAR) to locate commands that are not given by a full pathname. If no PATH variable is set, the PATH defaults to "/usr/bin:%LIB%".

On Windows platforms, built-in DOS commands (COPY, DEL, DIR, ECHO, MKDIR, MOVE, RD, RENAME, RMDIR) cannot be executed directly. They must be run within a command interpreter. Integrator detects references to these built-in commands and invokes the command interpreter on them. For example, Integrator will convert the command "echo This is a test" to "cmd.exe /c echo This is a test".
If the user needs to detect an error, third party commands that perform the same function can be used (for example, http://www.redhat.com/software/cygwin/). In other words, you can force which command interpreter is used.
Execute Attributes
Attribute | Type | Description |
---|---|---|
process_type (required) |
String | Identifies the object as an Execute process object. The value of this string is "execute". |
command | String | Specifies a single command to execute; executes as a subprocess of the Data Integrator. If there
is an error with this command, the error_command will be executed. NOTE: Either the command or commands attribute is required. Use one or the other attribute but not both. |
commands | Array of Strings | Specifies multiple commands to execute; each executes sequentially as a subprocess of Integrator. The Execute process object will wait for all background processes to end before
finishing. If there is an error executing a command, subsequent commands are not executed, and
the error_command will be executed. On Windows and OS/400, only 64 processes can be run
simultaneously. NOTE: Either the command or commands attribute is required. Use one or the other attribute but not both.
|
echo | Boolean | Controls whether or not the commands are printed to Integrator standard output as they are executed. By default, the commands are not echoed. |
error_command | String |
Specifies a command that is executed if an error occurs while running other commands. If a command fails that has a dash in front of it, the error_command is not executed. If a background command (starting with "&") fails, the error_command is not executed. This attribute is optional. NOTE: This attribute is Error Command in Visual Integrator. |
output_file | String |
Contains the name of a file to receive the output of the command(s). If specified, standard output and standard error output will be written to the given file. If not specified, standard output and standard error output will be included in Integrator output, i.e. it defaults to the command line. NOTE: This attribute is Output File in Visual Integrator. |
append_output | Boolean |
Prevents, when "true", the output_file from being cleared before new output is added. This attribute defaults to "false". NOTE: This attribute is Append Output in Visual Integrator. |
chdir | String | Defines the working directory to be set for commands that are run. If not defined, the commands are executed using the working directory for the Data Integrator itself. |
add_environment | Array of strings | Specifies new or updated environment variables to set before running the given commands. This attribute is an array of strings of the format "environment variable=environment value". Existing environment variables that are not listed are not changed and will be passed to the commands. (Available as of |