VXML Studio 3.X Java Component

Unanswered Question
Sep 3rd, 2008

Dear All,

I need help on VXML Studio Custom Component development. I have developed a Decision component using Java API for VXML Studio 3.X, I have got it integrated successfully with VXML Studio (i.e. it can be seen in Elements pane of VXML Studio), but I am getting an error when it's called in call flow at VXML server, that error text is "stcDecisionKeyPress_01,element,error,pkgDecisionKeyPress.DecisionKeyPress is not a valid decision element class"

Following is the source code.

package pkgDecisionKeyPress;

import com.audium.server.AudiumException;

import com.audium.server.session.DecisionElementData;

import com.audium.server.voiceElement.ElementInterface;

import com.audium.server.voiceElement.DecisionElementBase;

import com.audium.server.voiceElement.ElementException;

import com.audium.server.voiceElement.ExitState;

import com.audium.server.voiceElement.Setting;

import com.audium.server.xml.DecisionElementConfig;

public class DecisionKeyPress extends DecisionElementBase implements ElementInterface{

public String doDecision(String name, DecisionElementData decisionData)

throws AudiumException

{

String strExitState = "";

DecisionElementConfig config = decisionData.getDecisionElementConfig();

String strResult = config.getSettingValue("InputValue", decisionData);

if(strResult=="0")

strExitState = "No";

else

if(strResult=="1")

strExitState = "Yes";

return strExitState;

}

public String getDescription() {

return "A Component To Make Dynamic Decisions";

}

public String getDisplayFolderName() {

return "myComponents";

}

public String getElementName() {

return "myDecisionKeyPress";

}

public Setting[] getSettings() throws ElementException {

Setting[] settings = new Setting[2];

settings[0] = new Setting(

"InputValue",

"InputValue",

"Creative Decisions",

Setting.REQUIRED,

Setting.SINGLE,

Setting.SUBSTITUTION_ALLOWED,

Setting.STRING);

settings[1] = new Setting(

"Value2Check",

"Value2Check",

"Creative Decisions",

Setting.REQUIRED,

Setting.SINGLE,

Setting.SUBSTITUTION_ALLOWED,

Setting.STRING);

return settings;

}

/* Since this is a custom configurable decision element (as opposed to an

* action element), this method must be defined to return the exit states

* this element has.

*/

public ExitState[] getExitStates() {

ExitState[] exitStates = new ExitState[2];

exitStates[0] = new ExitState("Yes", "Yes", "Yes");

exitStates[1] = new ExitState("No", "No", "No");

return exitStates;

}

}

Thanks & Regards,

M. Mudassir Saeed

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
geoff@hp.com Wed, 09/03/2008 - 09:54

How much of this have you previously done? Have you written other custom action elements and other custom decision elements and this is the first time you've had a problem; or is this your first custom Audium element?

Regards,

Geoff

m_mudassir_saeed Wed, 09/03/2008 - 10:22

Thank you for replying.

This is my first Custom Audium Element

Thanks & Regards,

M. Mudassir saeed

geoff@hp.com Wed, 09/03/2008 - 13:21

OK, very good. We all have to start somewhere.

How do you package the class file? Are you putting them in a JAR? Where is the JAR going.

I see "package pkgDecisionKeyPress; " at the top of your Java file. I've written maybe 100 custom Audium elements and I never have a "package" declaration at the top.

I keep them flat and install them as pure class files in server\common\classes.

The sample that Audium wrote just looks like this:

// These classes are used by standard decision elements.

import com.audium.server.AudiumException;

import com.audium.server.voiceElement.DecisionElementBase;

import com.audium.server.session.DecisionElementData;

/**

* This class is called when a standard decision has been configured to use a

* Java class. Since this is a standard decision element, it applies to a

* specific application and does not have a configuration. As a result, the

* only method needed in this class is the doDecision method.

*/

public class MyStandardDecision extends DecisionElementBase

{

/**

* All decision classes must implement this method. The data is retreived

* through the DecisionElementData class and the result of the decision is

* returned as a String from the method.

*/

public String doDecision(String name, DecisionElementData data) throws AudiumException

{

// PUT YOUR CODE HERE.

// Return the appropriate exit state.

return "";

}

}

Regards,

Geoff

m_mudassir_saeed Wed, 09/03/2008 - 23:52

Hi Geoff,

I packaged class file into JAR and placed in STUDIO\COMMON\LIB & SERVER\COMMON\LIB.

And I could see it in the Elements pane of VXML Studio, but then shared problem.

Now I used your sample code as it is, just copied and pasted, but still getting the following message, which I am already getting but ignored as my element was available in the Elements pane of VXML Studio.

"This compilation unit indirectly references the missing type com.audium.server.xml.e (typically some required class file is referencing the type outside the class path)"

I believe, might be incorrect, if I could remove this message, things will start working correctly.

Thanks & Regards,

M. Mudassir Saeed

Actions

This Discussion