Cisco Support Community
Community Member

UCCX Ver 8 adding XML

                   I'm having trouble with a script pulling the data from an xml file.  I would like the script to run normal Monday thru Friday but on Saturday run on the first and third.  On my script have a holiday xml already but I would like to add an xml for first and third saturday.  I'm having trouble with the path. I attached a screenshot of the xml and script. I'm not sure if I'm add the xml file in the wrong location on the script as well.

Everyone's tags (5)

Re: UCCX Ver 8 adding XML

you can have the script calculate the first and third saturdays of each month for you automatically.

Would you be willing to do that, or does it have to live in the XML document?

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Re: UCCX Ver 8 adding XML


er... your XML structure is a tiny bit overcomplicated - is it something you can control? If yes, can't you create something like this:




This would be easier to work with. For instance, using an XPath expression like this

count(//specialdate[@date="5/2/2012" and @from>"5" and @to<"23"])

or just simply

//specialdate[@date="5/2/2012" and @from>"5" and @to<"23"]

Of course, "5/2/2012" and "5" and "23" should countain actual date and time (hour) values.

As pointed out by Anthony, Java can help you getting the day of week in month - and check against the actual date. For example, if you add a new boolean variable named isSpecialDate and use a Set step to assign its value to a code block like this:

Set isSpecialDate = {

        java.util.Calendar calendar = new java.util.GregorianCalendar();

        calendar.setTime(new java.util.Date());

        if (calendar.get(java.util.Calendar.DAY_OF_WEEK)  == java.util.Calendar.SATURDAY && (

                calendar.get(java.util.Calendar.DAY_OF_WEEK_IN_MONTH) == 1 ||

                calendar.get(java.util.Calendar.DAY_OF_WEEK_IN_MONTH) == 3


        ) {

            // it's that special date

               return true;

        } else {

            // just a regular rainy day

               return false;

        } //else


then the value of the isSpecialDate variable would be true if it's the first or third Saturday of the month.


CreatePlease to create content