cancel
Showing results for 
Search instead for 
Did you mean: 

UDF

Former Member
0 Kudos

Hi Experts,

Is there some easy way I can generate a random number in a message mapping?

Is that there is any option of using standard functions or I have to go for UDF?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Narahari,

Use this UDF it will work

Imports - java.lang.*;java.util.Random;

//write your code here

Random rand = new Random();

int i = rand.nextInt(100000);

String s = String.valueOf(i);

return s;

Thanks

Vikranth

Edited by: Khimavath Vikranth on May 31, 2008 5:55 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

There is no standard feature available to generate the Random Nos. You need to go for UDF and have to imply the logic in such a way that combination of various factors will create the random no.

For e.g. under Date Nodes you can get the system date and time stamp, with UDF you can concatenate all together to generate the Unique no as it will be like

Date+Time (For e.g. 05/31/2008 09:20:37 will be converted to 05312008092037 with the help of UDF)

Thanks

Swarup