cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6688
Views
25
Helpful
4
Comments
Reena Mundary
Level 1
Level 1

Those who are new to Java and wants to write 1st java application to be integrated with UCCX, this will help you to write and deploy the java application and integrated with UCCX.

 

  1. Set Java Environment
  2. How to create Java file, class file and jar file
  3. Uploading jar file in UCCX and configuration
  4. UCCX script to call JAVA application

Set Java Environment

  • Check the java version that UCCX version supports. This information can be get from UCCX compatibility guide. (Under the section system-->java version.)

Example: I am using UCCX 10.0 so java version that it supports it JDK/JRE 1.6.0_45

 

  • Download and install  JAVA JDK 1.6.0_45 on  your system
  • Set Class path and Path

 

  • Computer-->right click -->property-->Advance system setting-->Environment Variable--> System Variable
  • Click new
  • Set

Variable name: CLASSPATH

Variable Value: C:\Program Files\Java\jdk1.6.0_45\bin;C:\Program Files\Java\jre6\bin;

Note: above is the install path for JDK and JRE

  • Click OK
  • You can verify java version by running the command java –version

How to create Java file, class file and jar file

I am writing a simple java program which will accept two integers from UCCX and then add two integers and return the sum to the two numbers and pass to UCCX.

  • Write the java code in the text file and save it as add .JAVA

import java.util.*;

import java.lang.*;

import java.io.*;

 

public class add

{

      public static int sum(int n, int m)

     {

     int a=n;

     int b=m;

     int c=a+b;

    return c;

    }

}

 

  • For Compiling the java file , go the folder where your java file is there and run the command javac add.java.

  • Note: You can see the add.class file in the same location where java file is there.
  • For creating jar files , run below command and you can see.jar file in the same folder .

Uploading jar file in UCCX and configuration

  • In UCCX administration page go to Application-->document management--.>default-->classspath

 

  • Click upload Document button, browse the jar file and upload it.

  • Then go to system—>custom file configuration. Your jar file should be under the “Selected classpath Entries:” if not then put your jar file under that box and click update.

  • After that restart the UCCX Engine service and Cisco Unified CCX Administration service.

UCCX script to call JAVA application

  • Open the script Editor
  • Click new to open the new script.

Note: Now when you create new variable, you can see the type “add” , if not the jar file has not added properly or some issue with jar file.

 

  • Create a variable X of type integer and set value 2
  • Create a variable Y of type integer and set value 3

 

  • Create a variable Y of type integer and which will store the sum of X and Y.

  • UCCX Script

  • Drag the set option and set below value. Where “add” is the class and “sum” is the method in that class and passing X and Y as two arguments.

 

 

When you will debug the script you can see the value of z is the sum of the two numbers. X and Y value are passed as argument and SUM method will add the numbers and return the value and assign it to Z.

 

Comments

Thanks Reena...It really helped me alot.

cndilip123
Level 1
Level 1

Thanks Reena. This was helpful.

TroyNiemeier
Level 1
Level 1

Thanks, Reena!

This opens so many doors for using this Editor.

As a clarifying question, though, when you declare the variable 'A' as an 'add' type and set it to null, don't you eventually need to instantiate A as a new add object, like this?

 

Set A = new add();

 

Also, when you use the sum method, don't we have to reference the variable ('A') instead of the class ('add'), like this?

 

Set Z = A.sum(X, Y);

 

Because otherwise there's no reason to create a variable 'A' if we can simply reference 'add' whenever we wish to implement the sum method, right?

I'm no Java expert, but I thought that's how these OO (object-oriented) objects work.  Please correct me if I'm mistaken.

 

--EDIT--

Sorry, I failed to notice that the add Class is static.  That would allow us to use the sum method without instantiating or having to reference 'A'.

 

Thanks, again!

 

 

juber.mulani77
Level 1
Level 1

Thanks a lot Reena, for sharing this valuable information.

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: