ā11-15-2010 09:16 PM - edited ā03-14-2019 06:54 AM
Hey Guys,
I need your help to understand the step by step process for creating configurable action element.
What i am trying to do is to have element which will take a parameter (Key) and then in the backend it will access SQL DB and fetch matching rows in recordset. Plan is to use JNDI and Connection pooling concept.
Thanks,
Vinod K
ā12-01-2010 09:15 AM
Hello Vinod,
Have you had a chance to review the Element Specification Guide for CVP VXML:
This provides some pretty good detail on configuring specific elements.
Also, you may want to look into the Pogramming Guide for CVP VXML as this also goes into some good detail on configuring the elements.
I hope this helps.
Thank you,
Denis
ā12-01-2010 09:32 AM
A lot of the details on this sort of coding is posted on the CVP Developer's forum.
You should start small. Get the configurable action element template and build one that does something trivial. Like take some settings and write them to the activity log. Learn where the configurable action element needs to be in Studio for it to see it, to appear in the Gallery, and learn where it needs to be on the VXML server in order to execute.
On the JNDI side, learn how to configure server.xml and context.xml for JNDI, learn where you must place sqlserver.jar so that Tomcat can see it, and use the standard Database Element in a simple app to fetch something from the DB.
Now you need to get to the coding. I always build a standalone Java app that I can call from the command line and build a method in this that does the heavy lifting, and once I have this working I copy the entire method into the configurable action class I am building. If changes are to be made, I go back to my test class and change the method, then copy it again.
Obviously you can't use connection pooling in your test class so you will have something like
String connectionUrl = "jdbc:sqlserver://" +
databaseServer +
":" +
databasePort +
";" +
"databaseName=MyDatabase;user=" +
databaseUser +
";password=" +
databasePassword;
Connection con = null;
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
con = DriverManager.getConnection(connectionUrl);
Connection con = null;
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide