cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
591
Views
0
Helpful
1
Replies

UCCX Editor and java

e23
Level 1
Level 1

Hello,

This code is returning null in UCCX Editor but working in Eclipse, it returns an array of string. I should take anything in consideration while using this code inside UCCX? MyArray is defined as array of string from UCCX side.

javax.xml.parsers.DocumentBuilder builder = javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder();
org.xml.sax.InputSource src=new org.xml.sax.InputSource();
src.setCharacterStream(new java.io.StringReader(s));
org.w3c.dom.Document doc = builder.parse(src);

org.w3c.dom.NodeList nodeList = doc.getElementsByTagName("Data1");int nl=nodeList.getLength();
javax.xml.xpath.XPath xpath =javax.xml.xpath.XPathFactory.newInstance().newXPath();
javax.xml.xpath.XPathExpression expr = xpath.compile("//Data1/Data2/Data3");
org.w3c.dom.NodeList List = (org.w3c.dom.NodeList) expr.evaluate(doc, javax.xml.xpath.XPathConstants.NODESET);
for (i = 0; i <=nl-1; i++) {
org.w3c.dom.Node node = List.item(i);
MyArray[i]=node.getTextContent();
}

return MyArray;

One more question, how can i return exceptions using java in UCCX.

Thanks

1 Accepted Solution

Accepted Solutions

This isn't exactly what you are asking, but I think you would be better off parsing the XML with a step instead of try to do it in Java. I have had a hard time getting info out of Java back to the CCX script. Check out something like this post.https://community.cisco.com/t5/contact-center/uccx-xml-file-parsing-failed/td-p/2552944 

View solution in original post

1 Reply 1

This isn't exactly what you are asking, but I think you would be better off parsing the XML with a step instead of try to do it in Java. I have had a hard time getting info out of Java back to the CCX script. Check out something like this post.https://community.cisco.com/t5/contact-center/uccx-xml-file-parsing-failed/td-p/2552944