C Schema Reference: EPN Assembly spring-wlevs-v11_1_1_3.xsd

This appendix describes the elements of the spring-wlevs-v11_1_1_3.xsd schema.

For more information, see:

C.1 Overview of the Oracle CEP Application Assembly Elements

Oracle CEP provides a number of application assembly elements that you use in the EPN assembly file of your application to register event types, declare the components of the event processing network and specify how they are linked together. The EPN assembly file is an extension of the standard Spring context file.

C.1.2 Example of an EPN Assembly File That Uses Oracle CEP Elements

The following sample EPN assembly file from the HelloWorld application shows how to use many of the Oracle CEP elements:

<?xwml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:osgi="http://www.springframework.org/schema/osgi"
       xmlns:wlevs="http://www.bea.com/ns/wlevs/spring"
       xsi:schemaLocation="
  http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/osgi
  http://www.springframework.org/schema/osgi/spring-osgi.xsd
  http://www.bea.com/ns/wlevs/spring
  http://www.bea.com/ns/wlevs/spring/spring-wlevs-v11_1_1_3.xsd">
    <wlevs:event-type-repository>
        <wlevs:event-type type-name="HelloWorldEvent">
            <wlevs:class>com.bea.wlevs.event.example.helloworld.HelloWorldEvent</wlevs:class>
        </wlevs:event-type>
    </wlevs:event-type-repository>
    <wlevs:adapter id="helloworldAdapter" 
                    class="com.bea.wlevs.adapter.example.helloworld.HelloWorldAdapter" >
        <wlevs:instance-property name="message" 
                                  value="HelloWorld - the currenttime is:"/>
    </wlevs:adapter>
    <wlevs:processor id="helloworldProcessor" />
    <wlevs:channel id="helloworldInstream" >
        <wlevs:listener ref="helloworldProcessor"/>
        <wlevs:source ref="helloworldAdapter"/>
    </wlevs:channel>
    <wlevs:channel id="helloworldOutstream" advertise="true">
        <wlevs:listener>
            <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
        </wlevs:listener>
        <wlevs:source ref="helloworldProcessor"/>
    </wlevs:channel>
</beans>

C.2 wlevs:adapter

Use this element to declare an adapter component to the Spring application context.

C.2.1 Child Elements

The wlevs:adapter application assembly element supports the following child elements:

C.2.2 Attributes

Table C-1 lists the attributes of the wlevs:adapter application assembly element.

Table C-1 Attributes of the wlevs:adapter Application Assembly Element

Attribute Description Data Type Required?

id

Unique identifier for this component.

This identifier must correspond to the <name> element in the XML configuration file for this adapter, if one exists.

String

Yes.

advertise

Advertises this service in the OSGi registry.

Valid values are true and false. Default value is false.

Boolean

No.

listeners

Specifies the components that listen to this component.

Set this attribute to the value of the id attribute of the element that declared the component.

String

No.

provider

Specifies the adapter service provider. Typically the value of this attribute is a reference to the OSGi-registered adapter factory service.

If you are using the csvgen or loadgen utilities to simulate a data feed, use the hard-coded csvgen or loadgen values, respectively, such as:

provider="csvgen"

If you are using one of the built-in HTTP publish-subscribe adapters, then specify the following hard-coded values:

  • For the built-in pub-sub adapter used for publishing, specify the hard-coded httppub value, such as:

    provider="httppub"
    
  • For the built-in pub-sub adapter used for subscribing, specify the hard-coded httpsub value, such as:

    provider="httpsub"
    

If you are using a JMS adapter, then specify one of the following hard-coded values:

  • For the inbound JMS adapter, specify the jms-inbound value, such as:

    provider="jms-inbound"
    
  • For the outbound JMS adapter, specify the jms-outbound value, such as:

    provider="jms-outbound"
    

You must specify either the provider or class attribute, but not both, otherwise an exception is raised.

String

No.

class

Specifies the Java class that implements this adapter.

You must specify either the provider or class attribute, but not both, otherwise an exception is raised.

String

No

onevent-method

Specifies the method of the adapter implementation that corresponds to the lifecycle onEvent method.

Oracle CEP invokes this method when the adapter receives an event.

String

No

init-method

Specifies the method of the adapter implementation that corresponds to the lifecycle init method.

Oracle CEP invokes this method after it has set all the supplied instance properties. This method allows the adapter instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

String

No

activate-method

Specifies the method of the adapter implementation that corresponds to the lifecycle activate method.

Oracle CEP invokes this method after the dynamic configuration of the adapter has completed. This method allows the adapter instance to perform initialization only possible when all dynamic bean properties have been set and the EPN has been wired.

String

No

suspend-method

Specifies the method of the adapter implementation that corresponds to the lifecycle suspend method.

Oracle CEP invokes this method when the application is suspended.

String

No

destroy-method

Specifies the method of the adapter implementation that corresponds to the lifecycle destroy method.

Oracle CEP invokes this method when the application is stopped.

String

No


C.2.3 Example

The following example shows how to use the wlevs:adapter element in the EPN assembly file:

<wlevs:adapter id="helloworldAdapter" provider="hellomsgs">
    <wlevs:instance-property name="message" 
                             value="HelloWorld - the current time is:"/>
</wlevs:adapter>

In the example, the adapter's unique identifier is helloworldAdapter. The provider is an OSGi service, also registered in the EPN assembly file, whose reference is hellomsgs. The adapter has a static property called message, which implies that the adapter Java file has a setMessage method.

C.3 wlevs:application-timestamped

Use this element to specify if an wlevs:channel is application timestamped, that is, if the application is responsible for assigning a timestamp to each event, using any time domain.

Otherwise, wlevs:channel is system timestamped, that is, the Oracle CEP server is responsible for assigning a timestamp to each event using System.nanoTime.

C.3.1 Child Elements

The wlevs:application-timestamped application assembly element supports the following child elements.

  • wlevs:expression—Specifies an expression to be used as an application timestamp for event processing.

C.3.2 Attributes

Table C-2 lists the attributes of the wlevs:application-timestamped application assembly element.

Table C-2 Attributes of the wlevs:application-timestamped Application Assembly Element

Attribute Description Data Type Required?

is-total-order

Indicates if the application time published is always strictly greater than the last value used.

Valid values are true or false. Default: false.

For more information, see "Time" in the Oracle Complex Event Processing CQL Language Reference.

Boolean

No.


C.3.3 Example

The following example shows how to use the wlevs:application-timestamped element in the EPN assembly file to specify an implicitly application timestamped channel:

<wlevs:channel id="fxMarketAmerOut" >
    <wlevs:application-timestamped>
    </wlevs:application-timestamped>
</wlevs:channel>

In the example, the application handles event timestamps internally.

The following example shows how to use wlevs:application-timestamped element in the EPN assembly file to specify an explicitly application timestamped channel by specifying the wlevs:expression element.

<wlevs:channel id="fxMarketAmerOut" >
    <wlevs:application-timestamped>
        <wlevs:expression>mytime+10</wlevs:expression>
    </wlevs:application-timestamped>
</wlevs:channel>

In the example, the wlevs:expression element defines the arithmetic expression used to assign a timestamp to each event.

C.4 wlevs:cache

Use this element to declare a cache to the Spring application context.

C.4.1 Child Elements

The wlevs:cache application assembly element supports the following child elements.

  • wlevs:caching-system—Specifies the caching system to which this cache belongs.

    Note:

    This child element is different from the wlevs:caching-system element used to declare a caching system. The child element of the wlevs:cache element takes a single attribute, ref, that references the id attribute of a declared caching system.
  • wlevs:cache-loader—Specifies the cache loader for this cache.

  • wlevs:cache-store—Specifies a cache store for this cache.

  • wlevs:cache-listener—Specifies a listener for this cache, or a component to which the cache sends events.

C.4.2 Attributes

Table C-3 lists the attributes of the wlevs:cache application assembly element.

Table C-3 Attributes of the wlevs:cache Application Assembly Element

Attribute Description Data Type Required?

id

Unique identifier for this component.

This identifier must correspond to the <name> element in the XML configuration file for this cache.

String

Yes.

name

Specifies an alternate name for this cache. If not specified, then the name of the cache is the same as its id attribute.

String

No.

key-properties

Specifies a comma-separated list of names of the properties that together form the unique key value for the objects in the cache, or cache key. A cache key may be composed of a single property or multiple properties. When you configure a cache as a listener in an event processing network, Oracle CEP inserts events that reach the cache using the unique key value as a key.

If you specify a key class using the key-class attribute, then this attribute is optional. If you specify neither key-properties nor key-class, then Oracle CEP uses the event object itself as both the key and value when it inserts the event object into the cache.

String

No.

key-class

Specifies the name of the Java class used for the cache key when the key is a composite key.

If you do not specify the key-properties attribute, then all properties on the key-class are assumed to be key properties. If you specify neither key-properties nor key-class, then Oracle CEP uses the event object itself as both the key and value when it inserts the event object into the cache

String

No.

value-type

Specifies the type for the values contained in the cache. Must be a valid type name in the event type repository.

This attribute is required only if the cache is referenced in an Oracle CQL or EPL query. This is because the query processor needs to know the type of events in the cache.

String

No.

caching-system

Specifies the caching system in which this cache is contained.

The value of this attribute corresponds to the id attribute of the appropriate wlevs:caching-system element.

String

Yes.

advertise

Advertises this service in the OSGi registry.

Valid values are true and false. Default value is false.

Boolean

No.


C.4.3 Example

The following example shows how to use the wlevs:cache element in the EPN assembly file:

<wlevs:cache id="cache-id" name="alternative-cache-name">
        <wlevs:caching-system ref="caching-system-id"/>
        <wlevs:cache-listener ref="tradeListener" />
</wlevs:cache>

In the example, the cache's unique identifier is cache-id and its alternate name is alternative-cache-name. The caching system to which the cache belongs has an id of caching-system-id. The cache has a listener to which the cache sends events; the component that listens to it has an id of tradeListener.

C.5 wlevs:cache-listener

Use this element to specify a cache as a source of events to the listening component. The listening component must implement the com.bea.cache.jcache.CacheListener interface.

This element is always a child of wlevs:cache.

C.5.1 Attributes

Table C-4 lists the attributes of the wlevs:cache-listener application assembly element.

Table C-4 Attributes of the wlevs:cache-listener Application Assembly Element

Attribute Description Data Type Required?

ref

Specifies the component that listens to this cache.

Set this attribute to the value of the id attribute of the listening component. The listening component can be an adapter or a Spring bean.

String

No.


C.5.2 Example

The following example shows how to use the wlevs:cache-listener element in the EPN assembly file:

    <wlevs:caching-system id="caching-system-id"/>
    ...
    <wlevs:cache id="cache-id" name="alternative-cache-name">
        <wlevs:caching-system ref="caching-system-id"/>
        <wlevs:cache-listener ref="cache-listener-id" />
    </wlevs:cache>
    ...
    <bean id="cache-listener-id" class="wlevs.example.MyCacheListener"/>

In the example, the cache-listener-id Spring bean listens to events coming from the cache; the class that implements this component, wlevs.example.MyCacheListener, must implement the com.bea.jcache.CacheListener interface. You must program the wlevs.example.MyCacheListener class yourself.

C.6 wlevs:cache-loader

Specifies the Spring bean that implements an object that loads data into a cache.

This element is always a child of wlevs:cache.

C.6.1 Attributes

Table C-5 lists the attributes of the wlevs:cache-loader application assembly element.

Table C-5 Attributes of the wlevs:cache-loader Application Assembly Element

Attribute Description Data Type Required?

ref

Specifies the Spring bean that implements the class that loads data into the cache.

Set this attribute to the value of the id attribute of the Spring bean.

The Spring bean must implement the com.bea.cache.jcache.CacheLoader interface.

String

Yes.


C.6.2 Example

The following example shows how to use the wlevs:cache-loader element in the EPN assembly file:

    <wlevs:cache id="cache-id" name="alternative-cache-name">
        <wlevs:caching-system ref="caching-system-id"/>
        <wlevs:cache-loader ref="cache-loader-id" />
    </wlevs:cache>
    ...
   <bean id="cache-loader-id" class="wlevs.example.MyCacheLoader"/>

In the example, the cache-loader-id Spring bean, implemented with the wlevs.example.MyCacheLoader class that in turn implements the com.bea.cache.jcache.CacheLoader interface, is a bean that loads data into a cache. The cache specifies this loader by pointing to it with the ref attribute of the wlevs:cache-loader child element.

C.7 wlevs:cache-source

Specifies a cache that supplies data to this processor component. The processor component in turn is associated with an Oracle CQL or EPL query that directly references the cache.

Use the value-type attribute of the wlevs:cache element to declare the event type of the data supplied by the cache.

This element is a child of only wlevs:processor element.

C.7.1 Attributes

Table C-6 lists the attributes of the wlevs:cache-source application assembly element.

Table C-6 Attributes of the wlevs:cache-source Application Assembly Element

Attribute Description Data Type Required?

ref

Specifies the cache that is a source of data for the processor component.

Set this attribute to the value of the id attribute of the cache.

String

Yes.


C.7.2 Example

The following example shows how to use the wlevs:cache-source element in the EPN assembly file:

<wlevs:caching-system id="caching-system-id"/>
  ...
  <wlevs:cache id="cache-id" 
               name="alternative-cache-name"
               value-type="Company">
    <wlevs:caching-system ref="caching-system-id"/>
  </wlevs:cache>
  <wlevs:channel id="stream-id"/>
  <wlevs:processor id="processor-id">
    <wlevs:cache-source ref="cache-id">
    <wlevs:source ref="stream-id">
  </wlevs:processor>

In the example, the processor will have data pushed to it from the stream-id channel as usual; however, the Oracle CQL or EPL queries that execute in the processor can also pull data from the cache-id cache. When the query processor matches an event type in the FROM clause to an event type supplied by a cache, such as Company, the processor pulls instances of that event type from the cache.

C.8 wlevs:cache-store

Specifies the Spring bean that implements a custom store that is responsible for writing data from the cache to a backing store, such as a table in a database.

This element is always a child of wlevs:cache.

C.8.1 Attributes

Table C-7 lists the attributes of the wlevs:cache-store application assembly element.

Table C-7 Attributes of the wlevs:cache-store Application Assembly Element

Attribute Description Data Type Required?

ref

Specifies the Spring bean that implements the custom store.

Set this attribute to the value of the id attribute of the Spring bean.

The Spring bean must implement the com.bea.cache.jcache.CacheStore interface.

String

Yes.


C.8.2 Example

The following example shows how to use the wlevs:cache-store element in the EPN assembly file:

    <wlevs:cache id="cache-id" name="alternative-cache-name">
        <wlevs:caching-system ref="caching-system-id"/>
        <wlevs:cache-store ref="cache-store-id" />
    </wlevs:cache>
    ...
   <bean id="cache-store-id" class="wlevs.example.MyCacheStore"/>

In the example, the cache-store-id Spring bean, implemented with the wlevs.example.MyCacheStore class that in turn implements the com.bea.cache.jcache.CacheStore interface, is a bean for the custom store, such as a database. The cache specifies this store by pointing to it with the ref attribute of the wlevs:cache-store child element.

C.9 wlevs:caching-system

Specifies the caching system used by the application.

C.9.1 Child Elements

The wlevs:caching-system application assembly element supports the following child element:

C.9.2 Attributes

Table C-8 lists the attributes of the wlevs:caching-system application assembly element.

Table C-8 Attributes of the wlevs:caching-system Application Assembly Element

Attribute Description Data Type Required?

id

Specifies the unique identifier for this caching system.

This identifier must correspond to the <name> element in the XML configuration file for this caching system

String

Yes.

advertise

Advertises this service in the OSGi registry.

Valid values are true and false. Default value is false.

Boolean

No.

provider

Specifies the provider of the caching system if you are using a third-party implementation, such as Oracle Coherence:

<wlevs:caching-system id="myCachingSystem" provider=coherence" />

Typically this attribute corresponds to the provider-name attribute of a <factory> Spring element that specifies the factory class that creates instances of the third-party caching system.

If you do not specify the provider or class attribute, then the default value is the Oracle CEP native caching implementation for local single-JVM caches; this implementation uses an in-memory store.

String

No.

class

Specifies the Java class that implements this caching system; use this attribute to specify a third-party implementation rather than the Oracle CEP native caching implementation.

If you specify this attribute, it is assumed that the third-party implementation code resides inside the Oracle CEP application bundle itself. The class file to which this attribute points must implement the com.bea.wlevs.cache.api.CachingSystem interface.

If you do not specify the provider or class attribute, then the default value is the Oracle CEP native caching implementation for local single-JVM caches; this implementation uses an in-memory store.

String

No


C.9.3 Example

The following example shows the simplest use of the wlevs:caching-system element in the EPN assembly file:

  <wlevs:caching-system id="caching-system-id"/>

The following example shows how to specify a third-party implementation that uses a factory as a provider:

  <wlevs:caching-system id ="caching-system-id" provider="caching-provider"/>
  <factory id="factory-id" provider-name="caching-provider">
     <class>the.factory.class.name</class>
  </factory>

In the example, the.factory.class.name is a factory for creating some third-party caching system; the provider attribute of wlevs:caching-system in turn references it as the caching system implementation for the application.

C.10 wlevs:channel

Use this element to declare a channel to the Spring application context.

By default, channels assume that events are system timestamped. To configure application timestamped events, see child element wlevs:application-timestamped.

C.10.1 Child Elements

The wlevs:channel application assembly element supports the following child elements:

C.10.2 Attributes

Table C-9 lists the attributes of the wlevs:channel application assembly element.

Table C-9 Attributes of the wlevs:channel Application Assembly Element

Attribute Description Data Type Required?

advertise

Advertises this service in the OSGi registry.

Valid values are true and false. Default value is false.

Boolean

No.

batching

Specifies whether batching of events should be enabled for the event channel.

Valid values are true and false. Default value is false.

For more information, see Section 9.1.6, "Batch Processing Channels".

Boolean

No.

event-type

Specifies the type of events that are allowed to pass through the event channel.

String

Yes.

id

Unique identifier for this component.

This identifier must correspond to the <name> element in the XML configuration file for this channel, if one exists.

String

Yes.

is-relation

Specifies the kind of events that are allowed to pass through the event channel. Two kind of events are supported: streams and relations. Streams are append-only. Relations support insert, delete, and updates.

The default value for this attribute is false.

Boolean

No.

listeners

Specifies the components that listen to this component. Separate multiple components using commas.

Set this attribute to the value of the id attribute of the element (wlevs:adapter, wlevs:channel, or wlevs:processor) that defines the listening component.

String

No.

max-size

Specifies the maximum size of the FIFO buffer for this channel as max-size number of events.

When max-size = 0, the channel synchronously passes-through events.

When max-size > 0, the channel processes events asynchronously, buffering events by the requested size.

If max-threads is zero, then max-size is zero.

The default value for this attribute is 1024.

integer

No.

max-threads

Specifies the maximum number of threads that will be used to process events for this channel.

When max-threads = 0, the channel acts as a pass-through. Event ordering is preserved.

When max-threads > 0, the channel acts as classic blocking queue, where upstream components are producers of events and the downstream components are the consumers of events. The queue size is defined by the configuration max-size. There will be up to max-threads number of threads consuming events from the queue. Event ordering is non-deterministic.

You can change max-threads from 0 to a positive integer (that is, from a pass through to multiple threads) without redeploying. However, if you change max-threads from a positive integer to 0 (that is, from multiple threads to a pass through), then you must redeploy your application.

If the max-size attribute is 0, then setting a value for max-threads has no effect.

The default value for this attribute is 1.

integer

No.

primary-key

Specifies the primary key of a relation, as a list of event property names, separated by "," or white-spaces.

For more information, see Section 9.1.2.2, "Channels as Relations".

String

No.

provider

Specifies the streaming provider.

Valid values are:

  • oracle.channel

Default value is oracle.channel, which is the out-of-the-box streaming provider.

String

No.

source

Specifies the component from which the channel sources events.

Set this attribute to the value of the id attribute of the element (wlevs:adapter, wlevs:channel, or wlevs:processor) that defines the source component.

String

No.


C.10.3 Example

The following example shows how to use the wlevs:channel element in the EPN assembly file:

<wlevs:channel id="fxMarketAmerOut" />

The example shows how to declare a channel service with unique identifier fxMarketAmerOut.

C.11 wlevs:event-bean

Use this element to declare to the Spring application context that an event bean is part of your event processing network (EPN). Event beans are managed by the Oracle CEP container, analogous to Spring beans that are managed by the Spring framework. In many ways, event beans and Spring beans are similar so it is up to a developer which one to use in their EPN. Use a Spring bean for legacy integration to Spring. Use an event bean if you want to take full advantage of the additional capabilities of Oracle CEP.

For example, you can monitor an event bean using the Oracle CEP monitoring framework, make use of the Configuration framework metadata annotations, and record and playback events that pass through the event bean. An event-bean can also participate in the Oracle CEP bean lifecycle by specifying methods in its EPN assembly file declaration, rather than by implementing Oracle CEP API interfaces.

C.11.1 Child Elements

The wlevs:event-bean application assembly element supports the following child elements:

C.11.2 Attributes

Table C-10 lists the attributes of the wlevs:event-bean application assembly element.

Table C-10 Attributes of the wlevs:event-bean Application Assembly Element

Attribute Description Data Type Required?

id

Unique identifier for this component.

This identifier must correspond to the <name> element in the XML configuration file for this event-bean, if one exists.

String

Yes.

advertise

Advertises this service in the OSGi registry.

Valid values are true and false. Default value is false.

Boolean

No.

listeners

Specifies the components that listen to this component.

Set this attribute to the value of the id attribute of the element that declared the component.

String

No.

class

Specifies the Java class that implements this event bean. The bean is not required to implement any Oracle CEP interfaces.

You must specify either the provider or class attribute, but not both, otherwise an exception is raised.

   

provider

Specifies the service provider.

In this case, an EDE factory registered with this specific provider name must exist in the application.

You must specify either the provider or class attribute, but not both, otherwise an exception is raised.

String

No.

onevent-method

Specifies the method of the event bean implementation that corresponds to the lifecycle onEvent method.

Oracle CEP invokes this method when the event bean receives an event.

By using this lifecycle attribute, the event bean implementation does not have to explicitly implement an Oracle CEP interface.

String

No

init-method

Specifies the method of the event bean implementation that corresponds to the lifecycle init method.

Oracle CEP invokes this method after it has set all the supplied instance properties. This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

By using this lifecycle attribute, the event bean implementation does not have to explicitly implement an Oracle CEP interface.

String

No

activate-method

Specifies the method of the event bean implementation that corresponds to the lifecycle activate method.

Oracle CEP invokes this method after the dynamic configuration of the bean has completed. This method allows the bean instance to perform initialization only possible when all dynamic bean properties have been set and the EPN has been wired.

By using this lifecycle attribute, the event bean implementation does not have to explicitly implement an Oracle CEP interface.

String

No

suspend-method

Specifies the method of the event bean implementation that corresponds to the lifecycle suspend method.

Oracle CEP invokes this method when the application is suspended.

By using this lifecycle attribute, the event bean implementation does not have to explicitly implement an Oracle CEP interface.

String

No

destroy-method

Specifies the method of the event bean implementation that corresponds to the lifecycle destroy method.

Oracle CEP invokes this method when the application is stopped.

By using this lifecycle attribute, the event bean implementation does not have to explicitly implement an Oracle CEP interface.

String

No


C.11.3 Example

The following example shows how to use the wlevs:event-bean element in the EPN assembly file:

    <wlevs:event-bean id="myBean" class="com.customer.SomeEventBean" >
      <wlevs:listener ref="myProcessor" />
    </wlevs:event-bean>

In the example, the event bean called myBean is implemented with the class com.customer.SomeEventBean. The component called myProcessor receives events from the myBean event bean.

C.12 wlevs:event-type-repository

Use this element to group together one or more wlevs:event-type elements, each of which is used to register an event type used throughout the application.

This element does not have any attributes.

C.12.1 Child Elements

The wlevs:event-type-repository application assembly element supports the following child element:

C.12.2 Example

The following example shows how to use the wlevs:event-type-repository element in the EPN assembly file:

<wlevs:event-type-repository>
    <wlevs:event-type type-name="HelloWorldEvent">
        <wlevs:class>
            com.bea.wlevs.event.example.helloworld.HelloWorldEvent
        </wlevs:class>
    </wlevs:event-type>
</wlevs:event-type-repository>

In the example, the wlevs:event-type-repository element groups a single wlevs:event-type element to declare a single event type: HelloWorldEvent. See Section C.13, "wlevs:event-type" for additional details.

C.13 wlevs:event-type

Specifies the definition of an event type used in the Oracle CEP application. Once you define the event types of the application, you can reference them in the adapter and business class POJO, as well as the Oracle CQL and EPL rules.

You can define an event type in the following ways:

  • Create a JavaBean class that represents your event type and specify its fully qualified classname using the wlevs:class child element.

  • Use the wlevs:metadata child element to list the properties of the data type and allow Oracle CEP to automatically create the Java class at runtime.

You can specify one of either wlevs:class or wlevs:metadata as a child of wlevs:event-type, but not both.

You can also use the wlevs:property child element to specify a custom property to apply to the event type.

Oracle recommends that you define your event type by using the wlevs:class child element because you can them reuse the specified JavaBean class, and you control exactly what the event type looks like.

C.13.1 Child Elements

The wlevs:event-type application assembly element supports the following child elements:

C.13.2 Attributes

Table C-11 lists the attributes of the wlevs:event-type application assembly element.

Table C-11 Attributes of the wlevs:event-type Application Assembly Element

Attribute Description Data Type Required?

id

Specifies the unique identifier for this event type.

If you do not specify this attribute, Oracle CEP automatically generates an identifier for you.

