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).

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.
  • To prevent failure of a command from ending execution, place a dash ("-") in front of the command string.
  • Use only one of the command or commands attributes.
  • If a command begins with an ampersand ("&"), the command will be run as a background process, and the next command will start running before the background process finishes. This allows commands to be run in parallel.
  • To direct the output of the different commands to different files, the Execute object supports the redirection (">") character present in UNIX and DOS shells.
  • If a command contains an unquoted or unescaped ">", then the output of the command will be directed to the file named following the ">".
  • If the filename or other parts of a command string contains spaces, they should be enclosed in double-quotes.
  • The redirection and append (">>") option is also supported.
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 7.1(13).)