cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
843
Views
0
Helpful
3
Replies

UCCX XML for Emergency Closure

Curtiss Hoeft
Level 1
Level 1

I am trying to create a script that will allow my user base to set emergency weather closures based on location.  This particular customer has six locations which I am trying to manage on one XML.  I keep running in to errors with the XML upload and I'm not quite sure where I have gone wrong.  I would appreciate any input the community has to offer.

 

Everything validates fine.  The prompts are uploading appropriately.  I feel like I am doing something wrong with the formatting.

3 Replies 3

Anthony Holloway
Cisco Employee
Cisco Employee

That's interesting, I have never seen anyone use XSL files in UCCX scripting. Could you explain how it works?

 

I'd wager most people just use the Keyword Transform Document step, which uses a very simple find/replace model to change documents.  However, this requires you to either split up the states into separate files, or to juggle all of the data each time you read/write to the file (probably something the XSL handles well, but I don't know anyone who has got that to work).

 

E.g.,

Template File

<?xml version="1.0" encoding="utf-8"?>
<SevereWeather>
  <FlagState_AL>%FlagState_AL%</FlagState_AL>
  <FlagState_GA>%FlagState_GA%</FlagState_GA>
</SevereWeather>

 

Pseudo Script

Set xml = doc[weather.xml]
Set template = doc[weather-template.xml]
Create XML Document (xml)

/* Read status of all states */
al_status = Get XML Document Data (xml, "//FlagState_AL")
ga_status =Get XML Document Data (xml, "//FlagState_GA")

/* Inform caller of current status for chosen state */

/* Get new status from caller for chosen state */
Set al_status = "emergency"

/* Update all statuses using keyword transform */
xml = Keyword Transform Document (template)

/* Change file in repo */
Upload Document (xml to l[], "weather.xml")

 

You might find it easier to avoid XML all together, and just have different files for the different locations, and have the contents be plain text.

 

E.g.,

 

File

state-of-al.txt

 

Content

normal

Pseudo Script

/* Use a menu to get state choice */
Set target = "al"

/* Construct the filename for target state */
Set filename = "state-of-" + target + ".txt"

/* Get current status of target state, and inform caller */
Set current_status = doc[filename]

/* Use a menu to get new state choice */
Set new_status = "emergency"

/* Change the document in the repo */
Upload Document (text[new_status] to l[], filename)

Anthony,

 

I have implemented the steps from the pseudocode, but the transformation step seems to be not working properly.  Please see the attachment.  Am I declaring a variable improperly?

 

the var_flagAL, etc just have "normal" as their values.  You can see that the script is reading the XML and the XML templates properly.

Ammara Bokhari
Level 4
Level 4

Hi, 

A better solution might be to achieve this from an easy-to-use web administration portal instead of doing complex and lengthy scripting. We have a solution to this here: http://www.expertflow.com/announcements/

 

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: