Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Calling variables both on Linux and Windows environments?

  1. #1

    Question Calling variables both on Linux and Windows environments?

    Hi, I'm just started learning PDI 8 CE.
    I have a Windows user developing jobs and transformations and save these files in XML format (kjb/ktr)
    I created a CentOS machine with PDI 8 and trying to use kitchen.sh without repository - just filenames.
    This linux machine will be cofigured to run user's jobs (after copying them from user) in cron.

    To the point:
    User created:
    * c:\Users\Documents\pdi\jobs\job1.kjb
    that contains path to transformations:
    ** c:\Users\Documents\pdi\transformations\transform1.ktr
    ** c:\Users\Documents\pdi\transformations\transform2.ktr

    I want to place these files on Linux in:
    * \home\pentaho\pdi\jobs\job1.kjb that contains path to transformations:
    ** \home\pentaho\pdi\transformations\transform1.ktr
    ** \home\pentaho\pdi\transformations\transform2.ktr


    I'm thinking about using env variables, but I have no idea how to calling them in both Windows/Linux environments.
    Windows: %PENTAHO_TRANSFORMATIONS_HOME%
    Linux: ${PENTAHO_TRANSFORMATIONS_HOME}
    So that the same files will work first on user Windows env, and finally on Linux env.

    Of course there is some dirty way to replace "%PENTAHO_TRANSFORMATIONS_HOME%" to "${PENTAHO_TRANSFORMATIONS_HOME}" via bash directly in every job*.kjb file gained from user. But I'm trying to avoid this.
    I read some info about kettle.parameters, KETTLE_HOME, "Set variables" step in Spoon, injecting parameters into java (-DParameter) and some other posibilities and at the end I'm so confused.


    Anybody can give some clues about this?

  2. #2
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    PDI is happy to use both variable formats in both environments.

    So you have can have ${PROJECT_BASE_DIR} in your KTR Files and it will happily work.
    I would recommend that you look at the internal variables - ${Internal.Transformation.Filename.Directory} and ${Internal.Job.Filename.Directory}

  3. #3
    Join Date
    May 2016
    Posts
    282

    Default

    That is the way I'm working myself, you have to remember to replace the full directory with your variable each time you invoke a transformation or a job in another job, or another transformation in your transformation, but apart that, it works perfectly.
    Regards
    OS: Ubuntu 16.04 64 bits
    Java: Openjdk 1.8.0_131
    Pentaho 6.1 CE

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.