cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2800
Views
4
Helpful
5
Replies

custom java classes in uccx 8.5

chasfelss
Level 1
Level 1

We are trying to write some custom java classes in uccx 8.5 and are running into troubles.

What version of jdk should the classes be written in?  we are seeing 1.4 and 1.6 in the documentation.

Is there format that the classes should be written in?

Is there a more specifc folder that we need to load th jar files in other than dumping them into the folder through the custom file configuration?

thanks.

5 Replies 5

Valber Carvalho
Level 1
Level 1

Hi chasfelss,

I am not a specialist but I have done some tests with Java Classes. I have realized some limitation during the tests, but I think that you can try.

if you uploaded your *.jar to the CCX, you have to close your CCX editor, after that you can open it, and you will see your classe(s) when you will create a variable.

If you want to see your constructors or your methods you have to edit the name of the class in Java tag.You should select the name 'Object' and type the name of your class in the "value window". See the Screenshots.

Good Luck!

Valber

Gergely Szabo
VIP Alumni
VIP Alumni

Hi,

Java 6 (or 1.6).

Format of the classes? Well, just go along with the best practices of Java programming, for instance, use packages (and don't use the default package).

Yes, it's the Custom file configuration, and you must choose the jar files as "selected classpath entries" and then restart the CCX engine.

In the CCX editor, you can directly access your classes using the class name with the package name in your Set steps.

For instance,

Set c = {

return bar.foo.NeatClass.staticMethod(param1);

}

Or, if you need to instantiate:

Set c = {

bar.foo.NeatType newNeatType = new bar.foo.NeatType(param1);

// do something useful

return something;

}

G.

Hi,

I am struggling with the same issue with UCCX 8.5.

I have tried creating jar files using 1.6 as well as with 1.5 but none of my classes in the jar file are shown up.

I tried placing some files in certain packages and some files were in default package, but none of them show up when i try creating a new variable or when i try to set a value for a particular variable.

I restarted the engine after uploading the file and also restarted the CCX editor, but to no avail.

I even tried using the jar file shared by "Valber" in the above post, but even that doesn't show up.

Thanks for the help

Hi Jawad

The classes won't show up in the 'new variable' dialog at first.

You have to first create an instance in a Set or Do step as Gergely has pointed out above. Once you have succesfully validated your code (e.g. pressed 'apply' or OK and not got an error) then your class is loaded and will appear in the 'new variable' dialog.

Re: packages, if you have the classes in the default package, then you can instantiate them with a simple class name - e.g. 'new MyClass'

If you put it in a package then you must fully qualify the package (e.g. 'new org.jawad.MyClass').

I would recommend putting your code in a package to avoid naming clashes with the existing code base.

Regards

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

Thanks, it worked perfectly.