Managing user-defined functions
You can make classes of custom XML Path Language (XPath) functions accessible to the Monitor Model editor. After you have added the classes, expressions within the monitor model can use the user-defined XPath functions. The user-defined functions are shown in the table on the Monitor Details Model page and added to the available functions listed in content assist, where appropriate.
Before you begin
About this task
Procedure
- Copy (or drag) a JAR file with user-defined XPath functions into the business monitoring project.
- Right-click the monitor model in the Project Explorer view and click External Function Libraries.
- In the External Function Libraries window, click Add JARs to add a reference to the JAR file. You can also click Add External JARs to add a reference to a JAR file that is located on a disk outside of the workspace. The custom XPath functions that are in the JAR file can now be made available to any monitor model in the project.
- To make the user-defined functions available to a monitor model, click the Monitor Details Model tab of the editor and click the root element (the monitor details model) in the model tree. Go to User-Defined XPath functions and click Edit. The Manage User-Defined Functions window displays the available user-defined functions.
- Optional: To add new user-defined functions, click the check box next to the namespace and type a namespace prefix. For example, you might type math for a library of math functions. The prefix is used for ordering the functions when you select them from content assist, and can also help to differentiate two functions that have the same name but different implementations.
- Optional: To change the default prefix assigned to a namespace, select the namespace node and update the prefix in the field below. If the namespace node was already in use, click Next to see a preview of all the expressions in the monitor model that will be updated to use the new prefix.
- Click Finish when you have made your changes.