12-18-2013 03:10 AM - edited 03-14-2019 12:54 PM
Hello ,
I have developed a script in which i want to dial 3, 4 and 5 digit extensions and other options like 1 and 2. The script is not playing the welcome prompt and no trigger when i dial the number associated with the application. When i try debugging it showing error as
"Java extensions are not licensed to support method invocations (line: 1, col: 1); nested exception is: com.cisco.expression:ExpressionLicenseViolationException: java extensions are not licensed to support mething invocations (ine: 1, col: 1)". Below is the attached script and i also attached the screen shot of the error which am getting when i debug..
Solved! Go to Solution.
12-27-2013 10:18 AM
If you are happy with your results, you should mark this post as answered so others know you resolved your issue.
Additionally, I took a look at your script and I have a few suggestions for you...
1. Using multiple nested If steps instead of a single Switch step
You used:
If (strExtension == "1")
True
Goto Help
False
If (strExtension == "2")
True
Goto English
False
Goto EXTENSION_XFER
You should have used:
Switch String (strExtension)
1 - Help
Goto Help
2 - English
Goto English
Default
Goto EXTENSION_XFER
The reason: It's cleaner to read and it only costs you one step in all cases, whereas two nested If steps costs you one step in the best case scenario, and two steps in the worst case scenario. Just imagine if you have five menu choices; that's the cost of five steps in the worst case scenario.
Here's an example comparison using five choices:
If (CED == "1")
True
Goto Option One
False
If (CED == "2")
True
Goto Option Two
False
If (CED == "3")
True
Goto Option Three
False
If (CED == "4")
True
Goto Option Four
False
If (CED == "5")
True
Goto Option Five
False
Goto Option Default
Switch String (CED)
Option 1
Goto Option One
Option 2
Goto Option Two
Option 3
Goto Option Three
Option 4
Goto Option Four
Option 5
Goto Option Five
Default
Goto Option Default
And if the Default choice is needed (worst case scenario), then the Nested If method would need to execute five steps to get there, whereas the Switch step executes only one step.
2. Duplicating logic
You used:
strExtension = Get Digit String (--Triggering Contact--)
Successful
Goto EXTENSION_XFER
Timeout
If (strExtension == "1")
True
Goto Help
False
If (strExtension == "2")
True
Goto English
False
Goto EXTENSION_XFER
Unsuccessful
If (strExtension == "1")
True
Goto Help
False
If (strExtension == "2")
True
Goto English
False
Goto EXTENSION_XFER
You should have used:
strExtension = Get Digit String (--Triggering Contact--)
Successful
Goto EXTENSION_XFER
Timeout
Validate Extension:
If (strExtension == "1")
True
Goto Help
False
If (strExtension == "2")
True
Goto English
False
Goto EXTENSION_XFER
Unsuccessful
Goto Validate Extension
The reason: It's lighter weight (less memory usage) and if you needed to modify your menu choices, you only have to do it once, instead of twice.
3. Repeat counter is not being executed
You have:
strExtension = Get Digit String (--Triggering Contact--)
Successful
...control moves to another section of the script...
Timeout
...control moves to another section of the script...
Unsuccessful
...control moves to another section of the script...
Increment iRepeatCounter
If (iRepeatCounter < 3)
True
Goto ENTER_EXTENSION
False
Goto CLOSE
Now, since you are basically attempting a transfer on anything other than a "1" or a "2", then you really need to move this logic to the Call Redirect section or just remove it all together.
This is also happening below the English section as well. However, you have duplicated the iRepeatCounter conditional check within the English section also, so it should be working as you expected there. Just not above.
I hope that helps.
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
12-18-2013 05:09 AM
Hi,
can you give us a screenshot of the script?
G.
12-18-2013 06:09 AM
What license level and build are you running? I wasn't aware that the non-Premium license is blocking common method calls; when I asked it was only blocking custom Java classes. In fact, I could swear that I have used the .length() method on an Enhanced install before... now if only I could remember which one. Hmm.
Gergely- Here you are:
Please remember to rate helpful responses and identify helpful or correct answers.
12-18-2013 06:26 AM
Hi,
thanks, Jonathan. Note to self: need to install the latest versions of UCCX/UCCE in my lab.
I opened the "Cisco Unified Contact Center Express Expression Language Reference Guide, Release 8.5(1) Cisco Unified Contact Center Express Scripting and Development Series: Volume 3 Nov 2010" and found this:
• In Unified IP IVR, Unified CCX Enhanced, and Unified Contact CCX Premium, you can enter both
simple and complex expressions.
However, in Unified CCX Standard, you can enter only simple expressions unless you also have a
Java license. You automatically have a Java license with the other four Cisco Unified CCX products.
• A complex expression is one surrounded by braces and having more than one statement, is specific
to the Java language, and requires that you have a Java license. If your script contains a complex
expression and you do not have a Java license, then when you load that script in the Cisco Unified
CCX engine, the script is declared invalid and you will not be able to run it.
I can't see any curly braces, so this script is supposed to work with UCCX Standard as well.
Unless we are facing a strange bug (?) (or feature (?)) throwing that com.cisco.expression:ExpressionLicenseViolationException
Or, the documentation might need a review.
Alternatively, I might be looking at the wrong document.
Nithin, can you please tell us whether you got that script from a different UCCX instance, I mean, this script had not been created using the server you are trying to debug with?
Thanks
G.
12-18-2013 06:34 AM
Nice catch! I wonder if it meant to say parantheses instead of braces? Alternatively, maybe it views the OR operation as the "more than one statement"?
Nithin- If you are running standard:
Set intExtensionLength = strExtension.length()
If intExtensionLength == extension_length
True
False
Set intExtensionLength = strExtension1.length()
If intExtensionLength == extension_length
True
False
12-18-2013 09:30 PM
@Jonathan still its not working after breaking the if conditions into pieces.Its showing the same error when i debug.
12-18-2013 09:38 PM
@Gergely-Yeah i have not developed the script in the UCCX editor 8.5 which am trying to debug. I mean i have developed the script in the UCCX 8.0 version and deployed in UCCX 8.5 . For 4 digit extension i have developed the script in 8.0 and it was working fine in 8.5 .
12-18-2013 11:23 PM
Hi,
can you log on to the UCCX web admin interface and check the license type? Go System > Licenses > Display licenses. We are looking for any of the following expressions: "Standard", "Enhanced" or "Premium".
Thanks.
G.
12-18-2013 11:33 PM
Hi Gergely,
Its showing "Standard" in display licenses.
12-19-2013 05:19 AM
Hi,
then I am afraid it's the end of the road. Apparently, String.length() is a complex expression - even though the documentation is a bit fuzzy on this.
G.
12-19-2013 09:36 AM
I think standard can only access the Cisco public constructors, properties and methods and not directly access any of the Java ones. However, I don't have UCCX Standard to validate that on at the moment. I might have to install the 30 day demo to try out a few things.
Examples with Date objects
Java | Cisco |
---|---|
Date today = new Date(); | today = D[now] |
month = today.getMonth() | month = today.month |
date = today.getDate() | date = today.dom |
year = today.getYear() | year = today.year * |
date1.after(date2) | date1 > date2 |
date1.before(date2) | date1 < date2 |
*Be careful as Cisco's .year property returns a different value than what is returned by the Java .getYear() method. This will hurt you if you mix the two in a single script without normalizing the data before use.
How do you determine what is Cisco versus Java? I'm not totally sure. I'll need to read up on Java object introspection to see if we can expose the object.
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
12-26-2013 07:48 AM
You could use the Switch step first to see if the input is a single digit match for Help or English, and then for the default branch just attempt the transfer with whatever input was given. If they enter in a valid extension, whether 3, 4, or 5 digits, it's going to work, and if not, you simply say that was an invalid entry, please try again.
Looks like this:
Main Menu:
CED = Get Digit String (--Triggering Contact--)
Successful
Switch String (CED)
1 - Help
Goto Help2 - English
Goto English
Default
Call Redirect (--Triggering Contact-- to CED)
Successful
Set Contact Info (--Triggering Contact--, handled)
End
Busy
Play Prompt (--Triggering Contact--, P[ext_busy])
Invalid
Play Prompt (--Triggering Contact--, P[invalid_entry])
Unsuccessful
Play Prompt (--Triggering Contact--, P[unknown_error])
Timeout
Play Prompt (--Triggering Contact--, P[no_input])
Unsuccessful
Play Prompt (--Triggering Contact--, P[invalid_entry])
Play Prompt (--Triggering Contact--, P[try_again])
Goto Main Menu
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
12-26-2013 08:03 AM
Could you try this to see if it works for determining an extension length in UCCX Standard?
Variables
String CED = ""
String transfer_to = ""
int i = 0
Script
Main Menu:
CED = Get Digit String (--Triggering Contact--)
Successful
Main Menu Validation:
Switch String (CED)
1 - Help
Goto Help
2 - English
Goto English
Default
Set i = CED
If ((i >= 100 && i <= 99999))
True
Set transfer_to = CED
Goto Extension Transfer
False
Goto Main MenuTimeout
Goto Main Menu Validation
Unsuccessful
End
Extension Transfer:
Call Redirect (--Triggering Contact-- to transfer_to)
Successful
End
...
Help:
...
English:
...
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
12-26-2013 09:12 PM
12-27-2013 10:18 AM
If you are happy with your results, you should mark this post as answered so others know you resolved your issue.
Additionally, I took a look at your script and I have a few suggestions for you...
1. Using multiple nested If steps instead of a single Switch step
You used:
If (strExtension == "1")
True
Goto Help
False
If (strExtension == "2")
True
Goto English
False
Goto EXTENSION_XFER
You should have used:
Switch String (strExtension)
1 - Help
Goto Help
2 - English
Goto English
Default
Goto EXTENSION_XFER
The reason: It's cleaner to read and it only costs you one step in all cases, whereas two nested If steps costs you one step in the best case scenario, and two steps in the worst case scenario. Just imagine if you have five menu choices; that's the cost of five steps in the worst case scenario.
Here's an example comparison using five choices:
If (CED == "1")
True
Goto Option One
False
If (CED == "2")
True
Goto Option Two
False
If (CED == "3")
True
Goto Option Three
False
If (CED == "4")
True
Goto Option Four
False
If (CED == "5")
True
Goto Option Five
False
Goto Option Default
Switch String (CED)
Option 1
Goto Option One
Option 2
Goto Option Two
Option 3
Goto Option Three
Option 4
Goto Option Four
Option 5
Goto Option Five
Default
Goto Option Default
And if the Default choice is needed (worst case scenario), then the Nested If method would need to execute five steps to get there, whereas the Switch step executes only one step.
2. Duplicating logic
You used:
strExtension = Get Digit String (--Triggering Contact--)
Successful
Goto EXTENSION_XFER
Timeout
If (strExtension == "1")
True
Goto Help
False
If (strExtension == "2")
True
Goto English
False
Goto EXTENSION_XFER
Unsuccessful
If (strExtension == "1")
True
Goto Help
False
If (strExtension == "2")
True
Goto English
False
Goto EXTENSION_XFER
You should have used:
strExtension = Get Digit String (--Triggering Contact--)
Successful
Goto EXTENSION_XFER
Timeout
Validate Extension:
If (strExtension == "1")
True
Goto Help
False
If (strExtension == "2")
True
Goto English
False
Goto EXTENSION_XFER
Unsuccessful
Goto Validate Extension
The reason: It's lighter weight (less memory usage) and if you needed to modify your menu choices, you only have to do it once, instead of twice.
3. Repeat counter is not being executed
You have:
strExtension = Get Digit String (--Triggering Contact--)
Successful
...control moves to another section of the script...
Timeout
...control moves to another section of the script...
Unsuccessful
...control moves to another section of the script...
Increment iRepeatCounter
If (iRepeatCounter < 3)
True
Goto ENTER_EXTENSION
False
Goto CLOSE
Now, since you are basically attempting a transfer on anything other than a "1" or a "2", then you really need to move this logic to the Call Redirect section or just remove it all together.
This is also happening below the English section as well. However, you have duplicated the iRepeatCounter conditional check within the English section also, so it should be working as you expected there. Just not above.
I hope that helps.
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide