I need to be able to route a call to six different dealers on a weekly rotation. I came up with a script that performs that, but the order of the java within the script will not recognize the first 6 weeks of the year. I am posting a strip down version of the script so you can see where it is failing.
Please, any help on how to correct the script or better examples on how to accomplish this task would be greatly appreciated.
I, like everyone else here, am no Java expert, but what you are trying to acomplish is a simple modulus operation. I think there is a mod function, but I don't know if it's available.
Assuming that you define the variables as integers..
X = weekOfYear/6;
Y = X * 6;
Z = weekOfYear - Y;
If Z==0 return dealer1;
if Z==1 return dealer2;
if Z==2 return dealer3;
This way, there needs to be no recursion.