Skip to main content

skip to main content

developerWorks  >  Sample IT projects | Architecture | WebSphere  >

Put new capabilities of business activity monitoring (BAM) to work, Part 6: Integrating high-level and low-level monitor models

Combine models from IBM WebSphere Business Modeler with models from IBM WebSphere Integration Developer

developerWorks
Document options
PDF format - Fits A4 and Letter

PDF - Fits A4 and Letter
1368KB (27 pages)

Get Adobe® Reader®

Document options requiring JavaScript are not displayed

Sample code


Rate this page

Help us improve this content


Level: Intermediate

Curtis Miles (crmiles@ca.ibm.com), WebSphere Business Monitor Tools Lead Developer, IBM
Ann Ewan (ewan@ca.ibm.com), WebSphere Business Modeler Information Developer, IBM 

08 Apr 2008

In this series, learn about the dramatic changes in IBM® WebSphere® Business Monitor V6.1 — a major release that extends capability and simplifies how you monitor and manage the performance of your business. This article describes how you can connect two monitor models when one is a result of exporting business measures from IBM WebSphere Business Modeler and another is a monitor model from an IBM WebSphere Integration Developer module. Learn a two-tier approach that involves creating a high-level model in WebSphere Business Modeler by exporting the model to the WebSphere Business Monitor development toolkit, generating a monitor model from WebSphere Integration Developer, and creating outbound and inbound event definitions to communicate between the models.

Introduction

In this article, learn about options for integrating high-level and low-level models. Benefits, pitfalls, and considerations of each integration style are discussed. You'll follow a scenario as a developer uses the WebSphere Business Monitor model editor to integrate two monitor models: a high-level model created in WebSphere Business Modeler and a low-level model generated from the WebSphere Integration Developer application that implements the business process described in WebSphere Business Modeler.

You'll also learn how to:

  • Create an XML event definition.
  • Send an event based on that event definition from the low-level model.
  • Receive the event in the high-level model.
  • Update the metrics and KPIs in the high-level model with the information from the event.

The model editor is a component within the WebSphere Business Monitor development toolkit. The toolkit is packaged with WebSphere Business Monitor, but installs into WebSphere Integration Developer.

Because this article requires a model from WebSphere Business Modeler, it uses a scenario that's different from the others in this series. You can download the sample WebSphere Business Modeler project file and sample WebSphere Integration Developer project interchange file.

Figure 1 shows the events that are covered in this article.


Figure 1. Events linking high-level and low-level monitor models
Diagram showing the high-level and low-level monitor models linked by events

Integration options

When you create processes and business measures in WebSphere Business Modeler, you typically end up with two monitor models:

High-level model
The business-level monitor model that you exported from WebSphere Business Modeler and then imported into the model editor.
Low-level model
The IT-level monitor model that you generated from the WebSphere Process Server application that implements the business process designed in WebSphere Business Modeler.

To develop a monitoring solution that uses the information in both these models, you have the following options for integrating the models:

  1. Keep both monitor models and have them communicate through events.
  2. Keep only the high-level monitor model and update it with run time events.
  3. Keep only the low-level monitor model and update it with business measures.

This article discusses the pros and cons of each of option and takes you through a detailed scenario for using the first option, in which two monitor models communicate through events.

Option 1. High-level and low-level models communicate through events

With this option, you keep both monitor models and use them in the solution. The two monitor models communicate through custom events that are sent by the low-level model and received by the high-level model. This option is the most flexible and the most complicated.

Table 1 shows the pros and cons of this option.


Table 1. High-level and low-level models communicate through events
AdvantagesDisadvantages
Limits the impact of changes to either the business measures, or the underlying process implementation, by affecting only the low-level or high-level model.Requires authoring of event definitions to serve as communication vehicles between models.
Maintains the link between the low-level model and the run time application.Takes time to develop and can result in seemingly unnecessary steps for simple cases.
Supports comparing and merging to reconcile changes if you import a new version of the high-level model from WebSphere Business Modeler.
Supports deployment configurations where the low-level and high-level models are in a single project or in separate projects.

Implementation details of this option are described in the scenario, where two monitor models are created and set up to communicate through custom events emitted by the low-level model and received by the high-level model.

Option 2. High-level model is updated with run time events

