cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
953
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: Ruzel Jamilon on 08-08-2013 12:01:58 PM
Hello, made a custom element and having this error: (Note that this element shows up successfully in element pane and error appears when element is being called in callflow)

10.1.253.97.1375980885522.0.ALL_BB_IVR,08/08/2013 10:54:52.745, The error was: 'com.cisco.pso.shaw.elements.ConvertStringToArray' is not a valid action element class.
com.audium.server.AudiumException: 'com.cisco.pso.shaw.elements.ConvertStringToArray' is not a valid action element class.
at com.audium.server.controller.Controller.goToAction(Controller.java:2956)
at com.audium.server.controller.Controller.goToElement(Controller.java:2691)
at com.audium.server.controller.Controller.continueCall(Controller.java:2511)
at com.audium.server.controller.Controller.goToElement(Controller.java:2742)
at com.audium.server.controller.Controller.continueCall(Controller.java:2511)

I have implemented getElementName, getDisplayFolderName, GetDescription, getSettings, getElementData(which just returns null) and doAction.

My import lib is:

/*     */ import com.audium.server.AudiumException;
/*     */ import com.audium.server.session.APIBase;
/*     */ import com.audium.server.session.ActionElementData;
/*     */ import com.audium.server.session.ComponentAPI;
/*     */ import com.audium.server.session.ElementAPI;
/*     */ import com.audium.server.voiceElement.ActionElementBase;
/*     */ import com.audium.server.voiceElement.ElementData;
/*     */ import com.audium.server.voiceElement.ElementException;
/*     */ import com.audium.server.voiceElement.ElementInterface;
/*     */ import com.audium.server.voiceElement.Setting;
/*     */ import com.audium.server.xml.ActionElementConfig;
/*     */ import com.audium.server.xml.ElementConfig;
import com.audium.core.util.Assert;
import com.audium.server.controller.Controller;
/*     */ import java.util.HashMap;
/*     */ import java.util.Iterator;
/*     */ import java.util.Map.Entry;
/*     */ import java.util.Set;

The first time I had this error, I deleted all the import lines that were not being used as per call studio but I put them back on cause I found the same concern on this forum and the initial advise was the import lib so I put them back but I am still getting the same error:

my doAction as follow:

ActionElementConfig config = actionData.getActionElementConfig();
String stringToParse = config.getSettingValue("string", actionData);
String delim = config.getSettingValue("delimiter", actionData);
String arrName = config.getSettingValue("arrayName", actionData);

stringToParse = stringToParse.trim();
delim = delim.trim();
String[] parsedString = stringToParse.split(delim);
actionData.addToLog("String to convert",stringToParse);
actionData.addToLog("Delimiter",delim);
for (int i = 0; i < parsedString.length; i++){
actionData.addToLog("Converting to array object",i + "-"+parsedString);
}

try{

actionData.setSessionData(arrName, parsedString);  
} catch (AudiumException ae) {
actionData.addToLog("Error during creation of session variable" ,ae.toString());
actionData.addToLog("AudiumException" ,ae.getMessage());

}


Any suggestions?

Subject: RE: Re: New Message from Ruzel Jamilon in Customer Voice Portal (CVP) - Gen
Replied by: Ruzel Jamilon on 08-08-2013 03:31:02 PM
Ooops. Sorry. Here it is.

package com.cisco.pso.shaw.elements;

/*     */ import com.audium.server.AudiumException;
/*     */ import com.audium.server.session.APIBase;
/*     */ import com.audium.server.session.ActionElementData;
/*     */ import com.audium.server.session.ElementAPI;
/*     */ import com.audium.server.voiceElement.ActionElementBase;
/*     */ import com.audium.server.voiceElement.ElementData;
/*     */ import com.audium.server.voiceElement.ElementException;
/*     */ import com.audium.server.voiceElement.ElementInterface;
/*     */ import com.audium.server.voiceElement.Setting;
/*     */ import com.audium.server.xml.ActionElementConfig;
/*     */ import com.audium.server.xml.ElementConfig;

