Functions : Adding Custom Functions

Adding Custom Functions
TIBCO BusinessEvents allows you to write your own custom functions in Java and add them to the function registry.
When you have added the custom functions, their catalog appears automatically in the Catalog Functions view, along with the built-in function catalogs.
BusinessEvents documentation does not contain detailed instructions for creating custom functions or programming in Java. It is assumed that you are already familiar with programming in Java, and have at a minimum already implemented a class and a static function. Instructions explain how to make your custom functions available in BusinessEvents Studio.
See also:
Task Summary
The steps below summarize the tasks required to integrate your own custom functions with BusinessEvents Studio:
1.
2.
Create a file called functions.catalog, an XML file that makes it possible to access your custom functions from BusinessEvents Studio. You can also include information for a tool tip for each function. See Structure of a Function Catalog for details.
3.
Create a .jar file that includes the following:
4.
The functions are then available for use in any rule editor. (It is not necessary to restart BusinessEvents Studio before you can use your functions.)
The locations of the custom function jars are stored in the .beconfig configuration file, which is located at the root level of the BusinessEvents Studio project. You can check this configuration file into a version control system so that it can be shared with other project developers.
Note that the .beconfig file contains other information as well, such as the location of project libraries and so on.
Adding and Removing Custom Functions in a BusinessEvents Studio Project
To Add a Custom Functions JAR
1.
2.
In BusinessEvents Studio Explorer, right-click the project and click Properties (or press Alt-Enter). You see the properties dialog for the project.
3.
In the left panel, select Build Path and then select the Custom Functions tab.
4.
Click Add Library and browse to and select the custom function JAR file.
5.
If your custom function JAR file depends on additional third-party Java archives, select the Java Libraries tab, click Add Library, and browse to and select the relevant third-party JARs.
6.
If your function depends on third-party Java archives and you did not do step 5, a dialog displays when you click OK. It lists the name of the class or classes that could not be loaded. To resolve the problem, do step 5.
7.
Deploytime Action Required  To make custom functions available at runtime, manually copy them to the lib directory, or other directory in the classpath. Do this manually on all machines where BusinessEvents is installed.
To Remove a Custom Functions JAR
To remove custom functions follow the instructions in To Add a Custom Functions JAR, but instead of clicking Add Library, select the function you want to remove and click Remove Library. Remember to also remove third-party JARs using the Java Libraries tab, if your function depends on any.