String

No.

type-name

Specifies the name of this event type.

This is the name you use whenever you reference the event type in the adapter, business POJO, or Oracle CQL or EPL rules.

String

Yes.


C.13.3 Example

The following example shows how to use the wlevs:event-type element in the EPN assembly file:

<wlevs:event-type-repository>
        <wlevs:event-type type-name="SimpleEvent">
            <wlevs:properties>
                <wlevs:property name="msg" type="char" />
                <wlevs:property name="count" type="long" />
                <wlevs:property name="time_stamp" type="timestamp" />
        </wlevs:properties>
    </wlevs:event-type>
...
</wlevs:event-type-repository>

In the example, the name of the event type is SimpleEvent and its definition is determined by the wlevs:property elements. The values for the type attribute must conform to the com.bea.wlevs.ede.api.Type class.

For more information, see Section 2.1.3, "Event Type Data Types".

C.14 wlevs:expression

Use this element to specify an arithmetic expression in wlevs:application-timestamped to be used as an application timestamp for event processing.

For more information, see "arith_expr" in the Oracle Complex Event Processing CQL Language Reference.

C.14.1 Example

The following example shows how to use wlevs:expression element in the EPN assembly file to specify an explicitly application timestamped channel.

<wlevs:channel id="fxMarketAmerOut" >
    <wlevs:application-timestamped>
        <wlevs:expression>mytime + 10</wlevs:expression>
    </wlevs:application-timestamped>
</wlevs:channel>

In the example, the wlevs:expression element defines the arithmetic expression used to assign a timestamp to each event.

C.15 wlevs:factory

Use this element to register a factory class as a service. Use of this element decreases the dependency of your application on Spring-OSGi interfaces.

The Java source of this factory must implement the com.bea.wlevs.ede.api.Factory interface.

The factory element does not allow you to specify service properties. If you need to specify service properties, then you must use the Spring- OSGi osgi:service element instead.

This element does not have any child elements.

C.15.1 Attributes

Table C-12 lists the attributes of the wlevs:factory application assembly element.

Table C-12 Attributes of the wlevs:factory Application Assembly Element

Attribute Description Data Type Required?

class

Specifies the Java class that implements the factory. This class must implement the com.bea.wlevs.ede.api.Factory interface.

String

Yes.

provider-name

Specifies the name of this provider. Reference this name later in the component that uses this factory.

String

Yes.


C.15.2 Example

The following example shows how to use the wlevs:factory element in the EPN assembly file:

<wlevs:factory provider-name="myEventSourceFactory"
               class="com.customer.MyEventSourceFactory" />

In the example, the factory implemented by the com.customer.MyEventSourceFactory goes by the provider name of myEventSourceFactory.

C.16 wlevs:function

Use this element to specify a bean that contains user-defined functions for a processor. Oracle CEP supports both single-row and aggregate functions.

This element always has a standard Spring bean element either as a child or as a reference that specifies the Spring bean that implements the user-defined function.

For a single-row function for an Oracle CQL processor, you may specify one method on the implementing class as the function using the exec-method attribute. In this case, the method must be public and must be uniquely identifiable by its name (that is, the method cannot have been overridden). You may define an alias for the exec-method name using the function-name attribute. In the Oracle CQL query, you may call only the exec-method (either by its name or the function-name alias).

For a single-row function on an EPL processor, you may define an alias for the implementing class name using the function-name attribute. The exec-method name is not applicable in this case. In the EPL query, you may call any public or static method on the implementing class using either the implementing class name or the function-name alias.

For an aggregate function on either an Oracle CQL or EPL processor, the Spring bean must implement the following interfaces from the com.bea.wlevs.processor package:

  • AggregationFunctionFactory

  • AggregationFunction

For an aggregate function, the exec-method attribute is not applicable on both an Oracle CQL processor and an EPL processor.

For more information, see:

C.16.1 Attributes

Table C-13 lists the attributes of the wlevs:function application assembly element.

Table C-13 Attributes of the wlevs:function Application Assembly Element

Attribute Description Data Type Required?

exec-method

For a user-defined single-row function on an Oracle CQL processor, this element specifies the method name of the Spring bean that implements the function. In this case, the method must be public and must be uniquely identifiable by its name (that is, the method cannot have been overridden).

For a user-defined single-row or aggregate function on an EPL processor or a user-defined aggregate function on an Oracle CQL processor, this attribute is not applicable.

String

No.

function-name

For a user-defined single-row function on an Oracle CQL processor, use this attribute to define an alias for the exec-method name. You can then use the function-name in your Oracle CQL query instead of the exec-name.

For a user-defined single-row function on an EPL processor, use this attribute to define an alias for the implementing Spring bean class name. You can then use the function-name in your EPL query instead of the Spring bean class name and still invoke any public or static method that the Spring bean class implements.

For a user-defined aggregate function on an Oracle CQL or EPL processor, use this attribute to define an alias for the implementing Spring bean class name. You can then use the function-name in your EPL query instead of the Spring bean class name.

The default value is the Spring bean name.

String

No.

ref

Specifies the Spring bean that implements the function.

Set this attribute to the value of the id attribute of the Spring bean.

This is an alternative to making the Spring bean element a child of the wlevs:function element.

String

No.


C.16.2 Example

The following examples show how to use the wlevs:function element and its attributes on both Oracle CQL and EPL processors:

C.16.2.1 Single-Row User-Defined Function on an Oracle CQL Processor

Example C-1 shows how you implement a single-row user-defined the function for an Oracle CQL processor.

Example C-1 Single-Row User Defined Function Implementation Class

package com.bea.wlevs.example.function;

public class MyMod {
    public Object execute(int arg0, int arg1) {
        return new Integer(arg0 % arg1);
    }
}

Example C-2 shows how to use the wlevs:function to define a single-row function on an Oracle CQL processor in the EPN assembly file.

Example C-2 Single-Row User Defined Function for an Oracle CQL Processor

<wlevs:processor id="testProcessor">
    <wlevs:listener ref="providerCache"/>
    <wlevs:listener ref="outputCache"/>
    <wlevs:cache-source ref="testCache"/>
    <wlevs:function function-name="mymod" exec-method=”execute” />
        <bean class="com.bea.wlevs.example.function.MyMod"/>
    </wlevs:function>
</wlevs:processor>

Example C-3 shows how you invoke the function in an Oracle CQL query.

Example C-3 Invoking the Single-Row User-Defined Function on an Oracle CQL Processor

