cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1197
Views
0
Helpful
4
Replies

Application startup and application variables

MikeHMirt
Level 1
Level 1

Using call studio v11.  I have a two part question.  As part of my application I want to load from a file configuration information that will be used by the application.

Question #1:  Is there an initialization phase for the applications that only runs once (ex: call a java class)  This class will execute, and store application configuration information in "application" scope variables to be shared by all calls.

Question #2: Can someone explain the proper approach using studio to create application variables.   I see how element, and session variables can be created, but I'm not able to understand how application scope variables are created using elements.   Also, I have created a java class that I invoke from the action element.  In that java class I create an application scope variable using :

    data.getApplicationAPI().setApplicationData(parm1, parm2);

When I debug the application inside studio and execute the action element I don't see in the debug window any application scope variables listed.  Should I expect to see application scope variables in the debug pane that are created by a java class?

Thank You.

1 Accepted Solution

Accepted Solutions

janinegraves
Spotlight
Spotlight

Application data is persistent, but there's no visibility of it within

Studio out of the box elements.

You have to use your own custom java components to get/set.

Look in the javadocs at the APIBase (which is inherited by ElementAPI) -

and look at its method named getApplicationAPI

That will then point you to theApplicationAPI - which contains the

getters and setters for both Application and Global data

On the CVP system, there's a *jconsole gui window*where you can

get/set Application Data (which is helpful when testing your custom java

to ensure it worked):

  • double click C:\Cisco\CVP\jre\bin\jconsole.exe

  • Login with ipaddress:9696 (no user or pwd)

  • It'll say that it "Failed to log in securely", press OK.

  • Go to the tab labeled MBeans

  • Expand: Cisco Unified CVP VXMLServer/ Voice Application/

Appname/Data/Operations - and you can then setApplicationData (name,

value) or getApplicationData (provide a name)

View solution in original post

4 Replies 4

janinegraves
Spotlight
Spotlight

Application data is persistent, but there's no visibility of it within

Studio out of the box elements.

You have to use your own custom java components to get/set.

Look in the javadocs at the APIBase (which is inherited by ElementAPI) -

and look at its method named getApplicationAPI

That will then point you to theApplicationAPI - which contains the

getters and setters for both Application and Global data

On the CVP system, there's a *jconsole gui window*where you can

get/set Application Data (which is helpful when testing your custom java

to ensure it worked):

  • double click C:\Cisco\CVP\jre\bin\jconsole.exe

  • Login with ipaddress:9696 (no user or pwd)

  • It'll say that it "Failed to log in securely", press OK.

  • Go to the tab labeled MBeans

  • Expand: Cisco Unified CVP VXMLServer/ Voice Application/

Appname/Data/Operations - and you can then setApplicationData (name,

value) or getApplicationData (provide a name)

janinegraves
Spotlight
Spotlight

You can also create a java component that runs at Start of Application -

which means only when the app is loaded in memory (deployApp.bat,

updateApp.bat, reboot) - so it doesn't execute very frequently. The

whole idea is to create some Application data when the app is loaded

into memory, and have that data remain persistent in memory. If you have

to change the data, just run the updateApp.bat for that particular

application.

The Start of Application class is the only component that is passed the

ApplicationAPI.

Anything else you write (Action, Decision, Start of Call, etc) must

access it like this elementAPI.getApplicationAPI()

ptindall
Cisco Employee
Cisco Employee

Michael,

Using a Start Application class as Janine mentions you can trigger the Studio App itself and do initialisation using the standard script or custom elements.   The mobile agent CLI fixup app I gave you the link to does exactly that.  Check out the TriggerThisApplication class and the script sample.  The need in that case is to load some config into static application data at application start/update.  The reason for doing the initialisation in the script is to avoid having to hard code hostname/IP and access credentials in the Start Application class itself.  Using the Studio application allows you to configure such things via element settings.  So, bottom line is that you can have a Studio app that both does the normal run-time processing and also has a section to perform startup initialisation, simply using the Start Application class as the initialisation trigger.

Note that the scope of any static class variables you create is limited the single application that created them because a new class loader is created for each application loaded.

Paul

Janine & Paul  

  This Start Application Class is what will meet my needs for the application (Deploy, Update, Reboot).  Paul, thank you again for the helpful sample code you provided.  Appears to be the example I need.

Mike

Getting Started

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: