How to Configure an EPL Processor Manually

11-6 Oracle Complex Event Processing Developers Guide ■ Section 12.10, Accessing a Cache From an EPL User-Defined Function ■ Section 12.6, Accessing a Cache From an EPL Statement

11.4 Example EPL Processor Configuration Files

This section provides example Oracle CQL processor configuration files, including: ■ Section 11.4.1, EPL Processor Component Configuration File ■ Section 11.4.2, EPL Processor EPN Assembly File

11.4.1 EPL Processor Component Configuration File

The following example shows how to configure one of the sample EPL queries shown in Section 11.2, Configuring an EPL Processor for the myProcessor EPL processor: ?xml version=1.0 encoding=UTF-8? n1:config xmlns:n1=http:www.bea.comnswlevsconfigapplication xmlns:xsi=http:www.w3.org2001XMLSchema-instance processor namemyProcessorname rules rule id=myRule[CDATA[ SELECT symbol, AVGprice FROM SELECT FROM MarketTrade WHERE blockSize 10 RETAIN 100 EVENTS PARTITION BY symbol WITH LARGEST price GROUP BY symbol HAVING AVGprice = 100 ORDER BY symbol ]]rule rules processor n1:config In the example, the name element specifies that the processor for which the single EPL rule is being configured is called myProcessor. This in turn implies that the EPN assembly file that defines your application must include a corresponding wlevs:processor id=myProcessor provider=epl element to link these EPL rules with an actual myProcessor EPL processor instance see Section 11.4.2, EPL Processor EPN Assembly File .

11.4.2 EPL Processor EPN Assembly File

The following example shows an EPN assembly file for an EPL processor. ?xml version=1.0 encoding=UTF-8? beans xmlns=http:www.springframework.orgschemabeans xmlns:xsi=http:www.w3.org2001XMLSchema-instance xmlns:osgi=http:www.springframework.orgschemaosgi xmlns:wlevs=http:www.bea.comnswlevsspring xsi:schemaLocation= http:www.springframework.orgschemabeans http:www.springframework.orgschemabeansspring-beans.xsd http:www.springframework.orgschemaosgi http:www.springframework.orgschemaosgispring-osgi.xsd http:www.bea.comnswlevsspring http:www.bea.comnswlevsspringspring-wlevs-v11_1_1_3.xsd wlevs:event-type-repository wlevs:event-type type-name=HelloWorldEvent wlevs:classcom.bea.wlevs.event.example.helloworld.HelloWorldEventwlevs:class wlevs:event-type wlevs:event-type-repository Configuring EPL Processors 11-7 wlevs:adapter id=helloworldAdapter class=com.bea.wlevs.adapter.example.helloworld.HelloWorldAdapter wlevs:instance-property name=message value=HelloWorld - the current time is: wlevs:adapter wlevs:channel id=helloworldInputChannel event-type=HelloWorldEvent wlevs:listener ref=helloworldProcessor wlevs:source ref=helloworldAdapter wlevs:channel wlevs:processor id=helloworldProcessor provider=epl wlevs:channel id=helloworldOutputChannel event-type=HelloWorldEvent advertise=true wlevs:listener bean class=com.bea.wlevs.example.helloworld.HelloWorldBean wlevs:listener wlevs:source ref=helloworldProcessor wlevs:channel beans 11-8 Oracle Complex Event Processing Developers Guide