With this option, you keep only the high-level monitor model and update it with run time events. It is most useful when the low-level application is stable but the business-measures requirements are changing. Use this option only when there are a small number of events of interest that carry the majority of the information required.

Add inbound events of interest directly to the high-level monitor model produced by WebSphere Business Modeler using New -> Create from Application. Then copy and paste each of the events from the generated monitoring context into the top-level monitoring context.

You might need to adjust the generated filter condition and correlation expressions for some of the copied events. Usually, you'll be able to keep the filter condition, which is designed to isolate the given event from all of the other events that are emitted by the WebSphere Process Server application. The correlation expression that is generated compares some or all of the ECSCurrentID, ECSParentID, and WBISESSION_ID values in the event to a key representing the module instance ID, process instance ID, activity instance ID, and so on.

If you've created a key in the high-level model that does not correspond to any of these pieces of information, for example by using an OrderID, you must modify the correlation expression of the copied event to compare the OrderID value in the monitoring context with the value contained in the event.

Table 2 shows the pros and cons of this option.


Table 2. High-level model is updated with run time events
AdvantagesDisadvantages
Removes the need to create and manage any communication events to transmit information between monitoring contexts.Removes the link between the monitor model and the application for the events that were copied and pasted. Refactoring changes in WebSphere Integration Developer can no longer be automatically applied. The synchronize-with-application feature can no longer be used to keep the models synchronized.
Results in a simple monitor model that is easily understood.Might require updating of the correlation predicate (and possibly filter condition) of the copied inbound event.
Supports comparing and merging to reconcile changes if you import a new version of the high-level model from WebSphere Business Modeler.

Option 3. Low-level model is updated with business measures

With this option, you keep only the low-level monitor model and update it with business measures. It is most useful when the business-measures requirements are stable, but the low-level application is changing. Use this option only when there are a small number of business measures to be monitored.

Copy the metrics, key performance indicators (KPIs), and anything in the dimensional model from the high-level model to the low-level model.

Specify tracking keys in the low-level model generated from WebSphere Integration Developer for any business measures whose values are to be imported into WebSphere Business Modeler to update simulation attributes. You write your own tracking keys in the model. For more information, see the product documentation Returning results using tracking keys.

Table 3 shows the pros and cons of this option.


Table 3. Low-level model is updated with business measures
AdvantagesDisadvantages
Removes the need to create and manage any communication events to transmit information between monitoring contexts.Does not support comparing and merging to reconcile changes if you import a new version of the high-level model from WebSphere Business Modeler.
Results in a simple monitor model that is easily understood.You cannot copy and paste the contents of the visual model from the high-level model to the low-level model. You can cut and paste the scalable vector graphics (SVG) files.
Maintains the link between the monitor model and the run time application, so you can still keep them synchronized using refactoring changes in WebSphere Integration Developer and the synchronize-with-application feature in the WebSphere Business Monitor model editor.

The rest of this article takes you through a scenario using Option 1. Two monitor models are created and set up to communicate through custom events that are emitted by the low-level model and received by the high-level model.

The scenario: KateWay Animal Park

Kate started KateWay Animal Park 10 years ago, and it has been a local success story. Recently it was written up in a national travel magazine as a "must see" for visitors to that part of the state. Besides wandering the park, visitors can pay at the gate to spend the afternoon at a show, such as "Think Like a Gorilla" and the more recent "Meet the Tigers." Much of the park's revenue comes from the shows. Last year, KateWay Animal Park added a Web site where customers can order tickets in advance, which has significantly boosted Kate's business.

Kate has been running local radio ads for years, but now, seeing how well the national publicity from the magazine worked, she's considering a television campaign. Kate hopes that the TV campaign will bring in more visitors and encourage more of them to attend a show. Ideally, she would like about 200 visitors a month to attend each show. Kate plans to run a one-month trial of the TV ads, from April 1 to April 30.

Kate has asked her business analyst, Brian, to track the impact of the TV campaign. She wants to know how many visitors buy tickets for each of the shows and which of the two shows they are more likely to attend. She would like to be able to monitor the results immediately, instead of having to wait for the monthly reports.

The high-level model

Brian, the business analyst, initially used WebSphere Business Modeler to create a model of the online ticket sales process, as shown in Figure 2.


