SystemExecute

Available in Community Designer

Short Description
Ports
Metadata
SystemExecute Attributes
Details
Best Practices
See also

Short Description

SystemExecute executes system commands.

Component Same input metadata Sorted inputs Inputs Outputs Each to all outputs [1] Java CTL Auto-propagated metadata
SystemExecute-
no
0-10-1-
no
no
no

[1]  Component sends each data record to all connected output ports.

Icon

Ports

Port typeNumberRequiredDescriptionMetadata
Input0
no
For standard input of the specified system command (input of the process)Any1
Output0 [1] For standard output of the specified system command (output of the process)Any2

[1]  Standard output must be written to output port or output file. If both output port is connected and output file is specified, output is sent to output port only.

Metadata

SystemExecute does not propagate metadata.

SystemExecute has no metadata template.

SystemExecute Attributes

AttributeReqDescriptionPossible values
Basic
System commandyesCommand to be executed by the system. The command is always saved to a tmp file as a script. In case an interpreter is specified, it executes that script. If the command requires an input, it has to be sent to the command through the optional input port. See How it works for details. 
Process input/output charset 

Encoding used for formatting/parsing data for input/from output of system process.

The default encoding depends on DEFAULT_CHARSET_DECODER in defaultProperties.

UTF-8 | <any other>
Output file URL [1] Name of the file, including path, to which output of the process (together with errors) should be written if the output edge is not connected and if System command creates the standard output. See URL File Dialog for more information.  
Append By default, the contents of output file is always deleted and overwritten by new data. If set to true, new output data is appended to the output file without deleting the file contents.false (default) | true
Command interpreter Interpreter that should execute the command. If specified, System command is saved as a script to a temporary file and executed by this interpreter. Its form must be the following: <interpreter name> [parameters] ${} [parameters]. If an interpreter is defined, System command is saved to a temporary file and executed as a script. In such a case, the component replaces this ${} expression by the name of this temporary script file.  
Working directory Working directory of the component.current directory [2] (default) | other directory
Advanced
Number of error lines Number of lines that are printed if a command finishes with errors.2 (default) | 1-N
Delete tmp batch file 

IMPORTANT: This attribute has been removed from Clover v. 3.3.0.M3 because of a clash with temp space management.

By default, the created temporary batch file is deleted after command execution. If set to false, it will not be deleted.

true (default) | false
Environment System-dependent mapping from variables to values. Mappings are separated by a colon, semicolon, or pipe. By default, the new value is appended to the environment of the current process. Both PATH=/home/user/mydir and PATH=/home/user/mydir!true means that /home/user/mydir will be appended to the existing PATH. Whereas, PATH=/home/user/mydir!false replaces the old PATH value by the new one (/home/user/mydir).For example: PATH=/home/user/mydir[!true] (default) | PATH=/home/user/mydir!false
Timeout for producer/consumer workers (ms)   Timeout; by default in milliseconds, but other time units may be used. See Timeout for details. 0 (without limitation) | 1-n
Ignore exit value In case the executed system command returns non-zero value component fails. This option can change this behavior, the exit value can be ignored.true | false (default)

[1]  If the output port is not connected, standard output can only be written to the specified output file. If the output port is connected, output file will not be created and standard output will be sent to the output port.

[2]  Working directory defaults to current process working directory only if the graph runs on local CloverETL engine. If it runs on the CloverETL Server, then default working directory is the sandbox root. In case of clustered Server environment, default working directory is the sandbox root only if the sandbox is of "shared" type, or it is of "local" type and is located on the node running the SystemExecute component. Otherwise the Server node cannot access the sandbox locally, i.e. the sandbox is of type "local" but is located on remote node, in which case the working directory defaults to some arbitrary temporary directory supplied by the Temp Space Management subsystem of the Server node. The component prints a message about which working directory was actually used into graph run log at INFO log level.

Details

SystemExecute executes commands and arguments specified in the component itself as a separate process. The commands receive standard input through the input port and send standard output to the output port (if the command creates any output).

How it works

SystemExecute runs the command specified in the System command and creates two threads.

  • The first thread (producer) reads records from the input edge, serializes them and sends them to stdin of the command.

  • The second thread (consumer) reads stdout of the command, parses it and sends it to the output edge.

Timeout

  • When the command ends, component still waits until both the producer and the consumer also finish their work. The time is defined in the Timeout attribute.

  • By default, timeout is unlimited now. In case of an unexpected deadlock, you can set the timeout to any number of milliseconds.

Best Practices

We recommend users to explicitly specify Process input/output charset.

See also

ExecuteScript
Common Properties of Components
Specific Attribute Types
Others Comparison