...
<view id="v1" schema="c1 c2 c3 c4"><![CDATA[ 
    select
        mymod(c1, 100), c2, c3, c4 
    from 
        S1
]]></view>
...
<query id="q1"><![CDATA[
    select * from v1 [partition by c1 rows 1] where c4 - c3 = 2.3 
]]></query>
...

C.16.2.2 Single-Row User-Defined Function on an EPL Processor

Example C-4 shows how you implement a single-row user-defined the function for an EPL processor.

Example C-4 Single-Row User Defined Function Implementation Class

package com.bea.wlevs.example.function;

public class LegacyMathBean {
    public Object square(Object[] args) {
    ...
    }
    public Object cube(Object[] args) {
    ...
    }
}

Example C-5 shows how to use the wlevs:function to define a single-row function for an EPL processor in the EPN assembly file.

Example C-5 Single-Row User Defined Function for an EPL Processor

  <wlevs:processor id="testProcessor" provider="epl">
    <wlevs:listener ref="providerCache"/>
    <wlevs:listener ref="outputCache"/>
    <wlevs:cache-source ref="testCache"/>
    <wlevs:function function-name="math" />
      <bean class="com.bea.wlevs.example.function.LegacyMathBean"/>
    </wlevs:function>
   </wlevs:processor>

Example C-6 shows how you invoke the function in an EPL query.

Example C-6 Invoking the Single-Row User-Defined Function on an EPL Processor

<rule><![CDATA[ 
    select math.square(inputValue) ...
]]></rule>

C.16.2.3 Aggregate User-Defined Function on an Oracle CQL Processor

Example C-7 shows how to implement a user-defined aggregate function for an Oracle CQL processor.

Example C-7 Aggregate User Defined Function Implementation Class

package com.bea.wlevs.test.functions;
 
import com.bea.wlevs.processor.AggregationFunction;
import com.bea.wlevs.processor.AggregationFunctionFactory;
 
public class Variance implements AggregationFunctionFactory, AggregationFunction {
 
    private int count;
    private float sum;
    private float sumSquare;
 
    public Class<?>[] getArgumentTypes() {
        return new Class<?>[] {Integer.class};
    }
 
    public Class<?> getReturnType() {
        return Float.class;
    }
 
    public AggregationFunction newAggregationFunction() {
        return new Variance();
    }
 
    public void releaseAggregationFunction(AggregationFunction function) {
    }
 
    public Object handleMinus(Object[] params) {
        if (params != null && params.length == 1) {
            Integer param = (Integer) params[0];
            count--;
            sum -= param;
            sumSquare -= (param * param);
        }
        
        if (count == 0) {
            return null;
        } else {
            return getVariance();
        }
    }
 
    public Object handlePlus(Object[] params) {
        if (params != null && params.length == 1) {
            Integer param = (Integer) params[0];
            count++;
            sum += param;
            sumSquare += (param * param);
        }
        
        if (count == 0) {
            return null;
        } else {
            return getVariance();
        }
    }
 
    public Float getVariance() {
        float avg = sum / (float) count;
        float avgSqr = avg * avg;
        float var = sumSquare / (float)count - avgSqr;
        return var;
    }
 
    public void initialize() {
        count = 0;
        sum = 0.0F;
        sumSquare = 0.0F;
    }
 
}

Example C-8 shows how to use the wlevs:function to define an aggregate function on an Oracle CQL processor in the EPN assembly file.

Example C-8 Aggregate User Defined Function for an Oracle CQL Processor

  <wlevs:processor id="testProcessor">
     <wlevs:listener ref="providerCache"/>
     <wlevs:listener ref="outputCache"/>
     <wlevs:cache-source ref="testCache"/>
     <wlevs:function function-name="var">
       <bean class="com.bea.wlevs.test.functions.Variance"/>
     </wlevs:function>
   </wlevs:processor>

Example C-9 shows how you invoke the function in an Oracle CQL query.

Example C-9 Invoking the Aggregate User-Defined Function on an Oracle CQL Processor

...
<query id="uda6"><![CDATA[ 
    select var(c2) from S4[range 3] 
]]></query>
...

C.16.2.4 Aggregate User-Defined Function on an EPL Processor

Example C-10 shows how to implement a user-defined aggregate function for an EPL processor.

Example C-10 Aggregate User Defined Function Implementation Class

package com.bea.wlevs.test.functions;
 
import com.bea.wlevs.processor.AggregationFunction;
import com.bea.wlevs.processor.AggregationFunctionFactory;
 
public class Variance implements AggregationFunctionFactory, AggregationFunction {
 
    private int count;
    private float sum;
    private float sumSquare;
 
    public Class<?>[] getArgumentTypes() {
        return new Class<?>[] {Integer.class};
    }
 
    public Class<?> getReturnType() {
        return Float.class;
    }
 
    public AggregationFunction newAggregationFunction() {
        return new Variance();
    }
 
    public void releaseAggregationFunction(AggregationFunction function) {
    }
 
    public Object handleMinus(Object[] params) {
        if (params != null && params.length == 1) {
            Integer param = (Integer) params[0];
            count--;
            sum -= param;
            sumSquare -= (param * param);
        }
        
        if (count == 0) {
            return null;
        } else {
            return getVariance();
        }
    }
 
    public Object handlePlus(Object[] params) {
        if (params != null && params.length == 1) {
            Integer param = (Integer) params[0];
            count++;
            sum += param;
            sumSquare += (param * param);
        }
        
        if (count == 0) {
            return null;
        } else {
            return getVariance();
        }
    }
 
    public Float getVariance() {
        float avg = sum / (float) count;
        float avgSqr = avg * avg;
        float var = sumSquare / (float)count - avgSqr;
        return var;
    }
 
    public void initialize() {
        count = 0;
        sum = 0.0F;
        sumSquare = 0.0F;
    }
 
}

Example C-11 shows how to use the wlevs:function to define an aggregate function on an EPL processor in the EPN assembly file.

Example C-11 Aggregate User Defined Function for an EPL Processor

  <wlevs:processor id="testProcessor" provider="epl">
     <wlevs:listener ref="providerCache"/>
     <wlevs:listener ref="outputCache"/>
     <wlevs:cache-source ref="testCache"/>
     <wlevs:function function-name="var">
       <bean class="com.bea.wlevs.test.functions.Variance"/>
     </wlevs:function>
   </wlevs:processor>

Example C-12 shows how you invoke the function in an EPL query.

Example C-12 Invoking the Aggregate User-Defined Function on an EPL Processor

...
<rule><![CDATA[ 
    select var(c2) from S4
]]></rule>
...

C.16.2.5 Specifying the Implementation Class: Nested Bean or Reference

