Java.InvokeModule

Syntax

InvokeModule(ModuleId: String, ClassName: String, MethodName: String, MethodSig: String, Params: Array): Variant;

Parameters

ModuleId. Java module identifier in repository.

ClassName. Class name. Parameter value is case sensitive

MethodName. Name of executed method. Parameter value is case sensitive

MethodSig. JNI signature of method

Params. Array of parameter values sent to method.

Description

The InvokeModule method executes a static method stored in a Java module and returns result of its work.

Example

Executing the example requires that the repository contains a Java module with the MOD_JAVA identifier. The module contains the following class:

public class Test {

    public static double staticFunc(double a, double b){

        return (a + b)/2;

    }

}

Add links to the Java and Metabase system assemblies.

Sub UserProc;
Var
    jUtils: IJavaUtils;
    Result: Variant;
Begin
    jUtils := New JavaUtils.Create;
    Result := jUtils.InvokeModule("MOD_JAVA""Test""staticFunc""(DD)D"1.02.0);
    Debug.WriteLine(Result);
End Sub UserProc;

On executing the example, a Java function will be executed, which executes mathematical calculation based on the values sent in parameters. The function execution result will be displayed in the development environment console.

See also:

Java