This post was inspired by a conversation on the Cisco Technical Support Forums that was originally pinned in 2007 (fwiw I was still in the US Army then).
Can I write an xml document other than using the template file and keyword tranform step?
I have too many values (1000+) to transform, it would take too long to enter them manually in the keyword transform step…
Product: UCCX 8.x + with Enhanced License or better
Scenario: For whatever reason, you want to have the ability as a script writer to get Today’s Date (that’s easy enough), Yesterday’s Date, and Tomorrow’s Date then we will Create Generated Date Prompts out of them that only play Month Day and not the Year.
Tip/Trick: Demonstrating the power of the Expression Editor when using a bit of Java code to get stuff done. (This could be said of a lot of the tip/tricks I like to write).
Disclaimer: There are a few other ways to do what I’m about to demonstrate, which have in fact been demonstrated on the Cisco technical support forums..
Product: UCCX version 8.x-10.x (but probably applies to 7.x and below as well)
Scenario: A call is transferred to an Agent, but the Agent does not answer the call so a Ring-No-Answer condition occurs which sends the call back into the CCX Script for processing. The call center supervisor wants all conditions that Match this Scenario to transfer the calls to a general delivery mailbox.
Problem: Number 1: If the UCCX System Parameter for Agent RNA automatically returns an Agent to READY, then the call could get stuck in a loop with the same “unavailable” Agent continuously. Number 2: Our customer’s requirement is asking that after an Agent RNA All Calls “Automatically” Transfer to a General Delivery Mailbox for the Group.
Hope that isn’t confusing. Ultimately, this post will spawn 2 videos. From a verbiage standpoint, I think this will be fairly brief however. The first order of business with the Select Resource Step is to ensure that it doesn’t “Connect” as soon as an Agent becomes available (we need the spacing this causes when we do it that way), but as part of this particular setting, it does force us to create a new User variable as you can see this below as uAgent; another tip, if you didn’t already know the Timeout below is the Default RNA timeout, of course when using the step as below that timeout doesn’t work..you would have to set that timer on the Connect Step that must be added to coincide with this particular setting in the select resource step:
A lot of you reading the title of this post may be asking yourself..what does a “SAX” have to do with UCCX…I’m sure there are many bugs to pick with how Cisco’s products operate (if that was a pun then it was definitely intended) especially when things go sideways..such as parsing XML documents. When I use the Create XML Document normally followed up with the Get XML Document Data what is occuring under the hood..besides supplying the Java Beans with Document, XPath Expression (what the H is that), and Output(String)..e.g. the “return” or the Data we really want from that document. That my dear readers is a mystery that you will “never” find out(never say never)..until an exception is thrown, you look deep into the bowls of the log files, and/or you “hack” the box and download the JARs Cisco uses for the product. But back to SAX: simply put *I believe*(based on debug outputs I will show) it is the parser Cisco uses behind the scenes to help Aid us (or hinder us in the case today) in the Parsing of XML Documents..and the version of it would be SAX1 (and I surmise this because v1 doesn’t handle XML Namespaces well and SAX2 addressed those issues).
This post is/was inspired by a Cisco supportforum thread in which an XML Document was being downloaded, “parsed”(Create XML Document actually sets up the Parser), and an attempt to extract data “failed” on the DOC (null String; the doc in that post wasn’t a well-formed doc btw)..Lets take a look at what the well-formed XML is supposed to be:
<?xml version="1.0" encoding="UTF-8"?>
There nestled in the root tag/element (<string>) is the surreptitious NameSpace. Again as I stated earlier using UCCX’s standard procedure for parsing XML *DOES NOT WORK:
Open up a curly brace and strap in because we’re going to get moving pretty fast here. The other day I was approached with a question in regards to the Send eMail Step that went like the below:
"During my CCX Script, I have a procedure that Sends an Email
in the event of 'X' occurring, but I noticed when the Mail
Server is down the Application hangs for about 10 Seconds!!!
How do I limit the amount of time the App Hangs on this step
in this case?"