Example C-13 shows how to use the wlevs:function element with a nested bean element in the EPN assembly file.

Example C-13 User Defined Function Using Nested Bean Element

  <wlevs:processor id="testProcessor">
     <wlevs:listener ref="providerCache"/>
     <wlevs:listener ref="outputCache"/>
     <wlevs:cache-source ref="testCache"/>
     <wlevs:function function-name="testfunction">
       <bean class="com.bea.wlevs.example.cache.function.TestFunction"/>
     </wlevs:function>
   </wlevs:processor>

Example C-14 shows how to use the wlevs:function element and its ref attribute to reference a bean element defined outside of the wlevs:function element in the EPN assembly file.

Example C-14 User Defined Function Using Reference

  <wlevs:processor id="testProcessor">
     <wlevs:listener ref="providerCache"/>
     <wlevs:listener ref="outputCache"/>
     <wlevs:cache-source ref="testCache"/>
     <wlevs:function function-name="testfunction" ref="testFunctionID" />
   </wlevs:processor>
  ...
  <bean id="testFunctionID" class="com.bea.wlevs.example.cache.function.TestFunction"/>

C.17 wlevs:instance-property

Specifies the properties that apply to the create stage instance of the component to which this is a child element. This allows declarative configuration of user-defined stage properties.

For example, when you specify an wlevs:instance-property for a wlevs:event-bean, Oracle CEP will look for a corresponding setter method on the Java class you implement, not on the com.bea.wlevs.spring.EventBeanFactoryBean that instantiates your class. To specify a property on the factory, use wlevs:property

This element is used only as a child of wlevs:adapter, wlevs:event-bean, wlevs:processor, wlevs:channel, or wlevs:caching-system.

The wlevs:instance-property element is defined as the Spring propertyType type; for additional details of this Spring data type, the definition of the allowed child elements, and so on, see the http://www.springframework.org/schema/beans/spring-beans-2.0.xsd.

C.17.1 Child Elements

You can specify one of the following standard Spring elements as a child element of the wlevs:instance-property element:

  • meta

  • bean

  • ref

  • idref

  • value

  • null

  • list

  • set

  • map

  • props

C.17.2 Attributes

Table C-14 lists the attributes of the wlevs:instance-property application assembly element.

Table C-14 Attributes of the wlevs:instance-property Application Assembly Element

Attribute Description Data Type Required?

name

Specifies the name of the property, following JavaBean naming conventions.

String

Yes.

ref

A short-cut alternative to a nested <ref bean='...'/> element.

String

No.

value

A short-cut alternative to a nested <value>...</value> element.

String

No.


C.17.3 Example

The following example shows how to use the wlevs:instance-property element in the EPN assembly file:

<wlevs:event-bean id="pubsubCounterBeanRemote"
    class="com.oracle.cep.example.httppubsub.RemoteEventCounter">
    <wlevs:listener ref="pubsubRemote" />
    <wlevs:instance-property name="expectedEvents" value="4000" />
</wlevs:event-bean>

In the example, the event bean com.oracle.cep.example.httppubsub.RemoteEventCounter class provides an appropriate setter method:

...
    private int expectedEvents;
 
    public void setExpectedEvents(String expectedEvents) {
        this.expectedEvents = new Integer(expectedEvents).intValue();
    }
...

Note that the instance-property is of type String. Your setter method must convert this if necessary. In this example, the String is converted to an int value.

The name of the setter method must conform to JavaBean naming conventions. In this example, the setter name is setExpectedEvents and this corresponds to the wlevs:instance-property element name attribute value expectedEvents, according to JavaBean conventions. If the name attribute value is obj and the setter method name is setObject, Oracle CEP will throw an Invalid Property exception. In this case, the setter name should be setObj.

C.18 wlevs:listener

Specifies the component that listens to the component to which this element is a child. A listener can be an instance of any other component. You can also nest the definition of a component within a particular wlevs:listener component to specify the component that listens to the parent.

Caution:

Nested definitions are not eligible for dynamic configuration or monitoring.

This element is always a child of wlevs:adapter, wlevs:processor, wlevs:channel, or wlevs:caching-system.

C.18.1 Attributes

Table C-15 lists the attributes of the wlevs:listener application assembly element.

Table C-15 Attributes of the wlevs:listener Application Assembly Element

Attribute Description Data Type Required?

ref

Specifies the component that listens to the parent component .

Set this attribute to the value of the id attribute of the listener component.

You do not specify this attribute if you are nesting listeners.

String

No.


C.18.2 Example

The following example shows how to use the wlevs:listener element in the EPN assembly file:

    <wlevs:processor id="helloworldProcessor">
        <wlevs:listener ref="helloworldOutstream"/>
    </wlevs:processor>

In the example, the hellworldOutstream component listens to the helloworldProcessor component. It is assumed that the EPN assembly file also contains a declaration for a wlevs:adapter, wlevs:channel, or wlevs:processor element whose unique identifier is helloworldOutstream.

C.19 wlevs:metadata

Specifies the definition of an event type by listing its fields as a group of Spring entry elements. When you define an event type this way, Oracle CEP automatically generates the Java class for you.

Use the key attribute of the entry element to specify the name of a field and the value attribute to specify the Java class that represents the field's data type.

This element is used only as a child of wlevs:event-type.

The wlevs:metadata element is defined as the Spring mapType type; for additional details of this Spring data type, see the http://www.springframework.org/schema/beans/spring-beans-2.0.xsd.

C.19.1 Child Elements

The wlevs:metadata element can have one or more standard Spring entry child elements as defined in the http://www.springframework.org/schema/beans/spring-beans-2.0.xsd.

C.19.2 Attributes

Table C-16 lists the attributes of the wlevs:metadata application assembly element.

Table C-16 Attributes of the wlevs:metadata Application Assembly Element

Attribute Description Data Type Required?

key-type

The default fully qualified classname of a Java data type for nested entry elements.

You use this attribute only if you have nested entry elements.

String

No.


C.19.3 Example

The following example shows how to use the wlevs:metadata element in the EPN assembly file:

<wlevs:event-type type-name="ForeignExchangeEvent">
    <wlevs:metadata>
        <entry key="symbol" value="java.lang.String"/>
        <entry key="price" value="java.lang.Double"/>
        <entry key="fromRate" value="java.lang.String"/>
        <entry key="toRate" value="java.lang.String"/>
    </wlevs:metadata>
    ...
</wlevs:event-type>

In the example, the wlevs:metadata element groups together four standard Spring entry elements that represent the four fields of the ForeignExchangeEvent: symbol, price, fromRate, and toRate. The data types of the fields are java.lang.String, java.lang.Double, java.lang.String, and java.lang.String, respectively.

