Note: This topic describes Custom Function extensions, which have superceded custom function handlers as of 10.2. For information about the old mechanism, see Maintain a Custom Function Handler.
A custom function is a method of extending the set of functions available to a rule developer. It is more limited than an inferencing listener in that it can only return a single value at a time. A custom function cannot modify a session except indirectly by returning a value that is used in a rule.
However, the advantage of custom functions is that they fully participate in backwards chaining, the process by which the return value (the goal) is traced back to its dependent attributes. Essentially this means a custom function can:
Custom functions can be written in either Java or .NET, depending on the target platform for the deployed rulebase; for example, the Debugger (which is written in .NET) requires a .NET implementation of the custom function in order to debug a rulebase. It is also possible to supply both a Java and a .NET implementation and the rulebase will then work on either platform.
From a rule developer’s perspective, a custom function extension is a folder that is copied into the Extensions folder of any rulebase project. The custom function is called in exactly the same way as a built-in function, with the compiler verifying correct usage. At build time, the required information and supporting DLLs/JARs are copied into the rulebase zip so that it can be automatically loaded by the engine when the rulebase is loaded.