cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
606
Views
2
Helpful
5
Replies

MyStandardAction Class Not setting the Session Data

ajey_shetty
Level 1
Level 1

Hello,

I built a basic MyStandardAction Java Class

import com.audium.server.AudiumException;

import com.audium.server.voiceElement.ActionElementBase;

import com.audium.server.session.ActionElementData;

public class actionCC extends ActionElementBase

{

    public void doAction(String name, ActionElementData data) throws AudiumException

    {

        int test = 12345;

        data.setSessionData("OriginalCC", test);

    }

}

This class I applied to the action element.

In the next node I tried to logg the value of OriginalCC to the Activity log .

ie. in Add to log

Name : actionCC

Value:  {Data.Session.OriginalCC}

But when I make a call and run this script I am getting the following message in the Activity Log :

10.16.20.81.1512996361190.35.selfserviceV4,12/11/2017 05:46:05.838,Area_Path,element,warning,A substitution representing Session data named "OriginalCC" referred to non-existent information. An empty string was substituted instead.

10.16.20.81.1512996361190.35.selfserviceV4,12/11/2017 05:46:05.838,Area_Path,custom,actionCC,

Can anyone help me understanding what i am doing wrong. I am new in using java classes in CVP call studio.

Thank you in advance

Ajey Shetty

1 Accepted Solution

Accepted Solutions

janinegraves
Spotlight
Spotlight

Hi Ajey, that looks correct.

1)Where are you storing the class file to test it?

2) The easiest way to test custom java is to copy the class file into

the  Studio app right in the  Studio Navigator - and put it into the

appname/deploy/java/application/classes folder.

That way when you deploy and transfer the application, the new java will

be updated in VxmlServer memory.

3) If you've stored it into the VXMLServer/common/ directory - then

every time you modify the class, you'll have to copy it over and restart

VXMLServer.

4)CAUTION: if you have the class file in both the VXMLServer/common AND

inside the app, then the VXMLServer/common code is used.

5) So my recommendation is that for now, you remove your class or jar

from VXMLServer/common and restart VXMLServer.

And copy the class file into your studio app under

appname/deploy/java/application/classes

6) CAUTION: If you're using the OAMP to transfer your app to the

VXMLServer - BEWARE that it will always display "success" - but if the

java class in the app is not valid (bad classname or in the wrong

subfolder of the app) then VXMLServer fails to load that version of the

app into memory. So, look at the applications/appname/ogs/adminLog to

see if the updateApp was successful or failed.

7) You might add this into the java code immediately after you

setSessionData to ensure that it's creating the session variable.

Then re-compile. Copy the class into your

appname/deploy/java/application/classes folder. Then deploy and transfer

(or update).

Check the adminLog for 'success'. Call in and see if the new line of

code you added displays in the activityLog.

*

**//this will get the value from session data and add it to the activity

log**

*

data.addToLog("OriginalCC", data.getSessionData("OriginalCC").toString);*

*

View solution in original post

5 Replies 5

ptindall
Cisco Employee
Cisco Employee

Set your data value as a String.  Although you can set session data to any object type you wish for your own internal purposes, if you don't use a string you'll have problems with general functionality such as substitution.

janinegraves
Spotlight
Spotlight

Hi Ajey, that looks correct.

1)Where are you storing the class file to test it?

2) The easiest way to test custom java is to copy the class file into

the  Studio app right in the  Studio Navigator - and put it into the

appname/deploy/java/application/classes folder.

That way when you deploy and transfer the application, the new java will

be updated in VxmlServer memory.

3) If you've stored it into the VXMLServer/common/ directory - then

every time you modify the class, you'll have to copy it over and restart

VXMLServer.

4)CAUTION: if you have the class file in both the VXMLServer/common AND

inside the app, then the VXMLServer/common code is used.

5) So my recommendation is that for now, you remove your class or jar

from VXMLServer/common and restart VXMLServer.

And copy the class file into your studio app under

appname/deploy/java/application/classes

6) CAUTION: If you're using the OAMP to transfer your app to the

VXMLServer - BEWARE that it will always display "success" - but if the

java class in the app is not valid (bad classname or in the wrong

subfolder of the app) then VXMLServer fails to load that version of the

app into memory. So, look at the applications/appname/ogs/adminLog to

see if the updateApp was successful or failed.

7) You might add this into the java code immediately after you

setSessionData to ensure that it's creating the session variable.

Then re-compile. Copy the class into your

appname/deploy/java/application/classes folder. Then deploy and transfer

(or update).

Check the adminLog for 'success'. Call in and see if the new line of

code you added displays in the activityLog.

*

**//this will get the value from session data and add it to the activity

log**

*

data.addToLog("OriginalCC", data.getSessionData("OriginalCC").toString);*

*

Thank you for the information. This is of great help.

I have a quick question, do I have to place any of the jar file (ex: framework.jar) in the VXML/Common/lib or in appname/java/application/lib  of the VXML server ?

You don't need to move or copy the framework.jar.

Just enter the location in the java class path so  the java compiles.

VXMLServer knows where to find it.

Thank you so much. This worked