Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Custom Routines in multiple Projects

Hello community!
We've been using Talend for a while, creating Jobs in one project. We also have a set of routines that we use in all our jobs.

Now we are creating new jobs in a different project, because the scope is different but we need the same routines. So we import the routines into the new project.

I think this is not a good solution, since we have now duplicated the code, and maintenance can be hard and risky.


So, is there a way to use the same routines in all our projects without importing (and duplicate code) ???

Labels (2)
10 Replies
Anonymous
Not applicable
Author

Hi,
You could create a reference project with all your routines (If you have enterprise version).
Eric 
Anonymous
Not applicable
Author

Hi Eric, thank for reply.

We're using TOS 6.3   0683p000009MACJ.png
Anonymous
Not applicable
Author

This is easy to resolve. Move your routine code to Eclipse (or similar), compile them into a Jar and import the Jar into Talend. This way you can have strict control over the source code and ensure that people aren't subtley changing them in different projects. I have used this method when working with Talend Enterprise and Talend Open Source.
Anonymous
Not applicable
Author

Thank you Richard, 
Sounds like the final solution for us.

Can you tell me how can I import the Jar into Talend? I have to do that in every Project?
And how can I use my routines in my Jobs?
Anonymous
Not applicable
Author

The easiest way is to use the tLibraryLoad
Anonymous
Not applicable
Author

Ok, Thanks Richard,

But I wouldn't like to add a tLibraryLoad component in every Job.. It's not so neat 0683p000009M9p6.png
Anonymous
Not applicable
Author

Sorry for the late reply, I've been away. 
You can also go to Window --> Preferences --> Java --> Build Path --> User Libraries ....and add the library there.
You can also add the library to a routine "wrapper" and use the wrapper to make using it a bit easier for developers.
Anonymous
Not applicable
Author

Wow.. that's a good tip.
Thanks Richard, I'll give it a try.
Anonymous
Not applicable
Author

Hi Richard,
I was trying to make that world without good news.

This is what I do:
1) I made a simple code on Eclipse.
2) Export the code as a .Jar file.
3) Configure user libraries as you say.
4) Create a dummy Job for test.
5) Get this error:
Execution failed : Job compile errors 
At least job "Test_Procesos_JAR" has a compile errors, please fix and export again.
Error Line: 306
Detail Message: TestClass cannot be resolved to a type
There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.



0683p000009MGFD.png

0683p000009MG9G.png

0683p000009MG6r.png 0683p000009MGFI.png