IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing monitor models > What are monitor models? > Monitor details models > Inbound events

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. All the event parts, together with the Common Base Event definition if one is provided, describe the structure of the entire event.

Each event part describes how to identify and locate itself within the actual event received at run time. An event part has the following key pieces of information:

The ID for an event part provides a shortcut for accessing a particular event part within the event definition. Instead of writing a full path expression to locate the event part, for example, for a filter expression, you can simply write an expression such as MyInboundEvent\myEventPart\myDataInsideEventPart.

The path is an XML Path Language (XPath) expression that identifies the location in the event definition of the structure defined by the event part type. The expression is based on the structure of the actual event instance to be received at run time. It always starts with cbe:CommonBaseEvent and navigates into content that is placed in the xs:any slot of the Common Base Event. The event parts that you want to define will typicallly be from the wbi:applicationData section, when it exists, because that is the section that contains the business information. In general, if an XML Schema Definition (XSD) used to define an event structure contains an <xsd:any> or <xsd:anyType> slot, use an event part to specify the actual structure of the content that will fill that slot at run time. In the case of events from Process Server, the section contains elements (specifically the <wbi:value> element) with type <xsd:anyType>, so an event part must be used to define its actual structure.

The type is a QName that can either refer to an XSD complex or simple type, or to an XSD global element declaration. When the type refers to an XSD type, it indicates that the event definition will include content with the structure defined by that type at the location in the event identified by the path. When the type refers to an XSD global element declaration, it similarly prescribes the structure of the information in the event, but that structure is defined by the type associated with the element. The ability to reference an element declaration as an event part type is particularly useful when an XML Schema document contains a global element declaration with an anonymous type. Because the event part type can refer to the element declaration, the structure of an event can still be prescribed even though the anonymous type cannot be externally referenced.

For an outbound event, you will typically create a schema (the XSD) for the information that you want to communicate, and then create a single event part that references that schema. For inbound events, you might require several event parts based on the definition of the incoming event.

The following example shows an event part in an inbound event for a generic XSD-based event definition:

<inboundEvent id="depositWarehouseItem" type="cbe:CommonBaseEventType" 
              extensionName="WAREHOUSE.MONITORING.EVENT" [...] >
  	<eventPart path="CommonBaseEvent/app:transaction"
             type="app:WarehouseTxn" />
  <filter expression="..." />
  <correlationPredicate expression="..." />
</inboundEvent>

The following example shows event parts in an inbound event for a Business Process Execution Language (BPEL) event that carries business payload. The event parts are used to define the actual structure of the information that will be communicated in the <anyType> and <any> slots of the wbi:Event complexType:

<inboundEvent id="myActivityStarted" type="cbe:CommonBaseEventType" 
              extensionName="BPC.BFM.ACTIVITY.MESSAGE" [...] >
  	<eventPart path="CommonBaseEvent/wbi:event" 
             type="wbi:Event" />
  	<eventPart path="CommonBaseEvent/wbi:event/wbi:eventPointData" 
             type="wbi:BPC.BFM.ACTIVITY.STATUS" 
             ="eventPointData" />
  	<eventPart path="CommonBaseEvent/wbi:event/wbi:applicationData/wbi:content[@name='customer']" 
             type="app:CustomerBO" 
             ="customer" />
  	<filter expression="..." />
  	<correlationPredicate expression="..." />
</inboundEvent>