@minArgs and maxArgs designates the number of parameters (minimum and maximum) for a parameter. For example, for a function with 2 parameters, minArgs and maxArgs will be 2 and 2. For 3 parameters, plus 1 optional, they will be 3 and 4 respectively.
Finally, the providerPart element provides the function implementation.
The provider attribute is mandatory, it specifies the database systems for which the implementation is provided. As shown in the example, when expression syntaxes or underlying functions differ, alternative implementations can be provided according to the database.
<function name="relativeMaturity" type="long" args="(<Âge>)" help="Returns the difference between a date and 18 years"
minArgs="1" maxArgs="1" display="Relative maturity of the person born on the date $1">
<providerPart provider="PostgreSQL" body="extract(year from age($1))-18"/>
In the @help and @display attributes, the string "$1" represents the name that was given in the first function parameter (here, "Age"). $2, $3... would represent the following parameters. In the @body attribute detailed below, $1 designates the argument value passed to the function during the call.