Deprecated. This function allows you to call execution of external custom-written Java classes from within any FlexQuery-expressions specified in your templates. Thus, it provides the ultimate way to extend functionality of DocFlex templates so as to meet your specific needs not supported by DocFlex directly.

The custom Java class should implement the

com.docflex.api.generator.FlexCallHandler
interface provided by DocFlex API (see DocFlex API Documentation).

The function works the following way:

Once the class is called the first time, it is searched by the fully qualified name specified in the className parameter. If no class with such a name found or what is found does not implement the FlexCallHandler interface, the generator raises an exception and then terminates.

As the specified class is successfully found, an instance of it is created and initialized with the FlexCallHandler.initCallHandler(GOMContext context) method. That instance is stored then by the generator during the rest of the generation session and reused each time the class is called again.

When the generation is about to finish (even at the time it is terminated by an exception or a user request), all created FlexCallHandler instances are disposed with the FlexCallHandler.disposeCallHandler() method called for each instance object. This allows you to release any resources you could associate with a particular call handler.

Having a FlexCallHandler instance object, the generator invokes its FlexCallHandler.execCall(GOMContext context, Object[] params) method each time the callForName() function is executed. The object returned by this method becomes the function result.

Parameters:

className

The fully qualified name of the call handler class.
param
params
If specified, provides one or several parameters passed to the FlexCallHandler.execCall() method.

Note: In addition to those parameters, the FlexCallHandler.execCall() method always receives a GOMContext object which provides access to all generator's variables.

Example:


toEnum (callForName(
   "com.docflex.together.rwi.RWICallHandler",
   "get_known_implementing_classes"))
Tip:

You may use the callForName() function to generate your own sets of elements and then process them with an Element Iterator defined in your template.

To do this, you should invoke the Element Iterator's properties dialog and specify in the 'Iteration Scope' tab the "Custom" Element Collecting Method.

Then, fill in the 'Expression for Element Enumeration' field the call to callForName() function generating the enumeration of the elements you want to iterate and enclose the call in toEnum() as parameter, like shown in the example above (it is needed, since this field accepts only enumerations).

For more details, see documentation:
Element Iterator (details) | Specifying Element Iteration Scope | Custom.