ilya_i
ilya_i

Reputation: 333

Pentaho Execute Process doesn't seem to launch script files

I'm new to Pentaho and have done quite a research on how to execute shell/batch files from Pentaho. Most of the info online is on 'Execute Shell' step which is not present in v6.

How do I run the shell scripts using 'Execute a Process' step ?

Here's what I'm doing but script won't launch:

Script is really simple

mkdir new_folder

Task is finished and new folder doesn't appear. The described steps is all I'm doing. Have I missed something ?

I use PDI 6.0.0.0-353 and just want to establish procedure of running shell/batch files from PDI.

Many thanks in advance, 'cause I don't know where else to look for tutorials or info and i'm stuck at this simpe step.

EDIT: If I specify the wrong filename I'm getting the same result, as if nothing's wrong. It's like it's not even touching the script. Is that even correct to put path to executable in Process Field ?

  • 2015/11/25 12:51:14 - Spoon - Transformation opened. 2015/11/25
  • 12:51:14 - Spoon - Launching transformation [proc]... 2015/11/25
  • 12:51:14 - Spoon - Started the transformation execution. 2015/11/25
  • 12:51:14 - proc - Dispatching started for transformation [proc]
  • 2015/11/25 12:51:14 - Spoon - The transformation has finished!!

Upvotes: 2

Views: 9389

Answers (2)

Andrei Luksha
Andrei Luksha

Reputation: 1030

This step, like many other steps, is executed for each row returned from the previous step. Hence, if you have no previous step then your "Execute a process" step is never executed.

  • Please, add some input step before your "Execute process step" (for example, data grid step). And connect it with your "Execute a process" step (press middle mouse button on the input step, drag to the "Execute a process" step, release mouse button).

"Process Field" is supposed to contain name of the field of the input dataset. The value of this field will be interpreted as a shell command.

  • If you use Data grid as the input step, please create new String field in your data grid step. Then create some rows on the "Data" tab of the step and place commands as values of the field. Finally, edit your "Execute a process": put the name of the field you have created into the "Process Field". Then run your transformation.

Some notes: AFAIK, you have to add cmd.exe /C before your shell command in Windows. E.g. cmd.exe /C echo "Hello, world">d:\test.log. And regarding the folder: it is very likely, that your current directory would be the folder, from which you run your spoon.sh or spoon.bat.

Upvotes: 4

RGuggisberg
RGuggisberg

Reputation: 4750

Folder may be made somewhere other than where you think. Temporarily change your script to:

echo Current Directory=%CD%
mkdir new_folder
dir
pause

Upvotes: 0

Related Questions