Execute command



Execute command is a tool that executes a system command or a console application with the specified command-line arguments and output mechanisms.

Keywords

Keywords can be used with the search function above the Elements pane.

The keywords for the Execute command element are:


Connections

Execute command allows only a single outgoing connection

Properties

Properties

Description

Name

The name of the flow element displayed in the canvas

Execution Mode This property helps you to configure the tool to handle jobs in parallel (concurrent) or serial mode:
  • Concurrent: Choose this option to enable the tool to process jobs simultaneously through multiple instances of the Execute Command tool while using the same application.
    Note: The application you choose should support concurrent processing.
    Note: Use the Concurrent processing tasks property in the User Preferences > Processing tab to set the number of concurrent processes.
  • Serialized: Choose this option to enable the tool to process jobs using only a single instance of the Execute Command tool.

Command or path

The system command to be executed, or the absolute path to the console application to be invoked

Arguments

The remainder of the command line; the following substitutions are made in the specified text:


  • %1: the absolute path of the input file/job folder

  • %2: the absolute path of the output file/job folder (which does not yet exist) including filename and extension

  • %3: the absolute path of a folder (which does exist) in which output or temp files may be placed

Note 1: all of these substitutions work even if "Output" is set to None or Original (in which case any generated output is discarded)

Note 2: argument values that may contain spaces (such as file paths) should be enclosed in quotes

Output

Determines how the command generates its output (the tool automatically moves the output to the outgoing connection):


  • None: the command generates no output (or any generated output is discarded) and nothing is moved to the outgoing connection

  • Original: the command generates no output (or any generated output is discarded) and the incoming job is moved to the outgoing connection

  • Updated input job: the command updates or overwrites the incoming job in place

  • Result next to input job: the command places the output next to the input job (i.e. in the same folder)

  • File at path: the command places a single output file at the absolute path specified by %2

  • Folder at path: the command places a single output job folder at the absolute path specified by %2

  • Result in folder: the command places the output inside the existing folder at absolute path %3
    Note: When you enter %3 in the Arguments property, the tool creates a temporary folder named ExecuteCommandTemp. Switch sends the entire ExecuteCommandTemp folder (and not just the contents of the folder) as job folder to the outgoing connection.

Copy input job

If set to yes, the incoming job is copied to a temporary location before the command is triggered; this must be turned on in cases where the command modifies the input job or places files in the folder where the input job resides

This property is not present for some choices of output because in those cases the incoming job must always be copied

Output job filter

Determines which of the generated files or folders is the output file; Automatic works unambiguously if a single file is generated; otherwise a simple heuristic is used to make an "educated guess"

Output extension

The filename extension of the output job to be provided to the command line (i.e. the substitution of %2); Automatic means use the same extension as the input job

Fail if exit code is

Fails the job (that is, moves it to the problem jobs folder) if the command's exit code is:


  • Nonzero

  • Negative

  • In range

  • Outside range

  • Disregard exit code

Range

A range specified as "n1..n2;n3..n4" where the n's represent a positive or negative integer or are missing to indicate an open end; for example: "-7..-4; 0.."

Fail if stdout contains

Fails the job (that is, moves it to the problem jobs folder) if the regular console output contains the search string or pattern; empty means disregard the regular console output

Fail if stderr contains

Fails the job (that is, moves it to the problem jobs folder) if the console error output contains the search string or pattern; empty means disregard the console error output