Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mmctony
Contributor
Contributor

Generic schema in custom code routines?

Hi,

in Java custom routines, is there any way to use generic schemas in order to make it easier to handle parameters that are rows actually?

Do we have to use Java reflection as described in this post instead?

Thanks,

Mick

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hello,

So far, it is impossible to use directly context variables in custom routine yet, you can define some input parameter and pass context variables to routine when calling the routine in the job, for example:

RoutineName.methodName(context.host, context.database);

Feel free to let us know if it is what you are looking for.

Best regards

Sabrina

View solution in original post

3 Replies
Anonymous
Not applicable

Hello,

So far, it is impossible to use directly context variables in custom routine yet, you can define some input parameter and pass context variables to routine when calling the routine in the job, for example:

RoutineName.methodName(context.host, context.database);

Feel free to let us know if it is what you are looking for.

Best regards

Sabrina

KimFerguson
Contributor II
Contributor II

Open the Talend Job jo_cook_ch02_0010_propagateSchema so that the right-hand palette becomes available. Then, from the metadata palette, open the Generic schema sc_cook_0010_genericCustomer. Click Finish to save the change to the schema. Then, click Yes to apply the changes to all jobs when prompted.

 

Todd66
Contributor III
Contributor III

ode routines enable the developer to create re-usable Java classes that can be integrated into Talend jobs, and in particular within tMap. In the validation chapter, there is an example of a simple code routine. This recipe is a fuller explanation of creating and using code routines within Talend. Getting ready Open the job jo_cook_ch05_0040_codeRoutine. How to do it?