EventData messages overview
EC can act as a subscriber application and will receive EventData
messages through the MECEventHubSubscriber channel.
The EventData
message will be in an XML format
using this schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="2.0">
<xsd:element name="EventData" type="EventDataType"/>
<xsd:complexType name="EventDataType">
<xsd:sequence>
<xsd:element ref="Publisher"/>
<xsd:element ref="DocumentName"/>
<xsd:element ref="Operation"/>
<xsd:element ref="TrackingId"/>
<xsd:element ref="SentTimestamp"/>
<xsd:element name="Document" type="DocumentType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="DocumentType">
<xsd:sequence>
<xsd:element name="ElementData" type="ElementDataType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ElementDataType">
<xsd:sequence>
<xsd:element ref="Name"/>
<xsd:element ref="Value" minOccurs="0"/>
<xsd:element ref="OldValue" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="Publisher" type="xsd:string"/>
<xsd:element name="DocumentName" type="xsd:string"/>
<xsd:element name="Operation" type="xsd:string"/>
<xsd:element name="TrackingId" type="UUID"/>
<xsd:element name="SentTimestamp" type="xsd:dateTime"/>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="Value" type="xsd:string"/>
<xsd:element name="OldValue" type="xsd:string"/>
<xsd:simpleType name="UUID">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
Notice that you will have a problem distinguishing the value from the ElementData
element because the node/element is unbounded, for example, /EventData/Document/ElementData/Name
.
For EC to be able to differentiate or detect elements on their ordered sequence, specify the two XPath predicates below as XML targets. Predicates are used to find a specific node or a node that contains a specific value. Predicates are always embedded in square brackets.
This table shows a list of path expressions with predicates, and corresponding result. This applies only to XPath options of all XML targets.
Path Expression | Result |
---|---|
/bookstore/book[1]
|
Selects the first book element that is the child of the bookstore element. |
/bookstore/book[last()]
|
Selects the last book element that is the child of the bookstore element. |
ElementData
element is fixed per document name. Check the
publisher implementation for the correct element sequence.