Friday, June 26, 2009

Creating the DD variables at runtime through java code in DD(Dialog Designer)

Hi All,

The Following code will help you to create the variables at runtime through java code in Avaya Dialog Designer and we can use those variables throughout the session.



Sample Code snippet:

String varName = "CreatedVar";
String varValue =
"123456";

//Creating the Simple Variable
IVariable ddMySampleVar =
SimpleVariable.createSimpleVariable(varName, varValue, null, mySession, false, false);

//Adding the Simple Variable to DD session(SCESession)
mySession.putVariable(ddMySampleVar);


// Log the created variable value through app traces
if (mySession.isAppTraceEnabled())
{
TraceInfo.trace(ITraceInfo.TRACE_LEVEL_DEBUG, ("My Sample Variable value is : " + ddMySampleVar.getStringValue()), mySession);

}



Below is the API declaration of createSimpleVariable method:
public static IVariable createSimpleVariable(java.lang.String name,
java.lang.String value,
java.lang.String factoryID,
SCESession session,
boolean isCollection,
boolean transparencyAllowed)


Thanks,
Ramu.

1 comment: