How do i get a unique number every time i start a new case?

1
0
-1

Right now, i am using this to generate a random number.
import java.util.Random;

Random r = new Random();
int Low =5000;
int High = 10000;
int R = r.nextInt(High-Low) + Low;

But i need to generate numbers from a limit - say 10000 and in order.
Once a user starts a case, id will have the number 100000
The next case started will have the id 100001 and so on.

Any idea how i can get this?

2 answers

1
0
-1

Hi Sean,

What i really need is.
In My process, i have a field for an id -> which is generated everytime a user starts a new case.
the id I get is a random number which is generated from the code above.
Instead of a random number, i want to get a number that starts from 10000 .
and then increments +1(10000,100001,...) whenever a new case arises.
processInstance.getUUID().toString() gives me the id.
But a number in order is possible right?
Could any one let me know?

Regards

1
0
-1

It looks like your real question is

I want my cases to start at 10,000 and increment by one, how do I set the case to start at 10,001.

If this is so then there is a parameter file somewhere in the Bonita path that will do this for you...

There is something to be aware of though and that is when you restart the server, in Studio for example it starts again at the next 1,000

So stop the server and starts at 11,001, then
stop the server again and start again shows 12,001, then
stop the server again and start again shows 13,001

regards

Notifications