on 05-31-2008 4:46 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.