@Override
    protected StateFactory init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader,
                                SiddhiQueryContext siddhiQueryContext) {
        returnType = siddhiQueryContext.getSiddhiAppContext().getScript(functionId).getReturnType();
        script = siddhiQueryContext.getSiddhiAppContext().getScript(functionId);
        return null;
    }
Executor class for Script function. Function execution logic is implemented in execute here.
modules/siddhi-core/src/main/java/io/siddhi/core/executor/function/ScriptFunctionExecutor.java