Figure 2. Online ticket sales process
Online ticket sales           process

He used the TicketOrder business item, shown below, to pass information from task to task.


Figure 3. TicketOrder business item
TicketOrder business           item

Brian now adds business measures to the model so he'll be able to monitor the results in WebSphere Business Monitor. He right-clicks the Record order into database task and creates a predefined business measure based on the input of the TicketOrder business item. Specifically, he wants to capture the ShowID of any show that the customer purchased so he can determine which show it was. He names the new instance metric Purchased Show ID, as shown in Figure 4.


Figure 4. Defining the Purchased Show ID instance metric
Defining the Purchased           Show ID instance metric

Brian creates a KPI named Total Number of Visitors for "Think Like a Gorilla." He sets a target of 200 visitors per month, as shown in Figure 5, and adds a set of three ranges as a percentage of the 200-visitor target.


Figure 5. Defining a set of ranges
Defining a set of ranges

Brian then:

  • Specifies a fixed time period of one month (April 1, 2008 to April 30, 2008) to monitor the number of visitors who attend during the TV campaign.

  • Copies the KPI in the business-measures summary table and pastes it into the row below.

    He changes the name of the new KPI to Total Number of Visitors for "Meet the Tigers."

  • Adds another KPI named Total Number of Visitors.

    He leaves that KPI empty and does not specify any target or ranges.

  • Exports the preliminary monitor model, using the WebSphere Business Monitor development toolkit export.

Brian and Darcy, the integration developer who implemented the online process in WebSphere Integration Developer, discuss how to get Kate the information that she wants to see.

The low-level model

Darcy already has an application with a Web front end running on WebSphere Process Server. This application was created in WebSphere Integration Developer, and is based on the earlier model that Brian exported from WebSphere Business Modeler using the WebSphere Integration Developer export (before he added the business measures).

Darcy:

  • Right-clicks her existing KateWayAnimalPark module in WebSphere Integration Developer and selects Generate -> Monitor Model.
  • Names the new project KateWayAnimalParkMonitor.
  • Names the monitor model KateWayAnimalParkMonitor_LowLevel.

In the Generate Monitor Model wizard, Darcy:

  • Selects the main process (TicketSalesProcess).
  • Selects only the Record order into database activity, because Kate is interested only in finding out about show tickets and the number of visitors who buy them.
  • Clicks the Emitted Events tab, as shown in Figure 6, and selects the ENTRY and EXIT events, which are all she has to monitor to get the required information.


Figure 6. Selecting events in the Generate Monitor Model wizard
Screen capture of the Generate Monitor Model wizard with the Record order into database ENTRY and EXIT events selected

The elements shown in Figure 7 will be generated when Darcy finishes the wizard.


Figure 7. Preview of the monitor model in the Generate Monitor Model wizard
Screen capture of the Generate Monitor Model wizard with a preview of the monitor model that will be generated

A Record order into database monitoring context is created. It contains two inbound events: one that is received when the Record order into database task starts, and another that is received when the Record order into database task ends.

Two keys are created to deliver the inbound events to the correct monitoring context:

  • One based on the activity instance ID (because Darcy chose to monitor an activity in the process).
  • One based on the process instance ID.
A termination trigger, to end the monitoring context when the Record order into database task ends, is also created.

Integrating the models

After completing the low-level monitor model, Darcy copies the files that Brian exported from WebSphere Business Modeler (TicketSalesProcess.mm and two SVG files) and pastes them into her KateWayAnimalParkMonitor model project. She now has two monitor models in the project, as shown below.


Figure 8. High-level and low-level monitor models
Screen capture of the KatewayAnimalParkMonitor project in the Project Explorer, showing the two monitor models

To complete Brian's KPIs, Darcy goes into the high-level model and adds two more metrics: Number of Visitors and Ticket Date. She does not yet enter any expressions for the metrics, because that information will need to come from the low-level model.

Darcy decides that the two monitor models will communicate through custom events that are emitted by the low-level model and received by the high-level model.

To make this happen, Darcy needs to:

  1. Create an XML event definition for the models to share.
  2. Create an outbound event based on the event definition in the low-level model.
  3. Create an inbound event based on the event definition in the high-level model.
  4. Write expressions to set the values of the metrics and KPIs in the high-level model based on the elements and attributes in the event definition.

