Streams and Relations Transmitting Events in the EPN: Stream and Relation Sources and Sinks

1-8 Oracle Complex Event Processing Developers Guide com.bea.wlevs.ede.api.RelationSource The RelationSource interface has one method, setEventSender; at runtime the event source component is injected with a com.bea.wlevs.ede.api.RelationSender instance. The RelationSender instance, in turn, has sendUpdateEvent and sendDeleteEvent methods that the component invokes to actually send events to the next component in the EPN. When you configure a channel as a relation, the channel attribute primary-key determines event identity. For more information, see Section 9.1.2.2, Channels as Relations . For sendDeleteEvent, you must send an instance of the same event type as that configured for the channel. For sendInsertEvent, a unique constraint violation exception will be raised and the input event discarded if an event with the same primary key is already in the relation. For sendUpdateEvent, an invalid update tuple exception will be raised and the input event discarded if an event with the given primary key is not in the relation. If you enable batching on a channel you configure as a relation, then components that send events to that channel must implement the com.bea.wlevs.ede.api.BatchRelationSender interface. The BatchRelationSender interface has a sendEvents method that the component invokes to send a batch of events of type insert, update, and delete downstream to a BatchRelationSink. For more information, see Section 9.1.6, Batch Processing Channels .

1.1.3.3 Stream and Relation Sinks

All components that consume events must implement one of the following interfaces: ■ com.bea.wlevs.ede.api.StreamSink ■ com.bea.wlevs.ede.api.RelationSink com.bea.wlevs.ede.api.StreamSink The StreamSink interface has a single callback method, onInsertEvent, that components implement to receive a list of events from the previous component in the EPN. If you enable batching on a channel, then components that receive events from that channel must implement the com.bea.wlevs.ede.api.BatchStreamSink interface. The BatchStreamSink interface has an onInsertEvents call-back method for receiving a batch of events of type insert. Events of type insert are used to model streams, as streams are append-only. In the case of single event, call-back method of StreamSink will be invoked. For more information, see Section 9.1.6, Batch Processing Channels . com.bea.wlevs.ede.api.RelationSink The RelationSink interface extends StreamSink to model an Oracle CQL relation sink. The RelationSink interface also provides an onDeleteEvent and onUpdateEvent methods. If you enable batching on a channel you configure as a relation, then components that receive events from that channel must implement the com.bea.wlevs.ede.api.BatchRelationSink interface. The BatchRelationSink interface has an onEvents call-back method for receiving a