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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to define User defined methods and classes using tJava component

Hi All,
I am using TOS2.0 java version. In my job, i need to use some user defined methods in Mappings, like output column1=Myclass1.myMethod1(Input_table.column1).
Where can i define MyClass and myMethod(Userdefined classes and methods)?
How can we do this using tJava component?
Labels (3)
1 Reply
Anonymous
Not applicable
Author

Hi Venky,
To use your own function in your project, you can include this specific functions in the repository "Code -> Rountines".
Create your routine (right-click "Create routine"), the name of your Routine must be the name of your Class created.
For example : MyTest for the Creation routine Label.
In my template :
//template routine Java
package routines;
public class MyTest {
public static String helloExemple(String message) {
if (message == null) {
message = "World";
}
return message;
}
}
Then, you save your own code, and in your Job (property field component, or tMap) you can call this method directly (see the screenshot).
Regards.