cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4782
Views
25
Helpful
24
Replies

Question about UCCX Script Exception Handling and the Exception goto step

JMIII
Level 1
Level 1

May be a dumb question. I have uccx scripts and i want to handle exceptions. I'd like to capture the exception message and put in a string variable for later use. When i look at the on exception goto step it appears that you would be able to do that with the save root cause (optional) portion. I have tried every variable type and it does not see in the drop down. Is there a way to do this??? I only want to use the exception message to persist somewhere else so i may review later.

2 Accepted Solutions

Accepted Solutions

Anthony Holloway
Cisco Employee
Cisco Employee

In the On Exception Goto Step, it's looking for a variable of type Exception.

If you want to store the exception message as a human readable string, then you need to create another variable, of type String, and then use the Set Step to set your String to the .getMessage() return value of the Exception.

E.g.,

Variables

Exception the_exception = null
String the_exception_message = ""
int i = 0


Script Steps

On Exception WFExecutionException Goto HandleException (Save root cause to the_exception)
Set i = 1 / 0
HandleException:
Set the_exception_message = the_exception.getMessage() 

 

EDIT: Removed the "l" in the method name and placed the variables/steps in a prefixed font box (looks nicer)

View solution in original post

LOL must be blind as I wasn't seeing the exception variable as an option. Now I do. Thanks. This solves my issue.

View solution in original post

24 Replies 24

Anthony Holloway
Cisco Employee
Cisco Employee

In the On Exception Goto Step, it's looking for a variable of type Exception.

If you want to store the exception message as a human readable string, then you need to create another variable, of type String, and then use the Set Step to set your String to the .getMessage() return value of the Exception.

E.g.,

Variables

Exception the_exception = null
String the_exception_message = ""
int i = 0


Script Steps

On Exception WFExecutionException Goto HandleException (Save root cause to the_exception)
Set i = 1 / 0
HandleException:
Set the_exception_message = the_exception.getMessage() 

 

EDIT: Removed the "l" in the method name and placed the variables/steps in a prefixed font box (looks nicer)

LOL must be blind as I wasn't seeing the exception variable as an option. Now I do. Thanks. This solves my issue.

This thread is really helpful...researching CCX exceptions the thread below helped me understand the WFExecutionException.  Is there an Anthony fan club?! +5 and thanks!

 

https://community.cisco.com/t5/collaboration-voice-and-video/uccx-discovering-exceptions/ta-p/3124590 

Awe, shucks! And yes, we meet every third Tuesday at the bar.

I dont understand Anthony. I cannot do the steps you say to do below in my UCCX10.6 with CCX Premium license, it doesn't work. First you say its looking for a variable of type Exception. There is no choice for that type of variable. You say to create a variable as string, which I did. Then what do you mean by the set step? It doesn't like the syntax of .getMessageI() I have tried every variable and not one of them shows up as a choice in the 'Save root cause (optional) selection box. 

 

Then whats even more confusing is this. When I create a variable, there is no where to put any of this stuff below 

 

Variable
Exception the_exception = null
String the_exception_message = ""
int i = 0

You pointed out a typo in the method name, and I have corrected it. Please check the post again.

If there is no variable type Exception to pick from in the drop down, then you can just type it in there. It will now show up in the drop down in the future for you.

The variables example is complete in how I posted it, but you will need to set the type, the name and the value in three separate steps in the editor.

Let me know how that may or may not help you make forward progress, and I'll watch this thread for updates.

Ok, I was able to create a variable out of nothing called of type Exception. I never knew you could do that. I then studied your other post about the runner script and how you syn taxed the set statement with the exception variable that I created. Everything took so Im ready to test it out, BUT, i changed my gateway IP of the UCCX so I could do the e-mail thing and the license MAC changed so Im waiting on TAC to re-host it for me. I have to tell you, it is acting very strange since the license MAC changed. All of my apps, when you call into them, they do answer but no prompts at all play. None of the apps. Just dead air but the phone call is still connected. Even though it says I have 57 days left on the temp license, it rendered the UCCX useless if you cant hear the prompts. Thank you for your help!

"i changed my gateway IP"

Are you sure it's not a networking issue? I don't see how a license mac change could do something like that.

It was a network issue. I had forgotten that my phones were on a different sub net than what the gateway sub net was. Something even stranger is going on now. I have my on exception step triggering on WFExcecutionException so it will branch to my Handle Exception part in the script that will e mail me a message that the script broke. I left the save root cause part blank so Im not even trying to capture the root cause. All I want it to do is e mail me my preset message that something broke. Then after it e-mails me it goes to call the customer service girl step so at least the original caller gets help from a live person rather than the script just hanging up on them because something in the script broke. All of this works perfect, EXCEPT it sends 107 e-mails to me. Why? I just want one e mail sent to me that my script broke. Whats up with the looping of the e mail send step?

Oh boy. Can you share a screenshot of your exception part?

[cid:image001.png@01D6390C.824A3360]

[cid:image002.png@01D6390C.824A3360]
[cid:image003.png@01D6390C.824A3360]






Pic1.JPGPic2.JPGPic3.JPG

I notice you're not using the On Exeption Clear step in your Handle It section. If you don't then any further issues in the script will keep resetting execution to the label, thus causing more emails to fire.

NICE Job Anthony, the 'clear exception' step. Its right there in front of my eyes but never thought to use it. Live and learn. So I went back and did it right, to capture the actual reported error and e-mail me that error. The e-mail only came once, which is far better that 105 emails at once, but, to make sense out of a 'readable' exception message, thats another feat in itself which will come with time. SO like I mentioned, I have UCCX pulling a database record that doesn't exist as the test and the readable message in the e-mail is 'null; nested exception is:
        java.lang.ArrayIndexOutOfBoundsException (line: 1, col: 1)". Right... lol.. this is good stuff though. I read that other guys full report on how he had all the exception messages mapped out. must have took him days. I will settle for my message above just to let me know the script broke. I know what my scripts do so hopefully I can correlate the cryptic Cisco message with what I *think* may have happened. Thanks again for you help!!!