At run time:

  1. The low-level model will receive events emitted by the application as the Record order into database task executes.
  2. The low-level model will send an event each time the Record order into database task ends.
  3. The high-level model will receive the event sent by the low-level model.
  4. The metrics and KPIs in the high-level model will receive their values based on information in the event.

Creating the XML event definition for the models to share

First, Darcy creates the event definition for the custom event that will be passed from the low-level model to the high-level model. Because she is specifically creating an event definition to use for communication, she must keep in mind what the event definition should contain, how it should be described, and how to name it.

  • The event definition must contain:
    • Information that can be used to set and refer to the key value for the high-level monitor model. Choosing the key for the high-level model is an important decision; it defines the granularity of the high-level monitoring context. Generally, the key used in the high-level model should correspond to the key used in the low-level model. For example, if the low-level model has a key that represents process instances (there is a monitoring context instance for each process instance), the high-level model should also have a key that results in one monitoring context instance for each process instance.

      The keys need not use the same value. For example, if the lower-level model is using the process instance ID, the high-level model can use an order ID, as long as there is one process instance for each order ID. The high-level model does not need to be complicated with technical information (such as process and activity ID information) from the low-level model, as long as the keys have the same granularity.

    • Information that allows the high-level monitor model to distinguish the communication event from any other events that are received by the model. This information will be used to create the filter condition.

    • Any information that is required to calculate the metrics and KPIs defined in the high-level model.
  • The event definition must be described by an element declaration within the XML schema definition (XSD). This element declaration can then act as the data type for an event part in the inbound and outbound events.

  • The name of the event definition should describe its usage as a communication event.

Darcy clicks the Event Definitions folder in the Project Explorer and selects New -> Event Definition (XSD). In the XML schema editor, she names the new event definition TicketSalesEvent.xsd. To contain the required information, Darcy creates a new complex type called TicketSalesEventType for the data type definition, as shown in Figure 9.


Figure 9. TicketSalesEvent in the XML schema editor
Screen capture of TicketSalesEvent with the data type TicketSalesEventType in the XML Schema editor

Darcy knows that this element declaration can now act as the data type for an event part in the inbound and outbound events that she will create in the monitor models. She:

  1. Clicks the TicketSalesEventType type and completes the definition by adding elements. First, she adds the element that will be used to identify the event as a communication event, and calls it EventIdentifier.

    This element will have a constant value so that the high-level model will recognize the event as coming from the low-level model.

  2. Adds the ID that will be used to correlate the instances from the low-level model with monitoring context instances in the high-level model. She can use the TicketOrderNumber from the WebSphere Business Modeler business item to deliver the event from the low-level model to the correct instance of the high-level model.

  3. Adds all the information she wants to pass from the low-level to the high-level model: ShowID, ShowName, PurchaseDate, and NumberOfVisitors. See Figure 10.


Figure 10. TicketSalesEventType in the XML schema editor
Screen capture of TicketSalesEventType with its six elements in the XML Schema editor

Creating the outbound event in the low-level model

The low-level model must send an outbound event (to be received by the high-level model) when each ticket sales order finishes.

In the low-level model, Darcy creates a new outbound event and calls it TicketSalesOutboundEvent. She adds an event part called TicketSalesInfo. To specify the type of the event part, she clicks Select Type and chooses the element declaration (TicketSalesEvent) that she just created, as shown in Figure 11.


Figure 11. Selecting the TicketSalesEvent
Screen capture of selecting tns:TicketSalesEvent [tns:TicketSalesEventType] in the Select Event Part Data Type window

For convenience, she changes the namespace prefix from the default tns (for target namespace) to ticket.

When Darcy clicks Finish, the path attribute is completed for her because she described the structure of the event part by selecting the element declaration within the XSD file instead of directly selecting the complex type. Choosing the element declaration provides information about the structure of the event information (as would choosing the complex type). It also allows the WebSphere Business Monitor model editor to guess at the name and location of the element that will contain that information within the event.


Figure 12. Creating the event part for the outbound event
Screen capture of the event part, with the path shown as cbe:CommonBaseEvent/ticket:TicketSalesEvent

