ExecuteCommand

Configuration file

sample_execute_command.properties

Class name

com.ebd.hub.datawizard.util.ExecuteCommand

Description


This class is able to invoke commands at the operating system level.

Parameters


Parameter

Description

cmd

Command to be executed, for example, ls.

param.<x>

Parameters for the command. The index is 1. If param.1=-l and the command is ls, ls -l will be executed.

working.dir

Working directory in which the command will be executed. If no directory is set, the installation directory of the Integration Server will be used.

max.time

Maximal waiting time for the command before an error is reported.

error

An error is reported, if the execution of the command delivers the specified error to stdout. The prefix regex:, allows the usage of a regular expression.

success

Return value of the command in case of success. If nothing is defined, return value 0 will be expected.

env.<VARNAME>

Environment variable, which shall be set before the execution of the command. The parameter value env.MY_VAR=xyz sets environment variable MY_VAR with value xyz.

Note: You can use placeholder for the values of parameters cmd and param.<x>:

  • Variables in syntax @VAR_NAME@

  • System constants (not profile constants) in syntax %CONST_NAME%

  • The placeholders <file>, <basefile>, <file-prefix> and <file-out>

Example


test.properties
cmd=C:\\test.bat
#param.1=
#working.dir=
#max.time=
error=@VAR_ERROR@
#success=
#env.XXX=

Note: The file must be located in the subdirectory ./conf of the installation directory of the Integration Server.

Note: Note the double backslash in the cmd command. This is necessary because the backslash in properties files is a special character.

Note: Spaces are not a problem. The first line could also be cmd=C:_test x.bat.

test.bat
mkdir test222

Note: The file must be located in the working directory. Here, in the installation folder ./ of the Integration Server.