Script functions reference > Script functions in alphabetical order > J > JavaInvokeMethod

JavaInvokeMethod
Syntax
JavaInvokeMethod(strObjHandle, strMethodName, [var_1, var_2, ...], [return_var]);
strObjHandle
strMethodName
var_1, var_2, ...
return_var
Optional StreamServe variable that will be set to the return value of the invoked Java method.
Description
Invokes the Java method strMethodName of the Java object identified by strObjHandle. The JavaInvokeMethod function can take zero or more variables as arguments, and zero or one return variable. All the variables must be defined in StreamServe scrips. Explicit values, or return values from other functions can not be passed directly to the JavaInvokeMethod function. The last variable is always the return value, it is therefore not possible to transfer argument variables without having a return variable. All variable values are transferred to Java as java.lang.String values.
Returns
A number indicating whether the method was successfully invoked.
0
-1
Example
iRetVal = JavaInvokeMethod("objTestHandle", "clearDocStatus");
$iRetVal = JavaInvokeMethod("objTestHandle", "getDocStatus", $retStatus);
$iRetVal = JavaInvokeMethod("objTestHandle", "docProcessed", $job_id, $doc_id, $retStatus);
The corresponding Java methods for the above calls must be:
public void clearDocStatus()
public String getDocStatus()
public String docProcessed(String job_id, String doc_id)
OpenText StreamServe 5.6 Updated: 2013-03-01