Darcy moves down to the Event Attributes Details table and clicks Add. She selects the TerminationTrigger event as the trigger, because she wants this event to be sent to the high-level model each time that a ticket sales process ends.

Darcy enters the information to be sent in the outbound event. For the EventIdentifier, she types in a fixed value that will be used in all communication events. She chooses TicketSalesCommunicationEvent.

For the TicketOrderNumber, Darcy presses Ctrl+Space for content assist and opens the inbound event called Record order into databaseEXIT that is generated each time the Record order into database process ends. From the Output, she selects the Ticket Order Number, as shown in Figure 13.


Figure 13. Using content assist to select the TicketOrderNumber attribute
Screen capture of the content assist window for TicketOrderNumber, showing the TicketOrderNumber attribute under Output highlighted.

Darcy enters the information for ShowID, ShowName, and PurchaseDate the same way.


Figure 14. Using content assist to select the AdmissionDate attribute
Screen capture of the content assist window for PurchaseDate, showing the AdmissionDate attribute highlighted

Finally, for the NumberOfVisitors field, Darcy adds the NumberOfAdults and NumberOfChildren attributes to come up with the total number of visitors.


Figure 15. Creating the expression to get the number of visitors
Screen capture of the Expression Dialog showing Record_order_into_databaseEXIT/Output/NumberOfAdults + Record_order_into_databaseEXIT/Output/NumberOfChildren

There are other ways to add the values. Darcy could have created metrics to temporarily hold the values, especially for performing any calculations.

Creating the inbound event in the high-level model

The high-level model needs an inbound event so that it can receive the outbound event from the low-level model. The inbound event must use the same data type as the outbound event.

In the high-level model, Darcy:

  1. Creates a new inbound event and calls it TicketSalesInboundEvent. She gives it one event part called TicketSalesInfo, and chooses the same data type (TicketSalesEvent) she chose for the outbound event. Again she changes the default prefix to ticket.

    Figure 16. Creating the event part for the inbound event


  2. Adds a filter condition so that only the correct type of event will be accepted as an inbound event. To achieve this, she creates a filter condition that references the piece of the event definition that is used to identify the event as a communication event. She called this piece of information the EventIdentifier when she created the event definition, and she gave it the fixed value of TicketSalesCommunicationEvent when it is sent from the high-level model.

    Figure 17. Adding the filter condition
    Screen capture of the filter condition TicketSalesInboundEvent/TicketSalesInfo/ticket:EventIdentifier = 'TicketSalesCommunicationEvent'

  3. Sets the inbound event to create a monitoring context when it arrives.

    Figure 18. Setting the event to create a new monitoring context
    Screen capture of 'If no instances are found' set to 'Create new instance'

  4. Adds a key to the high-level model for Ticket Order Number. This key is an integer type. The following shows the key value expression for the key.

    Figure 19. Adding the value expression for the key
    Screen capture of the key value expression TicketSalesInboundEvent/TicketSalesInfo/ticket:TicketOrderNumber for the Ticket Order Number key

  5. Adds a correlation condition to the inbound event, so that the inbound event creates a monitoring context in the high-level model that corresponds to the correct process instance in the low-level model. The correlation expression compares the value in the key to the value of the Ticket Order Number in the inbound event.

    Figure 20. Adding the correlation expression to the inbound event
    Screen capture of the correlation expression Ticket_Order_Number = TicketSalesInboundEvent/TicketSalesInfo/ticket:TicketOrderNumber

Setting the metrics and KPI values

Darcy can now write the expressions to set the values of the metrics and KPIs when an inbound event arrives.

The Purchased Show ID metric gets its information from the ShowID attribute in the TicketSalesInboundEvent.


Figure 21. Using content assist to select the ShowID attribute
Screen capture of the content assist window for Purchased Show ID metric, showing the ShowID attribute highlighted

Similarly, the

  • Show Purchased metric gets its information from the ShowName attribute.
  • Purchase Date metric gets its information from the PurchaseDate attribute.
  • Number of Visitors metric gets its information from the NumberOfVisitors attribute.

Because the three KPIs are calculated from the metrics, no further implementation is required.

Testing the monitor models

The next step is for Darcy to test the monitor models and verify that they are generating the information Kate wants to see.

