IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing monitor models > Create monitor models > Defining monitor details models

Manage 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 can add user-defined XPath functions, there must be a Javaâ„¢ archive (JAR) file available that includes user-defined functions. For further information, see Authoring XPath functions.

To make user-defined functions accessible to the Monitor Model editor:


Procedure

  1. Copy (or drag) a JAR file with user-defined XPath functions into the business monitoring project.
  2. Right-click the monitor model in the Project Explorer view and click External Function Libraries.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. Click Finish when you have made your changes.


Results

Expressions within the monitor model can now use all of the XPath user-defined functions in the JAR file that was registered as accessible to the monitor model. The user-defined function tree on the Monitor Details Model page shows the functions that are available for use, ordered by function namespace and implementing class. Where appropriate, content assist shows the functions as part of the list of functions that are available for use in creating expressions.

Defining monitor details models