, , , ,

calculate (String, Object [], INodeHelper)

public Object calculate (String functionName, Object [] parameters, INodeHelper helper)

This method is what the function is all about – it performs the required calculation and returns the result.

Parameters

functionNamethe name of the function in the library that needs to be calculated
parametersthe values of function parameters as specified in a rule where the function is used. The given array contains Java objects corresponding to different attribute types (String, Integer, DateHolder etc – see a complete list in the Appendix A)
helpera call-back interface. Should not be used by custom function libraries.

Returns

The result of the calculation as a Java object of the type corresponding to the attribute types – see Appendix A. If the function value cannot be calculated for whatever reason (for example, the number of parameters or their types are wrong), null should be returned.