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

Use event parts in notifications

In previous versions of Business Monitor, you could include metric and KPI information in alerts using Common Base Event-style event definitions. Although you can still use this capability, in 8.0 you can also include metric and KPI data in alerts using event parts in the XSD format. The data in the event parts can be referenced by XPath expressions in the Monitor Action services notification templates.

When you click Configure this event to be processed by IBM Business Monitor action services, the outbound event definition is automatically set to use the ActionServicesEvent.cbe that is shipped with Business Monitor.

If you want to include metric or KPI information to be passed with the notification, you can add additional data elements to the ActionServicesEvent.cbe definition. Alternatively, you can add a new event definition in XSD format. You can add the definition as an event part to any outbound event definition, and the outbound event will use the event part along with the ActionServicesEvent.cbe.

The information in an XSD event part can be referenced when you create an alert notification template in the WebSphere Application Server administrative console. You can use XPath expressions in the Subject and Body fields to retrieve the information, which can then be presented with the notification in the dashboards.

To add an event part to a notification:


Procedure

  1. In the IBM Business Monitor development toolkit, create the XSD event definition.

    For example, create an order.xsd to define the data associated with a specific order, an account.xsd to hold the account data, and so on. For information about creating XSD event definitions, see Recommendations for creating XSD files.

  2. Continuing to use the toolkit, create an outbound event in your monitor model and select the check box to Configure this event to be processed by Monitor action services. Specify the trigger that will cause the outbound event to be emitted.

  3. Click the Add button below the Event Parts table to add the event part that will contain the metric or KPI specific data to pass along with the notification.

  4. Specify a name for the event part (for example, OrderPart), and then click Select Type.

  5. Click Choose the data type from the XML schemas accessible from this monitor project and expand the tree. The event definitions that you added in Step 1 are listed. Select the event part type element and click Next.
  6. Type a namespace prefix for the XML namespace. The default namespace is tns (for target namespace), and you can use that value or specify any name that is meaningful to you. Click Finish and then click Finish again to close the Create New Event Part Type page. The event part is added to the Event Parts table.
  7. Map the data in the event part definition to the metric or KPI data in your model. If you expand the nodes in the Outbound Event Content table, you will notice that the BusinessSituationName already contains the name of the outbound event. Content Assist is available to help you specify a value in the Expression column to map your metric or KPI values to the event elements.

  8. You can add additional event parts to this outbound event definition and map their data elements to additional metric or KPI data to be passed with the notification. You can use reusable event parts that can be referenced by other outbound event definitions.

  9. At this point, you should make a note of the namespace URI that was added to your monitor model when you created this outbound event definition. To locate the value of this URI, click the root element in the model tree on the Monitor Details Model page and look at the Namespace Prefix Mappings table. There will be an entry for the XML namespace prefix that you specified in step 6.

    For example, if you created an event definition called order.xsd and accepted the default namespace, tns, look for the URI associated with the prefix tns. Record the value of this URI, for example, http:///project_name/order.xsd. You will need this value when you configure your alert notification template.


What to do next

The next step is to configure an alert notification template in the WebSphere Application Server administrative console.

  1. Using the WebSphere Application Server administrative console, create a new alert notification template, completing all of the fields except for Subject and Body.

    For example, create a notification called Credit Limit Exceeded to send notifications when expenditures have surpassed the credit limit.

    When you are finished, click Apply. For information about creating notification templates, see "Creating a new notification template."

  2. On the Notification Template Configuration page, click Template XML namespaces.

  3. Click New.

  4. In the XML Namespace prefix field, enter the XML namespace prefix that you specified in step 6 (for example, if you accepted the default, use tns).

  5. In the XML Namespace field, enter the resolved XML namespace that corresponds to the XML namespace added to your monitor model when you referenced the event part and specified the namespace prefix to use. This is the value of the namespace URI you recorded in step 9.

    For example, if the XML namespace prefix on the notification template was set to tns, the definition might resemble http:///project_name/order.xsd.

  6. Click OK.
  7. Return to the Notification Template Configuration page for the notification you created.

  8. In the Subject field, the Body field, or both, use XPath to reference the event part element using the following format:
    %%[Event part Path]/[Template XML namespace prefix: Event part Type]/[Template XML namespace prefix:element_name]/text()% 

    For example, if the XML namespace prefix on the notification template was set to tns, the definition might look like:

    %%cbe:CommonBaseEvents/cbe:CommonBaseEvent/tns:orderDetails/tns:orderId/text()% 

  9. Click OK.

The information in the event part will be presented with the notification in the dashboards.

Defining outbound events for monitoring contexts