UCCX script to pull XML data

Hello,
My goal is to create a UCCX script that will run on a Standard license server. Basically, when a user dials a four digit "speed dial", I want them to be translated to a UCCX route point, that will take the original called number, and the calling number, and use that to create a URL that it will then query and retrieve the actual number that will need to be dialed.
So my plan currently is to have a phone inside of a partition that has a translation pattern of XXXX. The called number gets translated to 1158, which is the trigger of the application on UCCX.
The url I want to query will be something like this:
http://localhost:35798/RestServiceImpl.svc/XML/1017/6314
"Localhost" will eventually become the IP address of the server hosting IIS application that will provide the XML output. 1017 is the "speed dial" or the original called number, 6314 is the calling number.
Going to that URL should return me this output:
<XMLDataResponse xmlns="http://tempuri.org/">
  <XMLDataResult>
  <CallingXML>
  <Extension>6300</Extension>
  <SpeedDial>1001</SpeedDial>
  <PhoneNumber>918005551212</PhoneNumber>
  </CallingXML>
  </XMLDataResult>
</XMLDataResponse>
This is the script as I have written it out so far:
It does not seem to like what I have put together thus far when I try to validate it. I'm just wondering if I'm doing something that's obviously wrong.
The end goal will be to take the NewNumber and dial it, while hiding it from the phone.
Thanks,
Mark

Here's an update: I have the script retrieving the correct numbers and formulating the URL correctly. It also appears to be delivering the query from the XML.
Here's what the XML looks like when I hit it from my browser:
http://tempuri.org/
">
  http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">63141017918003551111
When I do an Interactive Script Debug session and dial the number, I can see that there are two problems: 1) the NewNumber string is "null" by the time it gets to the step to do a Call Consult Transfer, and 2) the script just shows up a blank Exception.
This tells me I am not parsing the XML correctly.
Here is what I have currently:
NewNumber = Get XML Data (xml, "/descendant::XMLDataResponse/child::XMLDataResult/child::PhoneNumber")
Which based upon what I've read in Cisco's Volume 2 and elsewhere, should be correct.
Notice in the screenshot that the XML data that UCCX pulls in looks different from when I look at it from my browser. I've also attached the script.
Thanks,
Mark