public class ConvertStringToArray extends ActionElementBase implements ElementInterface{

public String getElementName(){
return "ConvertStringToArray";
}

public String getDisplayFolderName(){
return "Custom Elements";
}

public String getDescription() {
return "Converts delimited string to an array object.";
}

public Setting[] getSettings() throws ElementException {
Setting[] settingArray = new Setting[3];
settingArray[0] = new Setting("string", "Delimited string not delimited by any of the following ,<>\"'|  ", "Delimited String", true, true, true, 3);
settingArray[1] = new Setting("delimiter", "Delimiter", "Delimiter", true, true, true, 3);
settingArray[2] = new Setting("arrayName", "Array Name", "Array Name", true, true, true, 3);
return settingArray;
}

public ElementData[] getElementData()  throws ElementException{
/*  99 */     ElementData[] elementDataArray = new ElementData[2];
/*     */
/* 101 */     elementDataArray[0] = new ElementData("Result", "The result of the Web Service hit. Success or Failure");
/* 102 */     elementDataArray[1] = new ElementData("FailureReason", "Set when a failure accurs. Indicates the reason for the failure.");
/*     */
/* 104 */     return elementDataArray;
}

public void doAction(String name, ActionElementData actionData)throws AudiumException{

my doAction as follow:

ActionElementConfig config = actionData.getActionElementConfig();
String stringToParse = config.getSettingValue("string", actionData);
String delim = config.getSettingValue("delimiter", actionData);
String arrName = config.getSettingValue("arrayName", actionData);

stringToParse = stringToParse.trim();
delim = delim.trim();
String[] parsedString = stringToParse.split(delim);
actionData.addToLog("String to convert",stringToParse);
actionData.addToLog("Delimiter",delim);
for (int i = 0; i < parsedString.length; i++){
actionData.addToLog("Converting to array object",i + "-"+parsedString);
}

try{

actionData.setSessionData(arrName, parsedString);
} catch (AudiumException ae) {
actionData.addToLog("Error during creation of session variable" ,ae.toString());
actionData.addToLog("AudiumException" ,ae.getMessage());

}


}

Subject: Re: New Message from Ruzel Jamilon in Customer Voice Portal (CVP) - General
Replied by: Janine Graves on 08-08-2013 03:27:10 PM
impossible to help if you don't post your entire java class. -- Janine Graves

Subject: Re: New Message from Ruzel Jamilon in Customer Voice Portal (CVP) - General
Replied by: Janine Graves on 08-08-2013 03:42:10 PM
Just tested it, and the only thing missing is a closing brace } Perhaps you don't have the full package directory on VXMLServer under VxmlServer/applications/appname/java/classes On 8/8/2013 4:31 PM, Cisco Developer Community Forums wrote: Ruzel Jamilon has created a new message in the forum "General Discussion - All Versions": -------------------------------------------------------------- Ooops. Sorry. Here it is. package com.cisco.pso.shaw.elements; /* */ import com.audium.server.AudiumException; /* */ import com.audium.server.session.APIBase; /* */ import com.audium.server.session.ActionElementData; /* */ import com.audium.server.session.ElementAPI; /* */ import com.audium.server.voiceElement.ActionElementBase; /* */ import com.audium.server.voiceElement.ElementData; /* */ import com.audium.server.voiceElement.ElementException; /* */ import com.audium.server.voiceElement.ElementInterface; /* */ import com.audium.server.voiceElement.Setting; /* */ import com.audium.server.xml.ActionElementConfig; /* */ import com.audium.server.xml.ElementConfig; public class ConvertStringToArray extends ActionElementBase implements ElementInterface{ public String getElementName(){ return "ConvertStringToArray"; } public String getDisplayFolderName(){ return "Custom Elements"; } public String getDescription() { return "Converts delimited string to an array object."; } public Setting[] getSettings() throws ElementException { Setting[] settingArray = new Setting[3]; settingArray[0] = new Setting("string", "Delimited string not delimited by any of the following ,<>\"'| ", "Delimited String", true, true, true, 3); settingArray[1] = new Setting("delimiter", "Delimiter", "Delimiter", true, true, true, 3); settingArray[2] = new Setting("arrayName", "Array Name", "Array Name", true, true, true, 3); return settingArray; } public ElementData[] getElementData() throws ElementException{ /* 99 */ ElementData[] elementDataArray = new ElementData[2]; /* */ /* 101 */ elementDataArray[0] = new ElementData("Result", "The result of the Web Service hit. Success or Failure"); /* 102 */ elementDataArray[1] = new ElementData("FailureReason", "Set when a failure accurs. Indicates the reason for the failure."); /* */ /* 104 */ return elementDataArray; } public void doAction(String name, ActionElementData actionData)throws AudiumException{ my doAction as follow: ActionElementConfig config = actionData.getActionElementConfig(); String stringToParse = config.getSettingValue("string", actionData); String delim = config.getSettingValue("delimiter", actionData); String arrName = config.getSettingValue("arrayName", actionData); stringToParse = stringToParse.trim(); delim = delim.trim(); String[] parsedString = stringToParse.split(delim); actionData.addToLog("String to convert",stringToParse); actionData.addToLog("Delimiter",delim); for (int i = 0; i < parsedString.length; i++){ actionData.addToLog("Converting to array object",i + "-"+parsedString); } try{ actionData.setSessionData(arrName, parsedString); } catch (AudiumException ae) { actionData.addToLog("Error during creation of session variable" ,ae.toString()); actionData.addToLog("AudiumException" ,ae.getMessage()); } } -- To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/18080599 or simply reply to this email. -- Janine Graves

Subject: RE: Re: New Message from Ruzel Jamilon in Customer Voice Portal (CVP) - Gen
Replied by: Ruzel Jamilon on 09-08-2013 09:37:59 AM
Hello. This import lib did the trick - these were the ones I added initially after the error but was not loading properly in the server.
What I did is to recompile and redeploy and it worked!

import com.audium.server.session.APIBase;
import com.audium.server.session.ComponentAPI;
import com.audium.server.session.ElementAPI;

I deleted this imports the very first time cause call studio was saying those were not being used in the code. But I have read in another forum that we actually need to import them
http://developer.cisco.com/web/cvp/forums/-/message_boards/message/2757292

Thanks Janine!
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links