Calling a method from your java code can be done two ways depending on where you are making the call from.
If you are in an LJO, you must use WebAppAccess callMethod(..)
method. Here is an example calling a method named doWork that takes a string argument:
In this example the actual signature of doWork is as follows:
public void doWork(WebAppAccess webAppAccess, String name);
Making a call through the callMethod(..) method automatically passes the WebAppAccess as the first argument.
If you are in a WebApp method you can make the call directly since all methods of your WebApp are compiled into a single Java class. Here is an example calling a method named doWork that takes a WebAppAccess and a String argument:
When you make the call directly, you must pass in the WebAppAccess, as well as the other arguments, yourself. However, you can still also use the callMethod(..) method in this situation.
Parent topic: Method and LJO method calls: wpf7