cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
37
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: null on 12-01-2004 11:09:06 PM
I am trying to parameterize my application as much as possible
and would like to get your recommendation on the best place to
store (and then access in the application) properties that apply
to the application as a whole.

I looked at the "settings" sheet for an application and the only
thing that jumped out at me was the VoiceXML Properties table.
Then I looked at the API and could not find a way to access these
properties, and the elements themselves didn't seem to have a way
to access the properties. To clarify what I am trying to accomplish, let's
say I want to store the opening phrase that the applicaiton says
as TTS as an applicaiton property. So whereever it gets stored,
I then need to be able to access it and use it as a parameter
for an Audio element so it would speak that text.

In addition to having these properties availalbe at the element level,
I would like to have them available in the API, so my custom action
elements could access them.

What is the bet way to implement application properties?

Subject: RE: Application-Level properties
Replied by: Michael Bochynski on 13-01-2004 04:27:25 PM
Hi,

The best way to implement application properties is to use session variables. The session variables will be accessible not only at the element level but also from API level. Moreover the session variables can be used as a parameter for an audio item. In the [b:f2099154ae]Audio[/b:f2099154ae] settings for a given element you should choose [i:f2099154ae] Say It Smart [/i:f2099154ae] option instead of [i:f2099154ae] Audio File/TTS[/i:f2099154ae] and as a source define [i:f2099154ae] Session Data [/i:f2099154ae]. Do not forget to change the type of the session data accordingly.
Please note, that the session variable is valid for a call duration.

Hope it solves your issue,
Michael

Subject: how to lad these properties at app init time
Replied by: null on 13-01-2004 07:30:20 PM
OK, so I'l stick these properties into the session data. But I need to
load the values somehow. An easy way would be a config file, which
I would like to open and read and fill in properties. Then as part of
my StartCall class I would get these properties and put them into
the session data. So my question is, is there a way to store
some data at an application level, and also is there a way to
run some code (e.g. like an applicationInit() method) that your
runtime would call when it was setting up my application at
Tomcat (or whatever appl server) start-up time?

If there are no such capabilities, I can always read the config
file in and load it's contents into the session data at the
start of each call, but that's pretty ugly. On a heavily loaded system
we will constantly be reading in the same data many times,
which is something I would like to avoid.

So the two questions are, is there a place to store and access data at a
per application (well per application server anyways) level? And, is
there a way for me to run some code at application start-up
time?

Thanks,
Mike

Subject: one way
Replied by: null on 13-01-2004 07:50:31 PM
I thought of a way to do this: just use lazy initialization of
my properties (so I would create and initialize the properties
on the first call start), and store them statically in my Start Call
class.

I would still like to hear answers to the questions in the last
post since I can see wanting to at least run some code at
applicaiton initialization time.

Thank,s

Subject: RE: one way
Replied by: Michael Bochynski on 13-01-2004 09:18:11 PM
Mike,

Unfortunately, there is no method allowing to run at application start-up. However there are two solutions. One is exactly what you suggested, using your StartCall class and storing the data statically. This solution has a minor disadvantage â¿¿ updating your application using updateApp script will reset any statically stored data, since all the classes will be reloaded.

The other solution is to use [b:31739c6b42]Data[/b:31739c6b42] tab in the very first element of a call flow. The [b:31739c6b42]Data[/b:31739c6b42] tab allows to set the session variable with a given value and allows to avoid loading external resources. The system won't be accessing any external sources, which, as you mentioned, is very important for you. Moreover, the changes are much easier to apply using the [b:31739c6b42]Data[/b:31739c6b42] tab because it doesn't require any custom coding and defining the file's format.

Regards,
Michael
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links