The custom functions whose return type is an array or a
register, or whose return type depends on the input values, have to
implement an additional method that returns the type of the function
based on the parameters of the function.

If the function has several signatures that meet one of these
conditions, there must be an additional method for each signature.

In the custom functions developed with Java annotations, this additional
method has to be annotated with CustomExecutorReturnType. If it is
developed with name conventions, the name of the method has to be
executeReturnType.

This additional method has to meet these rules:

It must have the same number of parameters as the “execute” method.

Each parameter of the additional method must have the same type or an
equivalent one, as its respective parameter in the execute method:

If execute returns a basic Java type, the additional method has
to return the same basic Java class. For example, if execute
returns a String object, the additional method has to return
java.lang.String.class.

If execute returns a CustomRecordValue object, the additional
method has to return a CustomRecordType object.

If a parameter of execute is a CustomRecordValue, the type of
the parameter in the additional method has to be
CustomRecordType.

If a parameter of execute is a CustomArrayValue, the type of
the parameter in the additional method has to be CustomArrayType.

#. If the returned type is a compound data type, the type will be created
in Virtual DataPort, unless it already exists. If the returned type does
not have name, the type will be created with a random name.

At runtime, every time this function is invoked, Virtual DataPort will
execute this additional method to know the return type of the function.

The following two sections contain an example of how to implement this
additional method in a function that uses annotations and in a function
that uses name conventions.