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

Authoring XPath functions

XML Path Language (XPath) expressions are widely used in monitor model programming to define maps, trigger conditions, filters, correlation predicates, and default values. User-defined XPath functions can be implemented as specially annotated Javaâ„¢ methods. You can use these XPath functions in the same way you would use any built-in XPath function within an expression. You can develop user-defined XPath functions through a Java project in Rational Application Developer or Integration Designer.

Business Monitor supports using user-defined XPath functions in XPath expressions in the same way as built-in XPath functions. User-defined XPath functions provide alternatives to inbound events for accessing information. While inbound events transfer information in a source-initiated manner, you can use user-defined XPath functions to initiate information retrieval.

For example, a user-defined XPath function can be implemented as a web service call to retrieve corporate data from an overseas branch. It can also involve updating some records in a database. You can define metrics whose values are set based on an algorithm that you define and implement as a user-defined XPath function. An example would be a function that takes a product or catalog number and returns a product description or price.

In the following example, the return value of a user-defined XPath function named usr:get-cost-estimate is used as an argument in the built-in XPath function fn:concat, which concatenates two string values.

fn:concat("The estimated cost is: ", 
   usr:get-cost-estimate(projectDuration, projectStart, costOfMaterial))

Additional information on this topic is covered in Manage user-defined functions.

Create monitor models