C.20 wlevs:processor

Use this element to declare a processor to the Spring application context.

C.20.1 Child Elements

The wlevs:processor Spring element supports the following child elements:

C.20.2 Attributes

Table C-17 lists the attributes of the wlevs:processor application assembly element.

Table C-17 Attributes of the wlevs:processor Application Assembly Element

Attribute Description Data Type Required?

id

Unique identifier for this component.

This identifier must correspond to the <name> element in the XML configuration file for this processor; this is how Oracle CEP knows which Oracle CQL or EPL rules to execute for which processor component in your network.

String

Yes.

advertise

Advertises this service in the OSGi registry.

Valid values are true and false. Default value is false.

Boolean

No.

listeners

Specifies the components that listen to this component.

Set this attribute to the value of the id attribute of the element that declared the component.

String

No.

provider

Specifies the language provider of the processor, such as the Oracle Continuous Query Language (Oracle CQL) or Event Processor Language (EPL).

Valid values are:

  • epl

  • cql

The default value is cql.

String

No.

queryURL

Specifies a URL that points to an Oracle CQL or EPL rules definition file for this processor.

String.

No.


C.20.3 Example

The following example shows how to use the wlevs:processor element in the EPN assembly file:

<wlevs:processor id="spreader" />

The example shows how to declare a processor with ID spreader. This means that in the processor configuration file that contains the Oracle CQL rules for this processor, the name element must contain the value spreader. This way Oracle CEP knows which Oracle CQL or EPL rules it must file for this particular processor.

C.21 wlevs:property

Specifies a custom property to apply to the event type.

For example, when you specify a wlevs:property for a wlevs:event-bean, Oracle CEP will look for a corresponding setter method on the com.bea.wlevs.spring.EventBeanFactoryBean that instantiates your Java class, not on the Java class you implement. To specify a property on your Java class, use wlevs:instance-property.

This element is used only as a child of wlevs:adapter, wlevs:event-bean, wlevs:event-type, wlevs:processor, wlevs:channel, or wlevs:caching-system.

The wlevs:property element is defined as the Spring propertyType type; for additional details of this Spring data type, the definition of the allowed child elements, and so on, see the http://www.springframework.org/schema/beans/spring-beans-2.0.xsd.

C.21.1 Child Elements

You can specify one of the following standard Spring elements as a child element of the wlevs:property element:

  • meta

  • bean

  • ref

  • idref

  • value

  • null

  • list

  • set

  • map

  • props

C.21.2 Attributes

Table C-18 lists the attributes of the wlevs:property application assembly element.

Table C-18 Attributes of the wlevs:property Application Assembly Element

Attribute Description Data Type Required?

name

Specifies the name of the property, following JavaBean naming conventions.

String

Yes.

ref

A short-cut alternative to a nested <ref bean='...'/> element.

String

No.

value

A short-cut alternative to a nested <value>...</value> element.

String

No.


C.21.3 Example

The following example shows how to use the wlevs:property element in the EPN assembly file:

<wlevs:event-type type-name="ForeignExchangeEvent">
   <wlevs:metadata>
      <entry key="symbol" value="java.lang.String"/>
      <entry key="price" value="java.lang.Double"/>
   </wlevs:metadata>
   <wlevs:property name="builderFactory">
     <bean id="builderFactory"
            class="com.bea.wlevs.example.fx.ForeignExchangeBuilderFactory"/>
   </wlevs:property>
</wlevs:event-type>

In the example, the wlevs:property element defines a custom property of the ForeignExchangeEvent called builderFactory. The property uses the standard Spring bean element to specify the Spring bean used as a factory to create ForeignExchangeEvents.

C.22 wlevs:source

Specifies an event source for this component, or in other words, the component which the events are coming from. Specifying an event source is equivalent to specifying this component as an event listener to another component.

You can also nest the definition of a component within a particular wlevs:source component to specify the component source.

Caution:

Nested definitions are not eligible for dynamic configuration or monitoring.

This element is a child of wlevs:channel or wlevs:processor.

C.22.1 Attributes

Table C-19 lists the attributes of the wlevs:source application assembly element.

Table C-19 Attributes of the wlevs:source Application Assembly Element

Attribute Description Data Type Required?

ref

Specifies the source of the channel to which this element is a child.

Set this attribute to the value of the id attribute of the source component.

You do not specify this attribute if you are nesting sources.

String

No.


C.22.2 Example

The following example shows how to use the wlevs:source element in the EPN assembly file:

    <wlevs:channel id="helloworldInstream">
        <wlevs:listener ref="helloworldProcessor"/>
        <wlevs:source ref="helloworldAdapter"/>
    </wlevs:channel>

In the example, the component with id helloworldAdapter is the source of the helloworldInstream channel component.

C.23 wlevs:table

Specifies a relational database table that supplies data to one or more processor components. The processor components in turn are associated with an Oracle CQL query that directly references the table.

C.23.1 Attributes

Table C-20 lists the attributes of the wlevs:table application assembly element.

Table C-20 Attributes of the wlevs:table Application Assembly Element

Attribute Description Data Type Required?

id

Unique identifier for this component.

This identifier must correspond to the <name> element in the XML configuration file for this table.

String

Yes.

event-type

The name of the event type associated with this table as defined in the event type repository.

String

Yes.

data-source

The name of the relational data source defined in the Oracle CEP server configuration file used to access this database table.

String

Yes.


C.23.2 Example

The following example shows how to use the wlevs:table element in the EPN assembly file:

<wlevs:table id="Stock" event-type="StockEvent" data-source="StockDs" />

<wlevs:processor id="proc">
    <wlevs:table-source ref="Stock" />
</wlevs:processor>

In this example, a wlevs:processor references the table using its wlevs:table-source element.

C.24 wlevs:table-source

Specifies a relational database table that supplies data to this processor component. The processor component in turn is associated with an Oracle CQL query that directly references the table.

This element is a child of only wlevs:processor element.

C.24.1 Attributes

Table C-21 lists the attributes of the wlevs:table-source application assembly element.

Table C-21 Attributes of the wlevs:table-source Application Assembly Element

Attribute Description Data Type Required?

ref

Specifies the relational database table that is a source of data for the processor component.

Set this attribute to the value of the id attribute of a wlevs:table element.

String

Yes.


C.24.2 Example

The following example shows how to use the wlevs:table-source element in the EPN assembly file:

<wlevs:table id="Stock" event-type="StockEvent" data-source="StockDs" />

<wlevs:processor id="proc">
    <wlevs:table-source ref="Stock" />
</wlevs:processor>