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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Soumya_M
Contributor II
Contributor II

User Defined routines

Hello,

I've created a user routine under Global routines wizard, when i create this routine, it is supposed to appear in tmap >expression builder > User defined list. But is not appearing in the list, can anyone help me out with this one ?

Labels (3)
4 Replies
jlolling
Creator III
Creator III

Talend has its own mechanism for setup comments and a kind of JavaDoc to use it in the expression builder as template suggestion.

The problem is the {Category} tag. Please type here your class name - a Talend routine is simply a Java class with static methods.

Here an example:

/**

* returns the first not empty string

* {Category} StringUtil

* {talendTypes} String

* {param} string("testMe1","testMe2") strings: String.

* {example} coalesce(" test","hans"," TEST ","Tata") # "test"

*/

public static String coalesce(String... strings) {

for (String s : strings) {

if (s != null) {

s = s.trim();

if (isEmpty(s) == false) {

return s;

}

}

}

return null;

}

 

jlolling
Creator III
Creator III

If you want to see some more examples, take a look at my library: https://github.com/jlolling/talend_routines

Thats my library of Talend routines I have collected over many years.

zjing
Contributor III
Contributor III

hello ,

could you share you code above your method?

 

jlolling
Creator III
Creator III

Take a look into my provided examples above. You will find tons of code!

My example here is from the class StringUtil - also part of my routine library (see github link)