Four Stars

Share routines

I have few custom routines and and I would like to share them across multiple projects. 

Yes, I know i can import them into every project explicitly. 

I am wondering whether there is any way that all my projects share the same set of routines, so i do not have to update every project if i decide to change a routine.

 

Any help is appreciated.

 

Thanks

  • Data Integration
3 REPLIES
Ten Stars

Re: Share routines

If you use the Enterprise Edition you can make use of Reference Projects. Alternatively (for both the Open Source and Enterprise Edition) you *could* compile your code into a Jar (using Eclipse or similar) and then import the Jar into your projects. There is still maintenance to take care of, but you will have total control of the code and know that it won't be different per project

Rilhia Solutions
Four Stars

Re: Share routines

Unfortunately I have only Open Source version.

Talend routines are not straight java classes. Those routines are saved as .item files. 

 

How will it work if I package my custom class as jar?

Where should i drop this jar?

How do i import the jar into the project? I know how to reference external jar as reference libraries for routines. 

 

Thanks

Ten Stars

Re: Share routines

If you look at Talend Routines you will notice that the code is pure Java....they are just stored in Talend's xml file structure (.item and .properties files are just xml files). What I'm suggesting is that you take the code and add it to Java classes in something like Eclipse. Maintain it there. When you are done, compile it as a Jar. If you've not done that before it can be a bit tricky to figure out. Any Java developer can help, or use online tutorials.

 

Once you have you Jar you have a couple of easy options to use the functionality within your jobs.

1) You can use a tLibraryLoad within your jobs. This way you will have to include a tLibraryLoad component into each job that requires the routines, but you will have total control and no other developers can alter the routines without going through a process you can control. This is really useful especially if you are working in a team without the Enterprise Edition.

2) You can add the library to a "wrapper" routine in your project. This way probably requires a bit more maintenance of the wrapper. But gives you the same advantages as above.

Rilhia Solutions