Darcy right-clicks one of the monitor models in the Project Explorer view and clicks Generate Monitor J2EE Projects. She is shown the names that will be given to the three parts:

  • The Model Logic EJB project that contains the logic of the monitor model.
  • The Moderator EJB project that receives events from the business applications and routes them to the target monitor model.
  • The enterprise application (EAR) project that contains the two EJB projects.

Darcy does the same with the other monitor model. When she has generated projects for both monitor models, Darcy goes to the Server view, right-clicks her WebSphere Business Monitor server, and clicks Start.

After the server is started, Darcy:

  1. Right-clicks the server and selects Add and Remove Projects. The two enterprise application projects show up in the list of available projects. She clicks each of them, then selects Add.

    When she clicks Finish, the two projects are added to the server.

  2. Starts to create a dashboard that includes the metrics and KPIs that Kate wants to see. She clicks the server again and selects WebSphere Business Monitor Dashboard. She clicks Dashboards -> Manage -> New and adds a new dashboard called KateWayAnimalPark. She clicks Add to Dashboard and selects Instances. She clicks Personalize.

    On the Advanced tab, she selects the TicketSalesProcess model (the high-level monitor model) to monitor. On the Show/Hide tab, Darcy chooses to display all the metrics and clicks OK.



    Figure 22. Adding all metrics to the instances dashboard
    Screen capture of adding all metrics to the Instances dashboard in the Advanced tab

  3. Clicks Add to Dashboard again and selects KPIs. She clicks Personalize and selects the TicketSalesProcess (the high-level monitor model) from the list of models.

    On the layout tab she chooses to display the half-gauge view.

  4. Runs the WebSphere Process Server application within the test environment, using the module or component testing capabilities or the Business Process Choreographer explorer within WebSphere Application Developer, to test that the events are generated and passed correctly.

Finally, Darcy comes back to the dashboard to make sure that the KPIs and metrics are displaying correctly. It looks as if the new projects are ready to be put into production.

Conclusion

Darcy was able to integrate the low-level model generated from WebSphere Integration Developer with the high-level model that Brian developed in WebSphere Business Modeler. Kate is now able to view the results in the dashboards, which gives her the information she needs to evaluate the effectiveness of the TV ad campaign as it is running.

Kate is delighted with the spike in attendance that resulted from the TV ads, and has decided to continue the ad campaign.

Because she is getting such timely information from WebSphere Business Monitor, Kate can monitor the total number of visitors during the month and even adjust her marketing strategy mid-month based on a dramatic increase in attendance for "Meet the Tigers," which has already met its goal of 200 visitors that month.


Figure 23. KPI results
Screen capture of the final KPI results in the test dashboard

Kate decides to make her ad for "Meet the Gorillas" more like the "Meet the Tigers" ad. The whole campaign is very successful, and Kate is planning to create a new series of ads next year using Conan the Cat Man, the celebrity tiger-wrestler.




Back to top


Downloads

DescriptionNameSizeDownload method
Sample Modeler project fileKateWayAnimalPark.mar44KBHTTP
Sample WID project interchange fileKateWayAnimalPark_wid_complete_PI.zip154KBHTTP
Information about download methods


Resources

Learn

Get products and technologies
  • Download IBM product evaluation versions and get your hands on application development tools and middleware products from DB2®, Lotus®, Rational®, Tivoli®, and WebSphere®.


Discuss


About the authors

author photo

Curtis Miles currently leads the development effort for the business measures capabilities within IBM WebSphere Business Modeler as well as the Monitor model editor in the WebSphere Business Monitor Development Toolkit. He previously worked on many other aspects of WebSphere Business Modeler, including process simulation and transformation of Modeler processes to BPEL.


Ann Ewan

Ann Ewan is a senior information developer with the WebSphere Business Modeler team. She also documents the WebSphere Business Monitor Development Toolkit. Ann has 16 years of technical writing experience and is also a published author of fantasy novels.




Rate this page


Please take a moment to complete this form to help us better serve you.



 


 


Not
useful
Extremely
useful
 


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!



Back to top


IBM, the IBM logo, and WebSphere are registered trademarks of International Business Machines Corporation in the United States, other countries, or both. Other company, product, or service names may be trademarks or service marks of others.