I am trying to build a dynamic prompt, by reading a url from a database.
>>
public void updatePrompt(SCESession mySession) {
com.avaya.sce.runtime.Format format = null;
IVariable var = mySession.getVariable(IProjectVariables.GET_OPTIONS);
IComplexVariable cplx = var.getComplexVariable();
ICollection coll = var.getCollection();
coll.reset();
while(coll.hasMore()) {
coll.next();
String phraseName = cplx.getField(IProjectVariables.GET_OPTIONS_FIELD_NAME).getStringValue();
int id = cplx.getField(IProjectVariables.GET_OPTIONS_FIELD_MYOPTION).getIntValue();
add(1, new com.avaya.sce.runtime.PhraseVariableElement(phraseName ,com.avaya.sce.runtime.PhraseVariableElement.Type.AUDIO_URL,false));
add(1, new PromptElement(PromptElement.TEXT, "press"));
add(1, new PromptElement(PromptElement.TEXT, String.valueOf(id)));
}
coll.reset();
coll.next();
I am supposed to get the audio, then the word press and then the id.
if instead of the phraseName I insert "getOptions:NAME" Ithe prompt reads the entire data set . I am using the variable phraseName instead I am getting an error at runtime in the application simulator :
"Unable to get session variable:
http://10.96.0.5/hanaya.wav", Language (en-us), Gender (Female)"
what am I doing wrong?