Defining event parts

An event part is an XML Schema Definition (XSD) type that provides information about the structure of part of an event. A single event definition can have different event parts that are defined by different XML schemas. Each event part describes how to identify and locate itself within the actual event received at run time.

About this task

The following example shows you the relationship between an event part and the event part path. The event part path defines how to find, at run time, the content that the event part describes.

Consider this event XML:

<wbe:monitor-event xmlns:wbe="http://www.ibm.com/xmlns/prod/websphere/businessEvents/6.1.0">
    <wbe:connector-info>
         <wbe:name>CreateAccount</wbe:name>
         <wbe:version>1.0</wbe:version>
         <wbe:system>SVT</wbe:system>
         <wbe:log-info>CC Account Creation Event</wbe:log-info>
    </wbe:connector-info>
</wbe:monitor-event>
If you define an event part with the ID connectorPart, the corresponding event part path is wbe:monitor-event/wbe:connector-info.
The resulting eventPart XML in the monitor model source view contains the following information:
<eventPart displayName="connectorPart" id="connectorPart"
path="wbe:monitor-event/wbe:connector-info" type="wbe:monitor-event"></eventPart>

Content Assist provides a tree of elements inside an event part path that can be used in the monitor model for metric values, metric calculations, trigger conditions, and so on. For example, if you use Content Assist for wbe:connector-info in the previous example, you see the version, system, and log-info information.

Procedure

To define an event part, complete the following steps:

  1. Click Add to add a new event part to the Event parts table.
  2. In the Create New Event Part window, type a name into the Name field. As you type the name, a default ID is created for you, although you can change it if you prefer.
  3. Click Select Type to specify the type for the event part. In the Select Event Part Type window, you can specify the event part as a global element declaration, or as an XML schema complex type or simple type. It is recommended that you choose the first option and select an element declaration, which allows the Monitor Model editor to infer a value to be used for the event part path attribute. (See Recommendations for creating XSD files for more details.) You have the following options:
    • Choose the type from the XML schemas accessible from this project. The type can be from an existing XSD or Web Services Description Language (WSDL) file (if it has an inline schema definition in the <wsdl:types> section) that is in the current project or in an associated project in the workspace. Expanding an XSD or a WSDL file in the window shows all global element declarations and all name types available in that file.
    • Choose from the list of predefined XML schema simple types. Click the radio button and select from the list.
    • Choose the type from the predefined set of standard XSD definitions in the XML catalog (for example, to select an event part type that would be created for a predefined event from a Process Server application). Click Browse to open a window that shows all the schemas registered in the catalog. Expanding a schema shows the element declarations and type definitions available in that schema.
    After you have selected a type, click OK.
  4. You can click Next to define a namespace to be used in the model, or click Finish to accept the default namespace and return to the Create New Event Part window.
  5. If you have chosen an element declaration, the path is completed for you. If not, you must type the path that defines how to find, at run time, the content that the event part describes.

    The path depends upon where the events are generated. For example, an event generated in IBM Business Process Manager starts with wbe:monitorEvent and uses an XPath expression to navigate to a specific location in the Business Process Manager event.

  6. If required, click Next and assign a prefix to the namespace for the selected type. If the prefix was already defined in the monitor model, click Next again to see a preview of all the expressions in the monitor model that will be updated to use the new prefix.
  7. Click Finish.

Results

The new event part is added to the table and also is displayed under the event in the model tree. An import statement referencing the location of the schema type is added to the XML source document, which is reflected in the table on the Event Model page. This table displays the import location for each file used in the monitor model.

Event parts are also shown under the inbound and outbound event in content assist.

What to do next

Click the event part in the model tree to open an editor for the event part, where you can view the details and add a description.