public virtual IReturnVector executeFunction(Rete engine, IParameter[] params_Renamed) { // the first thing we do is set the values DefaultReturnVector ret = new DefaultReturnVector(); if (params_Renamed.Length == inputParams.Length) { for (int idx = 0; idx < inputParams.Length; idx++) { BoundParam bp = (BoundParam) inputParams[idx]; bindings.Put(bp.VariableName, params_Renamed[idx].Value); } engine.pushScope(this); for (int idx = 0; idx < functionParams.Length; idx++) { ret = (DefaultReturnVector) internalFunction[idx].executeFunction(engine, functionParams[idx]); } engine.popScope(); return ret; } else { DefaultReturnValue rv = new DefaultReturnValue(Constants.BOOLEAN_OBJECT, false); ret.addReturnValue(rv); DefaultReturnValue rv2 = new DefaultReturnValue(Constants.STRING_TYPE, "incorrect number of parameters"); ret.addReturnValue(rv2); return ret; } }