Руководство Пользователя для Cisco Cisco Customer Voice Portal 8.0(1)

Скачать
Страница из 157
                <called_from_ani/>
             </user_info> 
         </boolean>
      </exit_state>
  </rule>
</knowledge_base>
XML Decision Example #2
An application named Example2 randomly chooses two letters of the alphabet and gives a prize
to the caller whose name begins with either letter. The letters are chosen by an action element
named GetRandomLetter and stored in element data named letter1 and letter2.
A decision element named IsCallerAWinner would be needed which has three exit states:
For a user whose name begins with either letter.
For users whose name does not begin with the letters.
For users whose name is not in the records (this could be an error or could prompt the
application to ask the user to register on the website).
Even if the application assumes that all users will have their names on file, it is prudent to add
this third exit state just to make sure. In this example, the default exit state will be set to when
the users do not match.
In English, the rules are:
Exit State
Expression
Rule Number
is a winner
The caller’s name begins with the value stored in the element
GetRandomLetter with the variable name letter1 or begins with the value
stored in the element GetRandomLetter with the variable name letter2.
1
not a winner
The caller’s name does not begin with the value stored in the element
GetRandomLetter with the variable name letter1 and does not begin with
2
the value stored in the element GetRandomLetter with the variable name
letter2.
no name
The caller’s name does not exist.
3
The Unified CVP decision element XML file would be named IsCallerAWinner and be saved
in 
%CVP_HOME%\VXMLServer\applications\Example2\data\misc
.
The XML file content will be:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE knowledge_base SYSTEM "../../../../dtds/DecisionKnowledgeBase.dtd">
<knowledge_base>
   <rule name="NameStartsWith" default_exit_state=”not a winner”>
      <exit_state name="no name" conjugate="and">
         <boolean value="false" check_existence="yes">
            <user_info>
               <demographic type="name"/>
            </user_info>
         </boolean>
User Guide for Cisco Unified CVP VXML Server and Cisco Unified Call Studio Release 8.0(1)
51
Chapter 2: Cisco Unified CVP VoiceXML Components in Detail
Unified CVP XML Decisions in Detail