Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Pattern matching in UCCX XML ?

Hi friends,

Can I using pattern matching in UCCX XML? When some person from A site call to contact center, A script will check prefix of calling number to match data in XML or not?

Example

<?xml version="1.0" encoding="ISO-8859-1"?>
<SITE>
    <NUMBER prefix="201">
        <NAME>Site A</NAME>
    </NUMBER>
    <NUMBER prefix="202">
        <NAME>Site B</NAME>

    </NUMBER>
<SITE>

If calling number is 2019999 how to write script and XML path to check only 3 digit from calling number in XML file. Anyone can sugguest solution about this issue? Please help!

Thanks you for every comment.

Natee

3 REPLIES
VIP Super Bronze

Re: Pattern matching in UCCX XML ?

Yes you can do this. The first thing to do is strip off the first three digits so you can use that for the XPath query. The easiest way to do this is with the .substring() method and assign the resulting value to a new variable. Once you have the three-digit string that you want to search for, use that in an XPath statement of a Get XML Document Data step. Your XPath query would look like this: "/SITE/NUMBER[@prefix='" + callerPrefix + "']/NAME"  Note that the attribute value you want is contained withing single quotes which are passed to the XML parser after the Get XML Document Data step concatinates the strings together and inserts the variable value at runtime.

Please remember to rate helpful responses and identify helpful or
New Member

Re: Pattern matching in UCCX XML ?

Dear Jonathan,

     Thanks you for you advise, May I ask more question about .substring() method.

          1. .substring() is applied in variable at Expression Editor?

          2. How to write .substring() in UCCX? It can write this method same as java? Could you share example?

Thanks you,

Natee

VIP Super Bronze

Re: Pattern matching in UCCX XML ?

Generally speaking, the entire script is Java with a pretty UI layed on top of it. Most Java expressions/coding rules apply. In the more basic versions you have to be careful how advanced you get because you do not have a "Java license" and certain things can throw an exception.

Anyways, for .substring() you could just use it in a Set step for simplicity. Set callerPrefix = callingNumber.substring(1,3).  You may need to play with those integer values; I can never remember the char selection rules for this method.

Please remember to rate helpful responses and identify helpful or
625
Views
0
Helpful
3
Replies