2

Use Pentaho Kitchen to run Spoon / PDI Job. Define parameters in main job that should be set by Kitchen params at run time. Running under Windows. The following does not work:

C:\pentaho8.0\data-integration\kitchen /file:"C:\Users\nbessmer\Source\Professional_Services_New\Client Implementations\BlackBaud\Rapid7CodeDrop2\NexposeLoadStripped.kjb"
 "-param:HelperFiles=C:\Users\nbessmer\Source\Professional_Services\Rapid7\Output" "-param:InputDirectory=C:\Users\nbessmer\Source
\Professional_Services\Rapid7" "-param:OutputDirectory=C:\Users\nbessmer\Source\Professional_Services\Rapid7\Output\Nexpose" "-param:ReportFile=report.csv" "-param:Root=C:\Users\nbessmer\Source\Professional_Services\Rapid7" 

Even tried this with very simple job and can't get parameters to work in Kitchen.

Thanks for your help.

This doesn't work either:

C:\pentaho8.0\data-integration\kitchen 
/file:"C:\Users\NBessmer\Source\Professional_Services_New\Client 
Implementations\MIS\Spoon\IP Phones\IP_Phones.kjb" 
"-param:InputDirectory=C:/Users/NBessmer/Source/Professional_Services_New/Client Implementations/MIS/Spoon/IP Phones" 
"-param:InputFile=C:/Users/NBessmer/Source/Professional_Services_New/Client Implementations/MIS/Spoon/IP Phones/IPT Devices-(Nov-29-2018).xlsx
"-param:MashupDirectory=C:/Users/NBessmer/Source/Professional_Services_New/Client Implementations/MIS/Spoon/IP Phones/mashup"
"-param:OutputDirectory=C:/Users/NBessmer/Source/Professional_Services_New/Client Implementations/MIS/Spoon/IP Phones/output"     

When using forward slash in path names. Get error: Could not read from "file:///C:/NoAnalogPhones.csv" because it is not a file.

NBessmer
  • 87
  • 2
  • 9
  • Inside the Quoted ("-param: ...") parameters try using forward "/" slash instead of backslash "\" – Cristian Curti Jan 25 '19 at 18:16
  • @CristianCurti - Reversing the slashed didn't work. I get an error in Kitchen run:Could not read from "file:///C:/NoAnalogPhones.csv" because it is not a file. Could not read from "file:///C:/NoAnalogPhones.csv" because it is not a file. at org.pentaho.di.trans.steps.csvinput.CsvInput.readFieldNamesFromFile(CsvInput.java:439)2019/01/28 12:36:49 - System - Transformation is killing the other steps! at org.pentaho.di.trans.steps.csvinput.CsvInput.createFieldMapping(CsvInput.java:403) at org.pentaho.di.trans.steps.csvinput.CsvInput.openNextFile(CsvInput.java:330) – NBessmer Jan 28 '19 at 17:39

2 Answers2

1

The Kitchen command line is buggy when passing parameters. You have to fool around and take out any line feeds / new lines and put a space between "params:var=someval"

This works:

CD C:\Pentaho\data-integration

REM C:\pentaho8.0\data-integration\kitchen /file:C:\Users\nbessmer\Source\Professional_Services\Rapid7 customer delivery\NexposeLoad.kjb

.\kitchen /file:"C:\Users\NBessmer\Source\Professional_Services_New\Client Implementations\MIS\Spoon\IP Phones\IP_PHONES\testParms.kjb" "-param:InputFile=C:\Users\NBessmer\Source\Professional_Services_New\Client Implementations\MIS\Spoon\IP Phones\IP_PHONES(Nov-29-2018).xlsx" "-param:OutputDirectory=C:Users\NBessmer\Source\Professional_Services_New\Client Implementations\MIS\Spoon\IP_Phones\IP_PHONES\output" "-param:InputDirectory=C:\Users\NBessmer\Source\Professional_Services_New\Client Implementations\MIS\Spoon\IP Phones\IP_PHONES"

CD C:\Users\NBessmer\Source\Professional_Services_New\Client Implementations\MIS\Spoon\IP Phones\IP_PHONES

NBessmer
  • 87
  • 2
  • 9
0

It might be just a misspelling in your command, you're using C:\pentaho8.0\data-integration\kitchen ... the actual name of the Batch file is Kitchen, capital K.

Try using this command:

C:\pentaho8.0\data-integration\Kitchen.bat

instead of lowercase.

EDIT:

In your KJB, in the KTR call steps, if you have the parameters set in the Parameters tab, you need to feed information to it (Value) or a stream column to receive values from, if you leave it as is, i'm pretty sure that Transformation will run with those Parameters blanked / empty, so unless you need a static value, or a 'Execute for every row' type of execution, leave the Parameters tab all empty.

enter image description here

Also, in the parameters tab inside a KTR, unless that KTR is going to receive parameters through a JOB call, you can leave the parameters all empty, the option 'Pass all parameter values down to the sub-transformation' will send all the JOB parameters down to the execution of the KTR.

In your Batch file, as long as you're executing this Batch file from inside C:\pentaho8.0\data-integration\kitchen it's fine, but if you're executing from another folder, you need to make the Batch file go there first, so add this in the beggining:

C: cd C:\pentaho8.0\data-integration\

Kitchen.bat /file:....

That's all i can think of for now.

Cristian Curti
  • 1,004
  • 1
  • 7
  • 13