Execute function

The function group in Catalyst is created and defined using either the online editor or the Command Line Interface (CLI). The function group can be executed to verify its functionality.

Execute Function

If a function endpoint is needs to be executed, then the following code snippet can be used. Here, the function’s parameters are constructed as JSON objects and passed through the executeFunction() method.

The function ID is an auto-generated numeric long integer value.

Ensure the following packages are imported:

    
copy
import org.json.simple.JSONObject; import com.zc.functions.ZCatalystFunction;
    
copy
//Create a JSONObject For Adding Parameters JSONObject jsonobj = new JSONObject(); //Add Parameters as key-value pairs to pass them to the method jsonobj.put("Name", "Amelia"); //Execute the method referring the function groupId with the JSON object Object result = ZCatalystFunction.getInstance().getFunctionInstance(1510000000054095L).executeFunction(jsonobj);

Last Updated 2023-09-03 01:06:41 +0530 +0530