Event annotations

The event XML annotations include an annotation to define a complex type as an event and another annotation to define the event timestamp.

Event annotation

The complex type for an event must be defined as a root element.

You must add the following annotation to the complex type that defines an event object.

<annotation>
 <appinfo source="http://www.ibm.com/ia/Annotation">
  <event/>
 </appinfo>
</annotation>
This annotation specifies the inheritance to the com.ibm.ia.model.Event interface.

Timestamp annotation

You must add the following annotation to the element that defines the timestamp of an event.

<annotation>
 <appinfo source="http://www.ibm.com/ia/Annotation">
  <timestamp/>
 </appinfo>
</annotation>
The timestamp annotation adds the BOM property ia.timestamp with the value true to the corresponding BOM attribute.
Note: The XSD file must contain an element declaration for each complex type that has an event annotation.

Example

The following example defines an event named CheckIn with a timestamp annotation that stores the time of the check-in.

<element name="check_in" type="tns:CheckIn"/>
<complexType name="CheckIn">
 <annotation>
  <appinfo source="http://www.ibm.com/ia/Annotation">
   <event/>
  </appinfo>
 </annotation>
  <sequence>
    <element name="CheckInTime" type="dateTime">
     <annotation>
      <appinfo source="http://www.ibm.com/ia/Annotation">
        <timestamp/>
      </appinfo>
     </annotation>
    </element>
  </sequence>
</complexType>