We will discuss about two built-in variables of Pentaho which most of the developers are not aware of or they don’t use these variables so often in their coding. These variables are Internal.Job.Filename.Directory and Internal.Transformation.Filename.Directory.
Designed one Job which has further sub-jobs. See the SS for the same.
Here, you can see there is parent-job which has sub jobs (start-job.kjb and job 2). The parent job is present at location C:\AS2\ as seen in below image.
Now, right click on start-job and go to Edit, as it is clearly seen in below image that internal.job.filename.directory is pointing to the same directory where parent-job is located.
So, if you have sub jobs inside the parent job in your ETL code and you want to keep the location of sub jobs same as that of parent job , then you should use these variables. Same way, in case of transformations as well. As we can design transformations inside the parent transformation and hence utilize the variable Internal.Transformation.Filename.Directory.
Now , if we execute the parent-job using these variables, it runs successfully. See the image for the same.
I have checked in the code for above example in the git. Below is the URL.
https://github.com/Karan-Arora-13/technicalstuff