PreviousNextIndex
Working with Variables > Employing Variables in Applications > Programmatically Accessing Call Session Variables > About IProjectVariables
 
About IProjectVariables

Dialog Designer generates a class, IProjectVariables, which defines the names of all project variables and their fields as constant Java strings. Dialog Designer will automatically generate this class using all of the variables defined in the flow/project.variables file (Variable Editor).

Application developers are encouraged to define their own constants for any variables that are added to the session programmatically. When editing the IProjectVariables class, be sure to make changes outside of the code generation tags (//{{START: etc.) or changes may be overwritten by the code generator.

Developers are encouraged to reference variables using the constants defined in IProjectVariables because it reduces the possibility of application bugs when variables are renamed. For example, a developer has defined the variable "weather" in the project variables and then elsewhere in the application written the code:

A second developer modifies the application and renames "weather" to "theWeather" in the project variables. Now the code "mySession.getVariableField("weather")" results in a runtime error because the variable "weather" is no longer a project variable.

If the developer originally wrote the following code:

then when a second developer renamed the project variable, there would be a Java compile error because the constant "IProjectVariables.WEATHER" would no longer exist; it would be changed to "IProjectVariables.THE_WEATHER".


PreviousNextIndex

©2009, Avaya Inc. All rights reserved.