01-14-2016 12:11 PM
Is there a way to pass java objects between cvp applications using subdialog elements?...or is there another way to do this?
Solved! Go to Solution.
01-31-2016 07:39 AM
Yes, you can pass the java objects within application or from application to application using CVP Sessions.
For example,
You like to pass a String from One application to other application.
STEP-1: You add it into Session from Java at Decision/Action Element in Call Studio.
Command: String name=(String) dataObject.setSessionData("name");
STEP-2: To transfer this, you add this session name at Application Transfer element in Data Tab.
STEP-3: After deployed into VXML Application, you will get
01-18-2016 10:19 AM
You can't pass a Java object directly but you could pass a reference to data stored in either a back-end repository or global data in the VoiceXML server. If you adopt the global data approach, then be aware of the following:
Paul
01-27-2016 05:00 AM
Thank you for the response. Upon further review we have decided to try a different tactic which is not working as expected. We are trying to pass a java object that has been converted into its json representation using the Subdialog Invoke parameter. We set the json string as such:
String jsonInString = mapper.writeValueAsString(obj);... and set jsonInString to session data...the try to pass the value using the Subdialog Invoke parameter. The application fails after entering the Subdialog Invoke. Any ideas?...thanks
01-27-2016 01:36 PM
You will hit problems with JSON as populating variables with '{}' characters denotes variable substitution. Check the subdialog errorlog or even the globalerrorlog depending on the point it failed.
01-28-2016 11:30 AM
Thank you fro the response. We did have issues with the '{}' and "" characters. We modified the string to get the subdialog to accept it as a parameter. Then we convert it back to the original string in the receiving app but the conversion back to an object is failing. We are using:
obj = mapper.readValue(jsonString, obj.getClass());...to convert the string back to the original object but get the following error:
com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.Class out of START_OBJECT token
at [Source: {"tfn":"8888888888","dnis":null,"bgn":null,"ucid":null,"appName":null,"ani":null,"stateCode":"MN","commonWavURL":null,"commonGrammarURL":null,"applicationBaseWavURL":null,"applicationBaseGrammarURL":null}
01-31-2016 04:25 AM
And if you do the same JSON --> object deserialisation using standalone code, does it work?
01-31-2016 07:39 AM
Yes, you can pass the java objects within application or from application to application using CVP Sessions.
For example,
You like to pass a String from One application to other application.
STEP-1: You add it into Session from Java at Decision/Action Element in Call Studio.
Command: String name=(String) dataObject.setSessionData("name");
STEP-2: To transfer this, you add this session name at Application Transfer element in Data Tab.
STEP-3: After deployed into VXML Application, you will get
02-24-2016 01:10 PM
The end of your message seems to have been cut off. Could you please post the rest of STEP-3 ?
And does this mean the two applications will share the same Session ?
Thanks
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