03-15-2011 08:58 AM - edited 03-14-2019 07:34 AM
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.
04-09-2012 01:06 PM
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
04-09-2012 02:29 PM
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.
05-01-2012 03:28 AM
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
05-01-2012 04:22 AM
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
05-01-2012 05:28 AM
Thanks, it worked perfectly.
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