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

IPCC 4.0 Premium - how to call a java method

Hi,

I know that in version 3.5, we can use the "execute java method" step from the java panel but it's deprecated in 4.0.X

In the documentation, they wrote to use the "set" step. It's working fine if you have to set something to a variable but what is you just want to call a method ?

for example :

you have a date variable : java.util.Date myDate = new java.util.Date();

and you want to use the void setHours(int) Method.

How is it possible ??

I did it in the past but I forgot how to do that :(

Thanks you for you help !

Thierry

4 Replies 4

Gergely Szabo
VIP Alumni
VIP Alumni

Hello,

Java methods can be sort of programmed natively in CRS 4.x - indeed, using the Set step.

Can you give me some more information on what you are trying to achieve here? I guess the easiest thing is to program a method using the set step that will return int 0 to a dummy variable...

G.

Hi G.

Yes I read the same in the documentation : use the Set step. But it's not really convenient. A set Step is to put something into a variable. In my case, I just want to call a method to set something in a java class which will return nothing -> void myMethod(int x);

As you propose, I can use a dummy variable but it's not really good ...

-> Set myDummyVariable to

{

myClass.aMethod(parameter1);

return 0;

}

Is it the only possibility ?

Thanks you

Thierry

That's the way I know how to do it. Not elegant, as you say. Perhaps not as elegant as the previous "Execute Java Method".

However, the huge improvement in the capabilities of the Expression Editor is a terrific trade-off.

Regards,

Geoff

Hi Geoff,

Ok I will use the same way... That's also true the expression editor is really better ! particularly for java developpers ;)

Kind regards,

Thierry