Paths Relative to workspace

One Star

Paths Relative to workspace

I'm using TIS with a Java project. Is there a variable I can use that represents the current path to the workspace folder. Also can I access the project name?
I want to store my data using relative paths so that I can move the job processing to different machines.
Thanks.
One Star

Re: Paths Relative to workspace

I'm not sure about the current path to the workspace folder
but if you go to a code box and press CTRL-SPACE you'll get a drop down of the available variables and functions
but, specifically, these are the global variables that show up that will describe your current project and/or job:
projectName
jobName
One Star

Re: Paths Relative to workspace

To get the location of your workspace, you can go to the main toolbar: Window -> Preferences
Then to Talend -> Designer, in the Preferences box
And the value is under "Component default filepath"

If you want to request that the workspace path be made into a global variable, you should report it in the BugTracker: http://www.talendforge.org/bugs/bug_report_advanced_page.php
And chose Severity: Feature from the dropdown box
One Star

Re: Paths Relative to workspace

As a workaround you could try to get the path via the class / classloader .getResource()
Bye
Volker
One Star

Re: Paths Relative to workspace

Feature request created (see http://www.talendforge.org/bugs/view.php?id=5792 ).
One Star

Re: Paths Relative to workspace

Hi,
what should the context var return as value if you start you job outside of TOS? In this case you do not have a "workspace" or?
Wouldn't it be better to store your data in a defined (changeable) path?
Bye
Volker