Implementing a Custom Event Bean as an Event Sink

15-8 Oracle Complex Event Processing Developers Guide 15.4.1 How to Configure a Custom Event Bean Manually The following procedure describes how to configure a custom event bean manually. To configure the custom event bean component configuration file: 1. Create an XML file using your favorite XML editor. You can name this XML file anything you want, provided it ends with the .xml extension. The root element of the configuration file is config, with namespace definitions shown in the next step. 2. For each event bean in your application, add an event-bean child element of config. Uniquely identify each custom event bean with the name child element. This name must be the same as the value of the id attribute in the wlevs:event-bean element of the EPN assembly file that defines the event processing network of your application. This is how Oracle CEP knows to which particular custom event bean component in the EPN assembly file this adapter configuration applies. See Section 4.3, Creating EPN Assembly Files for details. For example, if your application has two custom event beans, the configuration file might initially look like this: ?xml version=1.0 encoding=UTF-8? helloworld:config xmlns:helloworld=http:www.bea.comxmlnswlevsexamplehelloworld processor ... processor event-bean namefirstEventBeanname ... event-bean event-bean namefirstEventBeanname ... event-bean helloworld:config In the example, the configuration file includes two custom event beans called firstEventBean and secondEventBean. This means that the EPN assembly file must include at least two custom event bean registrations with the same identifiers: wlevs:event-bean id=firstEventBean ... ... wlevs:event-bean wlevs:event-bean id=secondEventBean ... ... wlevs:event-bean Caution: Identifiers and names in XML files are case sensitive, so be sure you specify the same case when referencing the components identifier in the EPN assembly file. Configuring Custom Event Beans 15-9

15.4.1.1 Example of a Custom Event Bean Configuration File

The following sample XML file shows how to configure two custom event beans, firstEventBean and secondEventBean. ?xml version=1.0 encoding=UTF-8? sample:config xmlns:sample=http:www.bea.comxmlnswlevsexamplesample event-bean namefirstEventBeanname ... event-bean event-bean namefirstEventBeanname ... event-bean sample:config 15-10 Oracle Complex Event Processing Developers Guide