Kettle Internal.Job.Filename.Directory

2019-06-24 14:42发布

I am new to Pentaho Kettle and I am wondering what the Internal.Job.Filename.Directory is?

  • Is it my SPoon.bat folder, or the job/xfrm folder i created?
  • Is there a way I can change it to point to particular folder?

I am runnig spoon.bat in Windows XP.

6条回答
The star\"
2楼-- · 2019-06-24 15:05

To set value to variable Internal.Job.Filename.Directory, you need to launch Job in this way:

String filename="path_filename"; KettleEnvironment.init(); JobMeta jobMeta = new JobMeta(filename, null); Job job = new Job(null, jobMeta); job.start(); job.waitUntilFinished();

查看更多
劫难
3楼-- · 2019-06-24 15:11

Internal.Job.Filename.Directory is kettle environment variable which points to the location of job on disk.

查看更多
来,给爷笑一个
4楼-- · 2019-06-24 15:15

Internal.Job.Filename.Directory is only set when you don't use a repository, and it is set automatically. You cannot set it manually.

How not to use an repository?

When you start Spoon, you get a dialog which asks for a repository. Just close this dialog with cancel and you're fine!

It took me a while to find this: I was wondering why Internal.Job.Filename.Directory was always empty. The repository was the cause.

It's documented here: http://jira.pentaho.com/browse/PDI-7434

查看更多
我只想做你的唯一
5楼-- · 2019-06-24 15:17

this is the variable for your folder where the current job you are at resides. if you dont use repository then you need to specify where the transformations are.

to make it more flexible you can put the jobs and trasformations at the same folder and then you can use the Internal.Job.Filename.Directory.

so if your transformation is called : my.ktr then to call it in the job you can point to it by {Internal.Job.Filename.Directory}/my.ktr

you can learn more about it at my course : pentaho tutorial

查看更多
来,给爷笑一个
6楼-- · 2019-06-24 15:20

This variable is deprecated now in version 7 and newer. You should use Internal.Entry.Current.Directory and this works regardless of repository or not, hence you can build more portable code.

查看更多
Ridiculous、
7楼-- · 2019-06-24 15:21

Internal.Job.Filename.Directory is an internal variable that is always available. It points to the directory in which the job lives.

You can find more information here.

查看更多
登录 后发表回答