Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I created a routine which will return a result , see example below.
Now my issue: If I open tmap this routine isn't shown in expression builder under "User Defined".
Did I missed one step or is this function wrong?
package routines;
public class comparePriceList {
/**
* Compare price list
*/
public double checkPrice (double weight) {
double limit_2kg = 2.00;
double result = 0.00;
if (weight <= limit_2kg) {
result = 10.80;
}
else {
result =0.00;
}
return result;
}
}
Hello
You need to specify this category value in the comments before the function. eg:
/**
* helloExample: not return value, only print "hello" + message.
*
*
* {talendTypes} String
*
* {Category} User Defined
*
* {param} string("world") input: The string need to be printed.
*
* {example} helloExemple("world") # hello world !.
*/
public static void helloExample(String message) {
if (message == null) {
message = "World"; //$NON-NLS-1$
}
System.out.println("Hello " + message + " !"); //$NON-NLS-1$ //$NON-NLS-2$
}
Regards
Shicong
Ok even the routine isn't shown there I'm able to call it.
Hello
You need to specify this category value in the comments before the function. eg:
/**
* helloExample: not return value, only print "hello" + message.
*
*
* {talendTypes} String
*
* {Category} User Defined
*
* {param} string("world") input: The string need to be printed.
*
* {example} helloExemple("world") # hello world !.
*/
public static void helloExample(String message) {
if (message == null) {
message = "World"; //$NON-NLS-1$
}
System.out.println("Hello " + message + " !"); //$NON-NLS-1$ //$NON-NLS-2$
}
Regards
Shicong
Thanks, now it will show up.