@Override
    public Object execute(ComplexEvent event) {
        try {
            S state = stateHolder.getState();
            try {
                switch (attributeSize) {
                    case 0:
                        return execute((Object) null, state);
                    case 1:
                        return execute(attributeExpressionExecutors[0].execute(event), state);
                    default:
                        Object[] data = new Object[attributeSize];
                        for (int i = 0; i < attributeSize; i++) {
                            data[i] = attributeExpressionExecutors[i].execute(event);
                        }
                        return execute(data, state);
                }
            } finally {
                stateHolder.returnState(state);
            }
        } catch (Exception e) {
            throw new SiddhiAppRuntimeException(e.getMessage() + ". Exception on class '" + this.getClass().getName()
                    + "'", e);
        }
    }
The main execution method which will be called upon event arrival

@param event the event to be executed
@return the execution result
modules/siddhi-core/src/main/java/io/siddhi/core/executor/function/FunctionExecutor.java