Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Talend Open Studio for DI 7.3.1 on Windows
Is there a way to create a resource that is global, that is, visible, to all projects?
Yes. Do this with a code routine:
package routines;
public class myGlobalVariables {
static Boolean myVariable = false;
}
Access it anywhere with myGlobalVariable.myVariable
You can load values from a DB or file at runtime (just like a 'context') and set them with setters and getters. I do this now instead of using context variables for things that are truly global to my project or projects. There are several advantages to this. YMMV.
I created another job in another project and it does not see the code routine I created in the initial project. Error is 'cannot be resolved to a variable'.
I need a global routine for all projects. This seems to work globally for all jobs under a project.
Create a "master" project that holds the working global variable code routine. In that project create a job that copies the code routine to all other projects.
Hi billimmer,
Could you provide an example of what you are suggesting? I get what you are saying. But "pictures are worth a thousand words" to me.