on 01-25-2014 10:30 AM
Mark Applebee:I am new to Custom Java and trying to learn it by using the templates in the Cisco site.Whats the best way to write custom java classes.
Is it better to use callstudio or some IDE like Eclipse. I feel like IDEs are more helpful for writing and fixing syntax errors.
For example if I want to use Eclipse as an IDE, do I need to add any audium files to it before start using import commands in the java code?
Mark Applebee:This is my first Java code. I was trying to use a template posted by you. Here it is:
import com.audium.server.AudiumException;
import com.audium.server.voiceElement.ActionElementBase;
import com.audium.server.session.ActionElementData;
public class TEST1 extends ActionElementBase
{
public void doAction(String name, ActionElementData data) throws AudiumException
{
String callid=(String)data.getSessionData("callid");
data.addToLog("callid",callid);
data.setElementData("LANG","ENG");
}
}
Please let me know whether I am doing it right.
Janine Graves:Once you close the app out of the Studio workspace, and then
double-click app.callflow, the element should show up under Local
Elements. If it doesn't then there's usually an array indexing problem
in your java code.
In Studio, look under Window > Show View > Call Studio Error Log. This
will display at the bottom of the Studio window, near the Studio
Problems tab. You should select the error, and right-click, select
Properties. This will pop up a box and give you an error message and
Java stack trace.
Usually the error is in the method named GetSettings or GetElementData
or GetExitStates. Each of these has an array. You must specify the size
of the array. And then you MUST initialize each row of the array.
If you either fail to initialize one of the array rows, or if you
initialize a row of the array but the array dimension is smaller than
that (indexOutOfBounds) then the element will fail to show up in the
Studio pane.
Feel free to post your java file online and I'll fix it for you.
Janine Graves:Once you close the app out of the Studio workspace, and then
double-click app.callflow, the element should show up under Local
Elements. If it doesn't then there's usually an array indexing problem
in your java code.
In Studio, look under Window > Show View > Call Studio Error Log. This
will display at the bottom of the Studio window, near the Studio
Problems tab. You should select the error, and right-click, select
Properties. This will pop up a box and give you an error message and
Java stack trace.
Usually the error is in the method named GetSettings or GetElementData
or GetExitStates. Each of these has an array. You must specify the size
of the array. And then you MUST initialize each row of the array.
If you either fail to initialize one of the array rows, or if you
initialize a row of the array but the array dimension is smaller than
that (indexOutOfBounds) then the element will fail to show up in the
Studio pane.
Feel free to post your java file online and I'll fix it for you.
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: