Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Time of Day Routing from xml doc in UCCX Script

Hi Everyone,

I created a script where user can call in and update the XML doc for the Start Time and End Time and I read that value in the main script to check the operation hours.

I followed this from one of the Support Forum's Discussion

Users enter start/stop times in 24 hour format. For example, 930 for 9:30 AM, and 1730 for 5:30PM

Concat two strings into the format of: startTime + "-" + endTime. I.e: "930-1730"

Write this value to a document

In the scripts, Read the document with the string I created above (into a variable). Created a single dimension String Array as a variable.

String[] ToD

Stored the ToD string as 'todString'

Set ToD = todString.split("-")

If (int.valueOf(ToD[0]) <= int.valueOf(T[now].getHours() + "" + T[now].getMinutes()) && int.valueOf(ToD[1]) >= int.valueOf(T[now].getHours() + "" + T[now].getMinutes()))

     True:

          /* within hours of operation */

     False:

          /* outside hours of operation */

I am able to create above mentioned steps but i am facing a problem in getting the current time.

Suppose current time 19:07, its giving me value as '197' rather than '1907' due to which time comparision is not woking correctly. Is there any way i can get the correct value.

Also attached the screenshot of the script

Your feedback will be really helpful.

Thanks in Advance

Regards,
Arpit

2 REPLIES

Time of Day Routing from xml doc in UCCX Script

T[now].getMinutes() returns in int data type, so the value of an integer can never be 07, so for that particular method..you are going to have to do something a little different (as you saw)..

So it's probably best for you to create a new Variable for this junk:

int.valueOf(T[now].getHours() + "" + T[now].getMinutes())

int currentTime = 0;

if(T[now].getMinutes() < 10){

     String temp = "0"+T[now].getMinutes();

     currentTime = int.valueOf(T[now].getHours()+ temp);

else

     currentTime = int.valueOf(T[now].getHours()+""+T[now].getMinutes())

//Now do that crazy check with currentTime replacing all that other junk...   

New Member

Time of Day Routing from xml doc in UCCX Script

Thanks for your suggestion.

I used some other logic for time comparision and it worked for me.

Will also give try to this suggestion in lab.

Thanks & Regards,

Arpit

553
Views
0
Helpful
2
Replies