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, making them available from within the function registry along with the prepackaged functions in the rule editor.
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.
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.
Open the project in BusinessEvents Studio.
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.
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.