20.7 AVAILABLE USER SESSION STATES

A list of one or more user session states that are available to move to once this state has been passed are also included in the description of each user session states and are referenced by state name. The available states may have preconditions attached to them (see Figure 20.4, lines 2–9), which are described in VoiceXML notation. Lines 33–38 in Figure 20.4 describe the user session states that are available to transition to once the “option” variable has been filled in. In our example, specifically, it shows that if John says “zip-code” in response to the first prompt, then VOICE will transition to the “enterzip” state.

20.7.1 Data Source Adapter

The Data Source adapter consists of four parts: the Query Manager, the Query Designer, the Query Parser, and the Data Source. The data source adapter allows VOICE to connect and query a specific source of information, which could be a local database, an XML Web Service, or an application API. In our Restaurant Search Guide example, there are two Data Source Adapters: one to receive a listing of all available restaurants in a given zip code (using the Google API), and the other to get directions from a caller's location to the restaurant. An XML description of one of Data Source Adapters used in the Restaurant Search Guide is shown in Figure 20.5.

20.7.2 Query Manager

The Query Manager is essentially a middleman; it merely passes information between the Flow Control Module and the Query Designer/Parser. ...

Get Mobile Intelligence now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.