Similar Messages

  • Script for parsing xml data and inserting in DB

    Thank you for reading.
    I have the following example XML in an XML file. I need to write a script that can insert this data into an Oracle table. The table does not have primary keys. The data just needs to be inserted.
    I do not have xsd file in this scenario. Please suggest how to modify Method 1 https://community.oracle.com/thread/1115266?tstart=0 mentioned so that I can call the XML mentioned below and insert into a table
    Method 1
    Create or replace procedure parse_xml is 
      l_bfile   BFILE; 
      l_clob    CLOB; 
      l_parser  dbms_xmlparser.Parser; 
      l_doc     dbms_xmldom.DOMDocument; 
      l_nl      dbms_xmldom.DOMNodeList; 
      l_n       dbms_xmldom.DOMNode; 
      l_file      dbms_xmldom.DOMNodeList; 
      l_filen       dbms_xmldom.DOMNode; 
      lv_value VARCHAR2(1000); 
       l_ch      dbms_xmldom.DOMNode; 
    l_partname varchar2(100); 
    l_filename varchar2(1000); 
      l_temp    VARCHAR2(1000); 
      TYPE tab_type IS TABLE OF tab_software_parts%ROWTYPE; 
      t_tab  tab_type := tab_type(); 
    BEGIN 
      l_bfile := BFileName('DIR1', 'SoftwareParts.xml'); 
      dbms_lob.createtemporary(l_clob, cache=>FALSE); 
      dbms_lob.open(l_bfile, dbms_lob.lob_readonly); 
      dbms_lob.loadFromFile(dest_lob => l_clob,    src_lob  => l_bfile,    amount   => dbms_lob.getLength(l_bfile)); 
      dbms_lob.close(l_bfile);  
      dbms_session.set_nls('NLS_DATE_FORMAT','''DD-MON-YYYY'''); 
      l_parser := dbms_xmlparser.newParser; 
      dbms_xmlparser.parseClob(l_parser, l_clob); 
      l_doc := dbms_xmlparser.getDocument(l_parser); 
        dbms_lob.freetemporary(l_clob); 
      dbms_xmlparser.freeParser(l_parser); 
      l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/PartDetails/Part'); 
        FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP 
        l_n := dbms_xmldom.item(l_nl, cur_emp); 
        t_tab.extend; 
        dbms_xslprocessor.valueOf(l_n,'Name/text()',l_partname); 
        t_tab(t_tab.last).partname := l_partname; 
        l_file := dbms_xslprocessor.selectNodes(l_n,'Files/FileName'); 
        FOR cur_ch IN 0 .. dbms_xmldom.getLength(l_file) - 1 LOOP 
          l_ch := dbms_xmldom.item(l_file, cur_ch); 
          lv_value := dbms_xmldom.getnodevalue(dbms_xmldom.getfirstchild(l_ch)); 
          if t_tab(t_tab.last).partname is null then t_tab(t_tab.last).partname := l_partname; end if; 
          t_tab(t_tab.last).filename := lv_value; 
        t_tab.extend; 
       END LOOP; 
       END LOOP; 
        t_tab.delete(t_tab.last); 
      FOR cur_emp IN t_tab.first .. t_tab.last LOOP 
      if t_tab(cur_emp).partname is not null and  t_tab(cur_emp).filename is not null then 
        INSERT INTO tab_software_parts 
        VALUES 
        (t_tab(cur_emp).partname, t_tab(cur_emp).filename); 
        end if; 
      END LOOP; 
      COMMIT; 
      dbms_xmldom.freeDocument(l_doc); 
    EXCEPTION 
      WHEN OTHERS THEN 
        dbms_lob.freetemporary(l_clob); 
        dbms_xmlparser.freeParser(l_parser); 
        dbms_xmldom.freeDocument(l_doc); 
    END; 
    <TWObject className="TWObject">
      <array size="240">
        <item>
          <variable type="QuestionDetail">
            <questionId type="String"><![CDATA[30]]></questionId>
            <questionType type="questionType"><![CDATA[COUNTRY]]></questionType>
            <country type="String"><![CDATA[GB]]></country>
            <questionText type="String"><![CDATA[Please indicate]]></questionText>
            <optionType type="String"><![CDATA[RadioButton]]></optionType>
            <answerOptions type="String[]">
              <item><![CDATA[Yes]]></item>
              <item><![CDATA[No]]></item>
            </answerOptions>
            <ruleId type="String"><![CDATA[CRP_GB001]]></ruleId>
            <parentQuestionId type="String"></parentQuestionId>
            <parentQuestionResp type="String"></parentQuestionResp>
          </variable>
        </item>
        <item>
          <variable type="QuestionDetail">
            <questionId type="String"><![CDATA[40]]></questionId>
            <questionType type="questionType"><![CDATA[COUNTRY]]></questionType>
            <country type="String"><![CDATA[DE]]></country>
            <questionText type="String"><![CDATA[Please indicate]]></questionText>
            <optionType type="String"><![CDATA[RadioButton]]></optionType>
            <answerOptions type="String[]">
              <item><![CDATA[Yes]]></item>
              <item><![CDATA[No]]></item>
            </answerOptions>
            <ruleId type="String"><![CDATA[CRP_Q0001]]></ruleId>
            <parentQuestionId type="String"></parentQuestionId>
            <parentQuestionResp type="String"></parentQuestionResp>
          </variable>
        </item>
      </array>
    </TWObject>

    Reposted as
    Script to parse XML data into Oracle DB

  • How do I pull XML data by a node name?

    I am new to Flash and XML so I hope I am not asking a
    completely dumb question. I have figured out how to retrieve data
    from and XML file by the node possition but now I would like to
    know how to pull it by a specific node name. Here is what I
    currently have:
    on (rollOver)
    myLot = 1;
    _root.myInfo =
    _root.myXML.childNodes[0].childNodes[this.myLot].childNodes[0].childNodes[0].nodeValue;
    With XML file like this:
    <SectionOne>
    <Lot1>
    <Lot>1</Lot>
    <Price>$450,000</Price>
    <Status>Active</Status>
    </Lot1>
    <Lot4>
    <Lot>4</Lot>
    <Price>$389,000</Price>
    <Status>Sold</Status>
    </Lot2>
    </SectionOne>
    What I would like is to pull instead of
    childNodes[this.myLot] to pull the node named Lot1. The problem I
    have is I don't always have consecutive lot numbers and I don't
    want to have to build in blank xml lines for a placeholder. I hope
    that makes sense.

    Sorry for the delay. I originally posted this on the
    newsgroup, but I suppose it did not propagate to here.
    What you would do is use a loop statement and compare the
    nodeNames.
    To see a nodes name such as Lot1 you use:
    childNodes[x].nodeName
    // Load up the lotNodes object
    lotNodes = _root.myXML.childNodes[0];
    // Now lotNodes contains all the nodes Lot0, Lot1, Lot2.....
    // Iterate through all of lotNodes childNodes and compare the
    // nodeName until you find the one you want then drill down
    // it to get the info you want.
    for( var counter01 = 0;counter01 <
    lotNodes.childNodes.length;counter01++){
    if(lotNodes.childNodes[counter01].nodeName == "Lot1"){
    myInfo =
    lotNodes.childNodes[counter01].childNodes[0].childNodes[0].nodeValue;
    I have not had time to test this but it should work, I'll
    double check it after work.
    I hope this helps get you moving forward.
    If you have any other problems or can't get it to work, let
    me know here or email me. Preferably here, so others can learn and
    help.
    Scotty
    [email protected]

  • Order status using UCCX scripting

    I have Oracle DB which contain information about customer order such as if order has been shipped, when has been shipped,and so on. We do not want to query directly against the DB, and as far as I know Oracle has XML DB web services. If we turn that on, and have a report in xml that give me all information I needed. How do I use UCCX scripting to access these data, and read it back to customer when they call.
    I am using UCCX 8.5 premium.

    Hi,
    I see.
    This way: I certainly need the WSDL. It's basically the contract between the SOAP server and the SOAP client, the description of the protocol they are going to use. Its a file or a URL, in both cases, it's an XML document.
    SOAP might be a bit tricky, but I can help you with that. It's basically the SOAP client (in our case, the UCCX server) sending an XML over HTTP to the SOAP server, and expecting some result, which is usually an XML document, too.
    There are several approaches of enabling a UCCX script to perform SOAP commmunication, and I have created several documents about it:
    https://supportforums.cisco.com/document/97736/uccx-8x-really-simple-soap-client-no-custom-jar
    https://supportforums.cisco.com/document/112616/uccx-oop-soap-client-1-custom-jar-using-jax-ws
    Or, there's a recent thread about a similar integration:
    https://supportforums.cisco.com/discussion/12240436/uccx-soap-request
    Please ask the administrator of your Oracle DB about the WSDL, download it, post it to here.
    About the second integration option: I was thinking about a Grails proxy app - do you have a Tomcat or other Java application server in your environment we could use? 
    G.

  • How to update XML file through UCCX script ?

    Hi,
    I have an UCCX script with MENU step. One of the step is for technical support team. When caller chose this step, information about date and time of the call and calling number should be recorded on a XML file located on the web server.
    This XML is uploaded into the web server , but I don't know how to update it through UCCX script.
    Here is how the XML file looks like:
    <?xml version="1.0" ?>
    <rss version="2.0">
    <channel>
    <title>CALL LOG</title>
    <link></link>
    <description>Support Call log</description>
    <ttl>1</ttl>
    <item>
    <title>2011-08-24 14:56:39 - 00044 123 123 123</title>
    <link></link>
    <description></description>
    </item
    </channel>
    </rss>
    Any idea?
    Thanks,
    O

    Hi
    The 'keyword transform' step uses the template XML file to generate the actual XML file you want to post... the template would be a plain text file uploaded to the repository, and would look like so:
    <?xml version="1.0" ?>
    CALL LOG
    Support Call log
    1
    %%calldatetime%% - %%clinumber%%
    Now - if you had that bit of XML, with correct time/number in it - have you verified know that you can definately just post that XML to a certain URL to get it on the server? Check with whoever manages that server exactly what you need to do to get it to appear - then worry about how you do that from UCCX. It may not be a matter of posting up that XML, you may need it in a different format or something..
    Aaron

  • UCCX Script CUCM XML Directory lookup for Calling name

    Hi there!
    I'm trying to fetch "calling name" by the below uccx script params but get "no protocol" java exception according to the attached screenshoot.
    It seems to happen when i reach the line: xml = Create XML Document(URL[dir_url + calling_number])
    My version of the UCCX is 8.02 and CUCM 7.1.5
    These are the params:
    Variables:
    This is part of the code:
    Script:
    calling_number = Get Call Contact Info(--Triggering Contact--, Calling Number)
    if (calling_number != null && calling_number.trim() != "")
         True          xml = Create XML Document(URL[dir_url + calling_number])
              calling_name = Get XML Document Data (xml, "//Name")
              if (calling_name != null && calling_name.trim() != "")
                   True
                        Set Enterprise Call Info (--Triggering Contact--)
                   False
                        /* Name Not Found */
         False
              /* ANI Not Found */
    String dir_url = "http://ip_address_cucm:8080/ccmcip/xmldirectorylist.jsp?n="
    String calling_number = ""
    String calling_name = ""
    Document xml = null
    rgds, Mikael

    Hi-
    Did you configure the 'Call Variable Layout' or did you only configure the steps in the script?
    Take a look at the 'Manage Call Variables Layout' section in the CCX Administration guide.
    Cisco Unified CCX Administration Guide, Release 10.0(1)
    Cisco Unified CCX Administration Guide, Release 10.5  
    Cisco Unified CCX Administration Guide, Release 10.6
    I have not worked much with Finesse, so I cannot provide an example.
    Thanks,
    DJ

  • Forms pulling Multiple Records from an XML Schema and XML data files - Adobe LiveCycle Designer

    I built a form in Adobe LiveCycle with an xml schema and data file.  The problem is with how the form renders the xml data file.
    I have a statement element that consists of about 6 fields (statementID, statementName, statementAddress, statementCountry, statementZip, statementDate, etc) of data in the schema that allows for multiple iterations - so one xml data file can contain multiple statements. These fields allow for null values.
    But here's the problem:  When any of the statements - say statement 2 of 6 - has a null value in one of the fields, if the xml data file doesn't have a placeholder
    (example of placeholder:  <statementName type="String"/>   )in the xml for that field, my form pulls the field value from the NEXT statement.
    This corrupts all the rest of the statement records, as this field is shifted up for all the rest.
    I know that in the past I haven't needed a placeholder when a field was null. But I'm wondering if when the data allows for multiple records the xml data file needs to generate the placeholder.  And where is the problem? In the Schema? The xml data file? My form?  And the 64-thousand-dollar question:  How to fix it?

    If your <statement> element is the one that repeats, it should be bound to a subform with the binding string of something like $.statement[*]. Then in that subform should be your fields and they should have bindings of $.statementID, $.statementName, $.statementAddress, etc.
    Kyle

  • Pulling/Extracting Data from Multiple SAP Systems - Scripting, ABAP?

    Hello All,
    I am working as an analyst for a large company that has multiple SAP installations across the world.  What I am trying to do is create some global reporting metrics based on data from all of those systems on an ad-hoc basis without having the other units send the data to a central repository.  I can receive access to all of the systems but I am unsure how to pull the data. The access to one of the systems I have currently does not allow the use of ABAP or RFC but does allow scripting.  If I have a good business case I could ask for ABAP access and RFC as well.
    I have researched and read through many posts and articles within the forums but I am yet to find a solution.  I have experience in VB, VBA, and MS Access.
    Can anyone suggest any ways to move forward? 
    Thanks!

    According to my understanding, you may use vba in your excel or a just vb by programming against rfcsdk(librfc32.dll) or the newly nwrfcsdk, or use jco or nco..., but all these method are based on rfc function call.
    You may write a simple abap side data extraction agent, just a function select some table with the data you interest, and then call this function from outside regularly, then you may save the returned table to a csv then bcp to sqlserver(c + batch), or just write to excel sheets(vba).
    The simple table read function you may check RFC_READ_TABLE, but it has some limits and are not released. The more functional agent is also can be found from other vendors, eg ms sqlserver2005 kit`s sap adapter...
    I do not have idoc or services experience, maybe in that senerio you will find a easier solution.Good luck, you may reach me at <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

  • Where to place script MigXmlHelper.GenerateDrivePatterns ("* [ntuser.dat]", "Fixed") /script in MIGUSER.XML???

    I have found an article referring to adding <script>MigXmlHelper.GenerateDrivePatterns ("* [ntuser.dat]", "Fixed")</script> to MIGUSER.XML. I need to know where in the XML to place it? Anyone have experience with this??
    I am trying to use this to help with mapping printers properly in the migration.......
    tconners

    This is a pretty old post, so hopefully you found your answer.  I would start here for info:
    http://technet.microsoft.com/en-us/library/hh824871.aspx
    Jeff

  • How to get tomorrows date in UCCX script

    I am trying to determine how to get tomorrow's date in UCCX. I am wanting to determine if today is the last day of the month by checking if tomorrow is the 1st day of the month. I currently use D[now].date to get today's date in some scripts. I tried the set command tomorrowDate = D[now].date + 1 and it showed 28 when today is the 27th, but I was thinking this was just adding 1 to the number returned by D[now].date and not actually showing the next day's date. I am thinking this might return 32 on Jan. 31st.
    Does anyone know how to get an acurate tomorrow's date in UCCX scripting?
    Thank you,
    Mark

    I got this to work after reading nowcommsupports' post. I hadn't thought of setting a date for a month with 31 days to 32 and having it converted to the 1st day of the next month. I did it something like the below:
    variables:
    todaysDay     int     D[now].date
    todaysMonth  int     D[now].month
    todaysYear     int     D[now].year
    tomorrowsDate     String     ""
    tomorrowsDay     int     0
    set tomorrowsDay = todaysDay + 1
    set tomorrowsDate = D[todaysMonth + "/" + tomorrowsDay + "/" + todaysYear]
    set tomorrowsDay = D[tomorrowsDate].date
    If the date is past the last day of the current month, it will role over to the next month. For example, 1/31/11 + 1 = 1/32/11 which is converted to 2/1/11 by the system.
    Now I use the int variable "tomorrowsDay" in the routing logic of my script knowing if it equals 1 then today is the last day of the month.
    I put this here in case it may help someone else and for my own records. I needed to know if it was the last day of the month for different hours of operation in our help desk script.
    Mark

  • UCCX Script XML Select equivalent

    Assume the following XML document exists:
    <Technician>
          <ID>1234</ID>
               <CellPhone>5039991234</CellPhone>
               <HomePhone>5039992345</HomePhone>
         <ID>2345</ID>
               <CellPhone>4155551212</CellPhone>
               <HomePhone>4151234445</HomePhone>
         <ID>5678</ID>
               <CellPhone>6125431234</CellPhone>
               <HomePhone>6126634242</HomePhone>
    </Technician>
    I Know I have to Create the FileDocumentName = Technician
    I know that I have to Create XML Document = Technician
    For each element I want to retrieve I know I have to as an example
    GET XML DOCUMENT DATA "/descendant::Technician/child::HomePhone"
    But what is the correct format to select the HomePhone based  WHERE ID is provided of lets say 1234?
    /Technician/ID=[1234]/HomePhone
    What is the correct format here?

    OK I broke the code on this (sorry for the PUN).   Reformat your XML document to set the ID as an Attribute and put the Phones as Element within the Technicians as follows:
               8589451069
               6590
               7608049733
               6590
               7025532706
               6590
               9144718510
               6599
    The document is the same, but we set the ID as a Unique Record Number (maybe the only reason I can see that anyone would use an Attribute over an Element).   You can not use your [@ID="1234"] to select a specifc Element from the TechnicianList.   So you would setup an Xpath as follows:
    strXpath = //Technician[@ID="1234"]/TechnicianCell 
    Then stuff your "TechnicianCell = GET XML DATA with strXpath"
    You can then Substitue a Variable for the ID so that you can fill it from the GET DIGITS step.  I sometimes find that I have to convert the String value to a int Value, but it works and you should get the desired result.  Take Away = Unique Record ID!
    Peter Buswell (aka DrVoIP)
    http://blog.drvoip.com

  • Script code sample for looping  through the records from xml data file in formCalc script

    Hi
       I have a xml data file which contains a sequence of repeating applicant data like given below
                       US
                       II
                       CEO
                       Mr
                       111111111
                       0000000111
                       GuarantorA
                       111
                       IN
                       11111
                       WILLIAMS1
                       R3
                       KENNETH1
                       City1GU
                       PA
                       1934-03-14
                       [email protected]
                       GU
                       R
                       113 Lazlo LaneCA
                       Suite 3500CA
                       OaklandCA
                       TX
                       11345
                       AL
    I want to assign a textfield with a value based on the value of coap_flag.
    So i need to loop through all the record and check the value of coap_flag and then assign the textfield a value based on that.
    I am new to Adobe livecycle...Please help me how it can be done.
    I have developed something like this
    foreach Item in ($record.applicant[*].coap_flag) do
    test.value=Item
    if(test.value=="MA")then
    concat($record.applicant.first_name,$record.applicant.middle_name)endif
    endfor

    Using the data you posted in the forum, I copied it a couple of times to give multiple records and used this code to extract the different values that you wanted. I had to wrap it in a <root> node that I called root (to make it valid XML). In my case I wrote the extracted values to a field, but in your case you can do whatever you want with them. Note that this was done in javascript:<br /><br />var currentElement;<br />var obj;<br /><br />//Get the nodes below the root node in the dataDom<br />obj = xfa.datasets.data.root.nodes;<br /><br />//Set an initial value for the textField<br />TextField1.rawValue = "The values of the coap_flag are: ";<br /><br />//Loop through the nodes in the obj set <br />for (i=0; i< obj.length ; i++){<br />     //set the currentElement to the 1st child node<br />     currentElement = obj.item(i);<br />     //Check to see if it is an applicant node<br />     if (currentElement.name == "applicant"){<br />          //It is an applican, now find the coap_flag node value and write it to the text field<br />          TextField1.rawValue += "\n" + xfa.resolveNode("xfa.datasets.data.root.applicant[" + i + "]").coap_flag.value;<br />     }<br />}

  • Loop through the records from xml data file in formCalc script

    Hi
       I have a xml data file which contains a sequence of repeating  applicant data like given below
                               US
                                II
                                CEO
                                Mr
                                111111111
                                0000000111
                                GuarantorA
                                111
                                IN
                                11111
                                WILLIAMS1
                                R3
                                KENNETH1
                                City1GU
                                PA
                                1934-03-14
                                [email protected]
                                GU
                                R
                                     113 Lazlo LaneCA
                                     Suite 3500CA
                                     OaklandCA
                                     TX
                                     11345
                                     AL
    I want to assign a textfield with a value based on the value of coap_flag.
    So i need to loop through all the record and check the value of coap_flag and then assign the textfield a value based on that.
    I am new to Adobe livecycle...Please help me how it can be done.
    I have developed something like this
    foreach Item in ($record.applicant[*].coap_flag) do
    test.value=Item
    if(test.value=="MA")then
    concat($record.applicant.first_name,$record.applicant.middle_name)endif
    endfor

    Using the data you posted in the forum, I copied it a couple of times to give multiple records and used this code to extract the different values that you wanted. I had to wrap it in a <root> node that I called root (to make it valid XML). In my case I wrote the extracted values to a field, but in your case you can do whatever you want with them. Note that this was done in javascript:<br /><br />var currentElement;<br />var obj;<br /><br />//Get the nodes below the root node in the dataDom<br />obj = xfa.datasets.data.root.nodes;<br /><br />//Set an initial value for the textField<br />TextField1.rawValue = "The values of the coap_flag are: ";<br /><br />//Loop through the nodes in the obj set <br />for (i=0; i< obj.length ; i++){<br />     //set the currentElement to the 1st child node<br />     currentElement = obj.item(i);<br />     //Check to see if it is an applicant node<br />     if (currentElement.name == "applicant"){<br />          //It is an applican, now find the coap_flag node value and write it to the text field<br />          TextField1.rawValue += "\n" + xfa.resolveNode("xfa.datasets.data.root.applicant[" + i + "]").coap_flag.value;<br />     }<br />}

  • Send data collected in UCCX script to external url

    I have a requirement to have a caller select an option in a UCCX script that will populate a variable (whatever type it may be).  I then would like to send that variable to an external URL.  Has anyone had success at doing this?  If so can I see an example script?

    Hi,
    I am not sure whether I got this correct, but if you mean that you have a block of Java code within your script (probably in a Set or a Do node, but any node which accepts an expression would do), then a UCCX script variable can be referenced within the Java code block by the variable's name.
    G.

  • Spry XML data set and dynamic post variables

    Hi,
    I am trying to create an XML data set that has dynamic post
    variables.
    Everytime something is pressed on the page a variable changes
    and I then want to reload the XML data set using the new variable.
    I know I can just pull in an XML with all possible variables
    and filter client side but this would make it way too large.
    Does anyone know what I may need to do.
    I tried this:
    var myVar = 0;
    var dss = new Spry.Data.XMLDataSet (
    '../../cgi-bin/server_details.pl' , 'top' , { method: 'POST' ,
    postData: sid=ajaja21&ip=127.0.0.1&cid=' . myVar ,
    subPaths: [ "auth" , "plugins" , "plugins/plugin" ] , keepSorted:
    "true", sortOnLoad: "plugins/plugin/order", sortOrderOnLoad:
    "descending", useCache: false, loadInterval: 10000 } );
    onclick="myVar=1";
    But the script doesn't understand the post variables sent (it
    does when I remove the . myVar part and put in a static value). I
    think it isn't sending that dynamic variable with the post
    variables.
    Any ideas anyone?
    Thanks

    Well I had it working when I stripped back everything and
    just had the dss data set and a single onclick function, but now
    that I put it back together it hash foobared again.
    Here are the relevant bits of code that I've changed.
    The function to change server id:
    //function to run when changing the server id
    function changeServer ( sid ) {
    //set the url to use the current server id
    dss.setURL = ( '../../cgi-bin/server_details.pl' , { method:
    'POST' , postData:
    'sid=7gv1m3vjvagfl7h7qeefb8iodj8evhmb&ip=127.0.0.1&cid='+sid
    //force a reload of the server data
    dss.loadData();
    The inital load of the data set
    var dss = new Spry.Data.XMLDataSet (
    '../../cgi-bin/server_details.pl' , 'yams' , { method: 'POST' ,
    postData:
    'sid=7gv1m3vjvagfl7h7qeefb8iodj8evhmb&ip=127.0.0.1&cid=0' ,
    subPaths: [ "auth" , "plugins" , "plugins/plugin" ] , keepSorted:
    "true", sortOnLoad: "plugins/plugin/order", sortOrderOnLoad:
    "descending", useCache: false, loadInterval: 10000 } );
    And the part that changes the server id
    <td align="left" style="cursor:default; width:174px;"
    onclick="changeServer({dsv::servers/server/@id})">{dsv::servers/server/name}</td>
    I checked that the function is receiving the correct server
    id and I even tried hard coding the cid variable to 2 in the change
    function but it still wasn't changing on the server side.
    Any ideas?
    Thanks

Maybe you are looking for