Author Message
HuseyinAksu2
Joined: Dec 26, 2013
Messages: 99
Offline
Hi,

I need to collect the subscriber menu path & dtmf path for customer journey. In order to achieve that I will give an id for all Menu, Announce & Prompt&Collect items inside OD app. But I would like to set such id inside of custom java code of Menu, Announce or Prompt&Collect. And so, let me know how to collect menu path before playing the phrase and to collect dtmf path before transition to the next item for Menu item.

OD Version: 7.2.1


BR.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
You can set the id in a project variable in OD using custom Java code or the Data node.
HuseyinAksu2
Joined: Dec 26, 2013
Messages: 99
Offline
Hi,

The main question is that in which function I could able to set such id if I prefer to use custom Java code ? Please consider that such function should work before playing phrase or when an input is pressed.

BR.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
You would add a servlet from the flow editor palette to the flow, then add code in the servletImplementation method of the servlet code. For example:

public void servletImplementation(com.avaya.sce.runtimecommon.SCESession mySession) {

//Given "myvar" is the name of the variable you've added in project.varaibles
mySession.getVariableField("myvar").setValue("myid");

//later on, anywhere of the flow you can read the variable by the following line
//mySession.getVariableFieldValue("myvar");
}
HuseyinAksu2
Joined: Dec 26, 2013
Messages: 99
Offline
Hi,

The servletImplementation method is going to be executed when ? Before or after dtmf input ?


BR.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
If depends on where you put the servlet node in the flow.
HuseyinAksu2
Joined: Dec 26, 2013
Messages: 99
Offline
Hi Wilson,

Please keep in mind that I would like to collect menu & dtmf path inside custom Java code of Menu item. And so, when a dtmf is pressed, I need to set the variable inside the menu item. How I could achive that ?


BR.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
I'd like to point out that there are places in the Java class of the menu node where you can add custom code; however, those places are mainly for customizing the behavior of the vxml not for setting variable. If you place the custom servlet right after the menu node, the code will get executed once the dtmf is accepted by the AVB/platform. That's how it should work.
Go to:   
Mobile view