Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 ?
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;
}
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.
hello ,
could you share you code above your method?
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)