cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1119
Views
10
Helpful
4
Replies

Issue with Time variable in uccx

Hi,

I have some Time variables with names like

openApllicationSupport,

closedApllicationSupport

openSecuritySupport

closedSecuritySupport

openNetworkSupport

closedNetworkSupport

....

They have predefined Time Values, e.g 10:00am, TZ[Europe/Paris] and could be edit through the UCCX gui.

Now I want to pass the values of these predefined variables into 2 generic time variables: opening_time and closed_time and compare them with the current time

WORKING:

set opening_time = openApplicationSupport

NOT Working:

E.G

String SupportGroup

set SupportGroup = "Application"

set opening_time = "open" + SupportGroup + "Support"

For the non-working scenario I get an error message

"Unable to convert string into a time, nested exception is: java.text.ParseException: Unparseable date: "openApplicationSupport"

Is there a way to workaround this because I would like to have just one generic Time of Day check.

4 Replies 4

seanvaid
Level 3
Level 3

Can you share the script or a snippet of it?

It'll be easier than trying to decipher the post

Each option in in the Menu at the top generates a different value for variable strTeamName of type string. E.g

Server Infrastructure sets strTeamName to "Server"

Security sets strTeamname to "Security"

Application Maintenance is setting it to "Application'

Because I want to have only one Time of Day check (current_time after openingtime and before closing time) I have to pass the unique opening and closing time of each menu subtree into the generic opening_time and closing_time.

Eg. set opening_time = ApplicationOpenEM

But as mentioned I would like to have more generic so I would like to build the value for opening_time and closing_time dynamically. Therefore I am looking for a way to set the value based on the content of strTeamName as part one and a second fixed string part "OpenEM

set opening_time = strTeamName + "OpenEM", which should result into ApplicationOpenEM. Unfortunately the script is trying than to convert the string "ApplicationOpenEM" and not taking the content of ApplicationOpenEM which is T[12:00:00 AM, TZ[Europe/Paris]].

I am using this schema of building dynamic parameter names for other stuff like XML files or Prompts, so I just wonder why it is not working for Time variables.

Regards 

Why not just set the opening and closing times under each menu selection individually?

Main Menu

>Server infrastructure

>>Set OpenTime "ServerOpenEM"

>>Set CloseTime "ServerClosedEM"

>Collab services

>>Set OpenTime "CollabOpenEM"

>>Set CloseTime "CollabClosedEM"

...

If current time after.open & before.close...

I feel like that would be an easy and clean way to go about this. 

You could also put a switch underneath the menu step like Anthony suggested

Switch strTeamName

>Server

>>Set OpenTime "ServerOpenEM"

>>Set CloseTime "ServerClosedEM"

>Collab

>>Set OpenTime "CollabOpenEM"

>>Set CloseTime "CollabClosedEM"

...

If current time after.open & before.close...

Anthony Holloway
Cisco Employee
Cisco Employee

What you are trying to do is not good practice, though it can be done.

Typically you will see scripts with large Switch steps, switching on some identifier (maybe a called number) then setting all the generic variables, like main greeting, to something, then going down and playing that greeting.

In a way, this large switch step acts like a JSON object, with the keys being the branches, and the values being the set steps.

Switch Step Example JSON Example
Switch called_number
1000 - Help Desk
Set description = "Help Desk"
Set greeting = p[hdwelcome]
Set csq = "HelpDeskCSQ"
2000 - Customer Service
Set description = "Customer Service"
Set greeting = p[cswelcome]
Set csq = "CustomerServiceCSQ"
Default
var called_numbers = {
"1000": {
"description": "Help Desk",
"greeting": "hdwelcome",
"csq": "HelpDeskCSQ"
},
"2000": {
"description": "Customer Service",
"greeting": "cswelcome",
"csq": "CustomerServiceCSQ"
}
}

You can store this in a subflow, and just pass in the identifier, and pass out the variables you need from it.  This will keep your main IVR script small and clean, but also allow you to reference this data in other scripts too, without duplicating it.