Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
tale103108
Contributor III
Contributor III

Global resources

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?

Labels (2)
4 Replies
billimmer
Creator III
Creator III

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.

 

 

 

tale103108
Contributor III
Contributor III
Author

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.

billimmer
Creator III
Creator III

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.

tale103108
Contributor III
Contributor III
Author

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.