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. The Common Base Event paradigm is deprecated in V8.5.5, although it can still be used to monitor processes that were developed in earlier versions.

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:
  • An ID that is used to refer to the event part within path expressions
  • A path that defines how to find, at run time, the content that the event part describes
  • A type that defines the structure of the content identified by the path

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.

In general, if an XML Schema Definition (XSD) used to define an event structure contains an <xsd:any> or <xsd:anyType> slot, you must 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 refer to either 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 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" rootElement="wbi:event" 
              extensionName="WAREHOUSE.MONITORING.EVENT" [...] >
  	<eventPart path="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" rootElement="wbi:event" 
              extensionName="BPC.BFM.ACTIVITY.MESSAGE" [...] >
  	<eventPart path="wbi:event" 
             type="wbi:Event" />
  	<eventPart path="wbi:event/wbi:eventPointData" 
             type="wbi:BPC.BFM.ACTIVITY.STATUS" 
             ="eventPointData" />
  	<eventPart path="wbi:event/wbi:applicationData/wbi:content[@name='customer']" 
             type="app:CustomerBO" 
             ="customer" />
  	<filter expression="..." />
  	<correlationPredicate expression="..." />
</inboundEvent>