CVP Java Class return - URGENT!

Unanswered Question
Jul 26th, 2008
User Badges:
  • Silver, 250 points or more

I write a java class, and I trying to figure out how to refernce the return of that class in my FromEXTVXML array. so I can test that the java is working. the element is Action_01 I figures its like Action_01.?? something.. Also


QuerySOAP.GetInformationByAccountNumber("test","20"); is what I used within my action element. does this look correct?



Also does anyone have any of this sample java code from.

http://kb.audiumcentral.com/questions/198/How-to-build-and-deploy-a-Java-class-to-be-called-by-a-standard-Action-element


its not on their anymore, the programming guide doesnt havea single example of extending ActionElementBase, I just need an example!



Chad

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Chad Stachowicz Sun, 07/27/2008 - 01:36
User Badges:
  • Silver, 250 points or more

After finding some dev code, and piecing together bits and pieces from vaious guides, I indeed have some java doing what I want! However I am unsure how to suck info in from VXML into my java. I see a getElementData, however where can I set the Element data before? Somewhere in Call Studio?


Chad

You can write the result into a Session variable in your action element.


String sessionVar = "MySessionVariable";

String stringValue = "the_value";

try

{

actionData.setSessionData(sessionVar, new String(stringValue));

actionData.addToLog("MyActionElement",

"Set Session." + sessionVar +

" to " + stringValue);

}

catch (com.audium.server.AudiumException ex)

{

actionData.addToLog("MyActionElement",

"EXCEPTION _ cannot set Session." +

sessionVar + " to " + stringValue);

}


You can supply data to your Action Element in one of two ways:


1. Through the Settings array. This is the most common way of supplying fixed or interpreted data (through Substitution), like the IP address of your AXL host, user name, password etc.


2. By fetching a Session variable that you have already set, perhaps in a previous Action Element or (if a String), with a simple Session data on a previous Audium element. This is an object.


public void doAction(String arg0,

ActionElementData actionData) throws AudiumException


...


Object obj = null;

obj = actionData.getSessionData("RecentTransList");


Now it's up to you to know EXACTLY what Java type this is, and you then cast it. In my case, this was a list.



//

// Now cast the object to the right type

//

ArrayList recentTransList = (ArrayList) obj;



You should have on your hard drive the Java doc for all the Audium classes. It's going to be easy to work from the reference material then.


Regards,

Geoff

Chad Stachowicz Sun, 07/27/2008 - 08:26
User Badges:
  • Silver, 250 points or more

Thanks got everything working I think. Here is another questions. There is only 4 FromEXTVXML's what if I need to return 10 fields into ICM, is there a procedure or better way to do this?


Chad

Chad Stachowicz Sun, 07/27/2008 - 09:03
User Badges:
  • Silver, 250 points or more

Geoff,


I am having a bit of confusion about 2 things. First I can't find this settings array in Call Studio, I think my issue is where to set something on Call Studio. Next how would I persay pull in the ANI from CallData.ANI ? I think this would answer things once and for all. :)


Chad

Chad Stachowicz Sun, 07/27/2008 - 11:04
User Badges:
  • Silver, 250 points or more

Geoff,


Got it working by passing ToEXTVXML[1] = "name=value" that I saw from a previous post of yours. Then I used getSessionData, everything it working great now. All I have to do is build out all my classes to fit this model, and do a bit of editing now! Cheers thanks for all the guidance!


Chad

Not sure if you are still interested in an answer to this.


Returning data to ICM.


Since ICM has a very nice function for breaking strings at fixed positions, one way that I find convenient is to pass quite a bit of data in a structured string, with fixed field widths. Pass it up in (say) FromExtVXML[0] and break it apart in the Script Editor and stuff the values into ECCs for later reference.


Regards,

Geoff

Chad Stachowicz Sun, 07/27/2008 - 12:56
User Badges:
  • Silver, 250 points or more

Geoff,


By breaking strings at fixed positions, does this mean by spaces, or like in PERL when I use the function split. Which function is it?


Chad

Chad,


Neither. The ICM Script substring function uses fixed positions.


substring(pos, length).


So if your string is "FOOBAGIZMO"


a = substring(1,3) = "FOO"

b = substring(4,2) = "BA"


A little different to the way most substring functions work, which normally go substring(pos1, pos2) - but workable.


Regards,

Geoff

Actions

This Discussion