Event types
Event types are typically defined by some kind of schema.   
In many of the current languages event schema is defined in a similar way to database relations.

This can be represented as a tree structure like in Apama:

apama_eventtype.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

In this example we see a rule structure of some of the event types in the FFD example. This shows the event type name and payload for each event.  For more information refer to the Apama FFD example .

 

Another example similar to database relation is CCL.

CREATE SCHEMA AssignmentSchema (
  RequestID INTEGER,
  Store STRING,
  Driver STRING,
  DeliveryLatitude FLOAT,
  DeliveryLongitude FLOAT,
  RequiredPickUpTime  TIMESTAMP,
  RequiredDeliveryTime TIMESTAMP
);

CREATE OUTPUT STREAM Assignment SCHEMA AssignmentSchema;
CREATE INPUT STREAM ManualAssignment_s SCHEMA AssignmentSchema;


This is an event type definition in CCL.  The event payload is being defined as SQL schema, where there are two streams: INPUT STREAM for manual assignments which represent raw events, and OUTPUT STREAM for automatic assignments represent derived events, both of them mapped to the same schema. For more details refer to the CCL FFD example .



Rulecore provides event types definitions as XML document, as noted below:

<EventDef eventType="DeliveryRequest">
  <Description>Event: DeliveryRequest</Description>
  <Properties>
    <Property name="RequestId">
      <base:XPath>string(base:EventBody/user:RequestId)</base:XPath>
    </Property>
    <Property name="Store">
      <base:XPath>string(base:EventBody/user:Store)</base:XPath>
    </Property>
    <Property name="Driver">
      <base:XPath>string(base:EventBody/user:Driver)</base:XPath>
    </Property>
<Property name="AddresseeLocation">          <base:XPath>string(base:EventBody/user:AddresseeLocation)</base:XPath>
   </Property>
<Property name="RequiredPickupTime">      <base:XPath>string(base:EventBody/user:RequiredPickupTime)</base:XPath>
    </Property>
<Property name="RequiredDeliveryTime">     <base:XPath>string(base:EventBody/user:RequiredDeliveryTime)
</base:XPath>
<Property name="MinimumRanking">     <base:XPath>string(base:EventBody/user:MinimumRanking)
</base:XPath>
    </Property>
  </Properties>
</EventDef>



In ruleCore an event instance is modeled as an XML document, and has a fixed set of header attributes common to all event types. The payload part of the event type is defined using a sequence of XML elements (the Property elements). Each Property element gives the name of the attribute, and an XPath expression that shows where the attribute can be found in the event document. This means that the event instance can have a complex structure, but the attributes can be given simple names.  For more information refer to the ruleCore FFD example .