2 Application Tasks

This section contains the typical application tasks you can perform with Oracle CEP Visualizer.

Oracle CEP Visualizer is fairly self-explanatory and intuitive, so not all tasks are discussed here, but rather, just those that are most common and typical and from which other similar tasks can be deduced.

This chapter describes:

2.1 Overview of Application Tasks

Using Oracle CEP Visualizer, you can perform a variety of application management tasks, including managing:

2.1.1 Event Processing Network (EPN)

The Oracle CEP Event Processing Network (EPN) represents the interconnections between the various Oracle CEP components of an Oracle CEP application. Using Oracle CEP Visualizer, you can manage the EPN, including viewing and changing the configuration of a stage, recording and playing back events, and monitoring the throughput and latency of a stage or path. Right-click a stage to select common stage-related functions from a convenient context menu.

For more information, see:

2.1.2 Application Lifecycle

You can manage the full application lifecycle including uploading an application, deploying it, suspending and resuming the application, and undeploying the application.

For more information, see:

2.1.3 Rules

You can create, replace, and delete the rules in the Oracle CQL and EPL processors of Oracle CEP applications you develop and deploy as well as applications that Oracle CEP server deploys.

It is important to note that Oracle CEP Visualizer will update your configuration file on the server with any queries that you create. However, you will not see this take effect in your application from within the Oracle CEP IDE for Eclipse, in order to make the change there you will need to copy and paste the query from Oracle CEP Visualizer into your application.

For more information, see:

2.1.4 Configuration History Management

Using the Oracle CEP Visualizer, you can manage the configuration changes you make to Oracle CEP components. You can review change history and you can undo (roll back) changes to an earlier version. You can perform these operations on a given resource or application in both standalone-server and multi-server domains.

Alternatively, you can manage configuration history using the wlevs.Admin command-line tool.

For more information, see:

2.1.4.1 Resource Configuration History Management

You can manage the configuration history of the following Oracle CEP resources:

  • Oracle CEP high availability adapters

  • Oracle CQL rules

For more information, see Section 2.6.1, "How to Manage Resource Configuration History".

2.1.4.2 Application Configuration History Management

You can manage the configuration history for a given application. This allows you to see a summary of all the configuration changes made to all resources of a given application.

For more information, see Section 2.6.2, "How to Manage Application Configuration History".

2.1.4.3 Application Lifecycle and Configuration History Management

When you deploy an application, the Oracle CEP server creates a new configuration history for the application.

When you update an application, the Oracle CEP server erases the existing configuration history and creates a new configuration history for the application.

When you uninstall an application, the Oracle CEP server erases the configuration history for the application.

For more information, see Section 2.1.2, "Application Lifecycle".

2.2 Managing the Event Processing Network (EPN)

This section describes:

For more information, see Section 2.1.1, "Event Processing Network (EPN)".

2.2.1 Viewing the EPN of an Application

Using the Oracle CEP Visualizer, you can view the EPN of a deployed application.

To view the EPN of an application:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application whose EPN you want to view.

  3. In the right pane, click the Event Processing Network tab.

    The Event Processor Network panel is displayed as Figure 2-1 shows.

    Figure 2-1 Event Processing Network Panel

    Description of Figure 2-1 follows
    Description of "Figure 2-1 Event Processing Network Panel"

    The name of a stage appears above the stage in black text. For example, the first Oracle CQL processor is named FindCrossRates and the name of its inbound channel is FxQuoteStream.

    The name of the event type transmitted on a given channel is shown above the connecting line in blue text. For example, the event type transmitted on the FxQuoteStream is StockTick.

  4. To navigate to areas of the EPN that are off the screen, click in the miniature EPN view, and drag.

  5. To change the layout of the EPN, select a layout option from the Layout menu:

    • organic

    • tree

    • hierarchic (default)

    • balloon

    • orthogonal

  6. To change the way the EPN fits in the browser window:

    1. Click on the Zoom slider and drag to the right to increase the zoom level; drag left to decrease the zoom level.

    2. Click the Fit Content button to automatically adjust the zoom level to make all of the EPN visible in the browser window; click the Actual Size button to reset the zoom level to zero.

    3. Click the Zoom Out (+) button or Zoom In (-) button.

2.2.2 Viewing and Changing the Configuration of a Stage

Using Oracle CEP Visualizer, you can view the configuration of any stage and change the configuration for some stages.

Note:

Any changes to rules and Oracle high availability adapters are propagated to the other servers in the same group. That is, all rule and and Oracle high availability adapter configurations is automatically synchronized. Other configuration changes are not synchronized. For example, if you change record/playback or JMS adapter configuration on one server in a multi-server domain, then these changes are not synchronized with the other servers in the same group. For more information, see Section 3.9, "Managing Multi-Server Domains"

To view and change the configuration of a stage:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application you want to record and playback events with.

  3. Select the stage you wish to view and configure:

    1. To use the EPN diagram:

      • Click the Event Processing Network tab.

      • Double-click the stage you wish to view or Right-click the stage and select Open Panel.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to view.

      • Click the stage you wish to view.

      • In the right pane, click the General tab

    The stage's configuration appears.

    For example, Figure 2-2 shows the General tab for a channel.

    Figure 2-2 General Tab for Channel Stage: Before Clicking Edit

    Description of Figure 2-2 follows
    Description of "Figure 2-2 General Tab for Channel Stage: Before Clicking Edit"

    Note:

    Not all stage's configuration can be updated by Oracle CEP Visualizer. An Edit button will appear if the configuration can be updated.

    For a description of the configuration properties for each possible stage, see:

  4. Click the Edit button, if present.

    Modifiable attributes become editable as Figure 2-3 shows.

    Figure 2-3 General Tab for Channel Stage: After Clicking Edit

    Description of Figure 2-3 follows
    Description of "Figure 2-3 General Tab for Channel Stage: After Clicking Edit"

  5. Enter new values for editable fields.

    For example, for the Max Size and Max Threads fields in Figure 2-3.

  6. To commit your changes, click Save.

  7. To leave the configuration unchanged, click Cancel.

2.2.2.1 Channel Properties

Figure 2-4 shows the General tab for a channel stage.

Figure 2-4 General Tab for Channel Stage

Description of Figure 2-4 follows
Description of "Figure 2-4 General Tab for Channel Stage"

After you click Edit, you can modify the attributes that are not shaded grey. Table 2-1 describes all the attributes on the General tab for this stage.

Table 2-1 General Tab Properties: Channel

Attribute Description

Channel Type

Stream or Relation.

For more information, see "Streams and Relations" in the Oracle CEP Developer's Guide for Eclipse.

Max Size

Specifies the maximum size of the channel. Zero-size channels synchronously pass-through events. Non-zero size channels process events asynchronously, buffering events by the requested size. The default value is 1024.

Max Threads

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

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.

Event Type Name

The name of the event type that this channel carries.

Timestamp Type

Use this element to specify whether or not the channel is application timestamped, that is, if the application is responsible for assigning a timestamp to each event, using any time domain. Valid values are:

  • SYSTEM-TIME (default)

  • APPLICATION-TIME

For more information, see child element application-timestamped in "wlevs:channel" in the Oracle CEP Developer's Guide for Eclipse.

Automatic HeartBeat

For system timestamped relations or streams, time is dependent upon the arrival of data on the relation or stream data source. Oracle CEP generates a heartbeat on a system timestamped relation or stream if there is no activity (no data arriving on the stream or relation's source) for more than this number of nanoseconds. Either the relation or stream is populated by its specified source or Oracle CEP generates a heartbeat every Automatic HeartBeat number of nanoseconds.

Note: This attribute is only applicable when a non-streaming source is connected to the channel.

For more information, see "heartbeat" in the Oracle CEP Developer's Guide for Eclipse.


For more information, see "channel" in the Oracle CEP Developer's Guide for Eclipse.

2.2.2.2 Channel Properties: Outbound Channel

Figure 2-5 shows the General tab for an outbound channel stage (a channel stage with an upstream Oracle CQL processor). The Channel Parameter accordion tab is selected.

Figure 2-5 General Tab Outbound Channel Parameters

Description of Figure 2-5 follows
Description of "Figure 2-5 General Tab Outbound Channel Parameters "

After you click Edit, you can modify the attributes that are not shaded grey. Table 2-2 describes all the attributes on the General tab for this stage.

Table 2-2 General Tab Properties: Outbound Channel

Attribute Description

Channel Type

Stream or Relation.

For more information, see "Streams and Relations" in the Oracle CEP Developer's Guide for Eclipse.

Max Size

Specifies the maximum size of the channel. Zero-size channels synchronously pass-through events. Non-zero size channels process events asynchronously, buffering events by the requested size. The default value is 1024.

Max Threads

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

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.

Event Type Name

The name of the event type that this channel carries.


Figure 2-6 shows the General tab for a channel stage (with an upstream Oracle CQL processor). The Selectors accordion tab is selected.

Figure 2-6 General Tab Selectors for Outbound Channel Stage

Description of Figure 2-6 follows
Description of "Figure 2-6 General Tab Selectors for Outbound Channel Stage "

The Selector tab is only applicable if the up-stream node is an Oracle CQL processor.

After you click Edit, use the Selector tab, you can specify which up-stream Oracle CQL processor queries are permitted to output their results to the channel:

  1. Select an up-stream Oracle CQL processor from the Processor pull-down menu.

    The available Oracle CQL rules associated with the selected processor are listed below the pull-down menu.

  2. Use the left and right-pointing arrow buttons to move one or more rules to the Selected Queries list.

    Only rules in the Selected Queries list will output events to the channel.

Note:

For more information on selectors, see "Configuring a Channel" in the Oracle CEP Developer's Guide for Eclipse.

For more information, see "channel" in the Oracle CEP Developer's Guide for Eclipse.

2.2.2.3 Stream Properties

Figure 2-7 shows the General tab for a stream stage.

Figure 2-7 General Tab for Channel Stage

Description of Figure 2-7 follows
Description of "Figure 2-7 General Tab for Channel Stage"

After you click Edit, you can modify the attributes that are not shaded grey. Table 2-3 describes all the attributes on the General tab for this stage.

Table 2-3 General Tab Properties: Stream

Attribute Description

Max Size

Specifies the maximum size of the stream. Zero-size streams synchronously pass-through events. Non-zero size streams process events asynchronously, buffering events by the requested size. The default value is 1024.

Max Threads

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

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.


2.2.2.4 Oracle CQL Processor Properties

Table 2-3 shows the General tab for an Oracle CQL processor stage.

Figure 2-8 General Tab for Oracle CQL Processor Stage

Description of Figure 2-8 follows
Description of "Figure 2-8 General Tab for Oracle CQL Processor Stage"

There are no editable properties for this type of stage.

For more information, see "processor (Oracle CQL)" in the Oracle CEP Developer's Guide for Eclipse.

2.2.2.5 EPL Processor Properties

Figure 2-9 shows the General tab for an EPL processor stage.

Figure 2-9 General Tab for EPL Processor Stage

Description of Figure 2-9 follows
Description of "Figure 2-9 General Tab for EPL Processor Stage"

There are no editable properties for this type of stage.

For more information, see "processor (EPL)" in the Oracle CEP Developer's Guide for Eclipse.

2.2.2.6 Adapter Properties

Figure 2-10 shows the General tab for an adapter stage.

Figure 2-10 General Tab for an Adapter Stage

Description of Figure 2-10 follows
Description of "Figure 2-10 General Tab for an Adapter Stage"

There are no editable properties for this type of stage.

For more information, see "adapter" in the Oracle CEP Developer's Guide for Eclipse.

2.2.2.7 JMS Adapter Properties

Figure 2-16 shows the General tab for a JMS adapter.

Figure 2-11 General Tab for a JMS Adapter Stage

Description of Figure 2-11 follows
Description of "Figure 2-11 General Tab for a JMS Adapter Stage"

There are no editable properties for this type of stage.

For more information, see "adapter" in the Oracle CEP Developer's Guide for Eclipse.

2.2.2.8 Oracle CEP High Availability Input Adapter Properties

Figure 2-12 shows the General tab for an Oracle CEP high availability input adapter.

Figure 2-12 General Tab for an Oracle CEP High Availability Input Adapter Stage

Surrounding text describes Figure 2-12 .

There are no editable properties for this type of stage.

For more information, see "How to Configure the High Availability Input Adapter" in the Oracle CEP Developer's Guide for Eclipse.

2.2.2.9 Oracle CEP High Availability Sliding Window Output Adapter Properties

Figure 2-13 shows the General tab for an Oracle CEP high availability sliding window output adapter.

Figure 2-13 General Tab for an Oracle CEP High Availability Sliding Window Output Adapter Stage

Surrounding text describes Figure 2-13 .

There are no editable properties for this type of stage.

For more information, see "How to Configure the Sliding Window Output Adapter" in the Oracle CEP Developer's Guide for Eclipse.

2.2.2.10 Oracle CEP High Availability Broadcast Output Adapter Properties

Figure 2-14 shows the General tab for an Oracle CEP high availability broadcast output adapter.

Figure 2-14 General Tab for an Oracle CEP High Availability Broadcast Output Adapter Stage

Surrounding text describes Figure 2-14 .

There are no editable properties for this type of stage.

For more information, see "How to Configure the Broadcast Output Adapter" in the Oracle CEP Developer's Guide for Eclipse.

2.2.2.11 Oracle CEP High Availability Correlating Output Adapter Properties

Figure 2-15 shows the General tab for an Oracle CEP high availability correlating output adapter.

Figure 2-15 General Tab for an Oracle CEP High Availability Correlating Output Adapter Stage

Surrounding text describes Figure 2-15 .

There are no editable properties for this type of stage.

For more information, see "How to Configure the Correlating Output Adapter" in the Oracle CEP Developer's Guide for Eclipse.

2.2.2.12 Event Bean Properties

Figure 2-16 shows the General tab for an event bean stage.

Figure 2-16 General Tab for Event Bean Stage

Description of Figure 2-16 follows
Description of "Figure 2-16 General Tab for Event Bean Stage"

There are no editable properties for this type of stage.

For more information, see "event-bean" in the Oracle CEP Developer's Guide for Eclipse.

2.2.2.13 POJO Properties

Figure 2-17 shows the General tab for a Plain Old Java Object (POJO) stage.

Figure 2-17 General Tab for POJO Stage

Description of Figure 2-17 follows
Description of "Figure 2-17 General Tab for POJO Stage"

There are no editable properties for this type of stage.

2.2.2.14 Cache Properties: Oracle CEP Local Cache

Figure 2-18 shows the properties for an Oracle CEP Local Cache stage.

Figure 2-18 Oracle CEP Local Cache Stage Properties

Description of Figure 2-18 follows
Description of "Figure 2-18 Oracle CEP Local Cache Stage Properties"

After you click Edit, you can modify the attributes that are not shaded grey. Table 2-4 describes all the attributes on the General tab for this stage.

Table 2-4 Properties: Oracle CEP Local Cache

Attribute Description

Max Size

Specifies the max-size element to define the number of cache elements in memory after which eviction or paging occurs. Currently, the maximum cache size is 2^31-1 entries. This element may be changed dynamically.

Idle Time

Specifies the number of milliseconds a cache entry may not be accessed before being actively removed from the cache. By default, there is no idle-time set. This element may be changed dynamically.

Write Policy

Specifies how Oracle CEP server writes information into the cache. Valid values are:

  • WriteNone: Specifies no writes to a cache store. This is the default write policy. This element may be changed dynamically. For more information, see "write-none" in the Oracle CEP Developer's Guide for Eclipse

  • WriteThrough: Specifies synchronous writes to the cache store. As soon as an entry is created or updated the write occurs. This element may be changed dynamically. For more information, see "write-through" in the Oracle CEP Developer's Guide for Eclipse.

  • WriteBehind: Specifies asynchronous writes to the cache store. The cache store is invoked from a separate thread after a create or update of a cache entry. This element may be changed dynamically. For more information, see "write-behind" in the Oracle CEP Developer's Guide for Eclipse.

Eviction Policy

Use this element to define the eviction policy the cache uses when Max Size is reached.

Valid values are:

  • FIFO: first in, first out.

  • LRU: least recently used

  • LFU: least frequently used (default)

  • NRU: not recently used

Time To Live

Specifies the maximum amount of time, in milliseconds, that an entry is cached. Default value is 0 (which means infinite).


For more information, see "cache" in the Oracle CEP Developer's Guide for Eclipse.

2.2.2.15 Cache Properties: Oracle Coherence Cache

Figure 2-19 shows the properties for an Oracle Coherence Cache stage.

Figure 2-19 Oracle Coherence Cache Stage Properties

Description of Figure 2-19 follows
Description of "Figure 2-19 Oracle Coherence Cache Stage Properties"

There are no editable properties for this type of stage.

For more information, see:

2.2.3 Recording and Playing Back Events in the EPN

The event repository feature of Oracle CEP allows you to record events flowing through an event processing network (EPN) and store them so you can later play back the events. You configure the recording and playing back of events per stage, such as a processor or stream. Additionally, only events coming out of an event source can be recorded, and playback is possible only on event sinks (events are played back to the inbound side of the event sink stage.)

The only configuration options of record and playback that you can control using Oracle CEP Visualizer are event type, time, and speed.

For detailed information about how event and record playback works and how to configure a component, see "Configuring Event Record and Playback" in the Oracle CEP Developer's Guide for Eclipse.

For an example, see "Event Record and Playback Example" in the Oracle CEP Getting Started.

Alternatively, you can trace and inject events as Section 2.2.4, "Tracing and Injecting Events in the EPN" describes.

This section describes:

2.2.3.1 How to Record Events

Using Oracle CEP Visualizer you can record events for a selected stage. Later, you can playback these events (see Section 2.2.3.2, "How to Playback Events").

To record events:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application you want to record and playback events with.

  3. In the right pane, click the Event Processing Network tab.

    The Event Processor Network panel is displayed as Figure 2-20 shows.

    Figure 2-20 Event Processing Network Panel

    Description of Figure 2-20 follows
    Description of "Figure 2-20 Event Processing Network Panel"

  4. Select the stage for which you wish to record an event:

    1. To use the EPN diagram:

      • Right-click the stage for which you wish to record an event and select Record Event.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to record and playback events with.

      • Click the stage for which you wish to record an event.

      • In the right pane, click the Record tab

    The Record panel appears as shown in Figure 2-21.

    Figure 2-21 The Record Tab

    Description of Figure 2-21 follows
    Description of "Figure 2-21 The Record Tab"

    The Record tab in Oracle CEP Visualizer for a particular stage is divided into the following sections:

    • Recording Current Status: displays the current status of a recording. When the system has begun a recording session, then this field displays a blinking Recording message and it changes back to blank when the recording sessions ends. This section is read-only.

    • Recording Parameters: specifies the name of the database schema (Dataset name) and the provider information. You must pre-configure the provider for the event repository.

      For more information, see:

    • Event Type List: contains the Event Type List pane that displays the list of event types that are associated with a selected stage of the Oracle CEP application. Choose one or more events to record.

    • Record Schedule Entry: entries in this table displays the recording start time and end time for an event type. The fields in this table are disabled by default. Click Update Record to enable the fields in this table. The start and end time entries are optional fields, to start recording immediately, click the Start Recording button at the bottom of the panel.

    • Change Recording Schedule: allows you to change some of the properties of your existing recording entry. Certain properties, such as the event type, cannot be changed using Oracle CEP Visualizer. Use the calendar and clock controls to specify or change an existing start and end time for recording events.

  5. Decide what you want to do:

    1. To add a new record schedule entry, click Add.

    2. To modify an existing record schedule entry, select the entry in the Record Schedule Entry table and click Edit.

    3. To delete an existing record schedule entry, select the entry in the Record Schedule Entry table and click Delete.

  6. Configure the Recording Parameters:

    • DataSet Name: the value of the record-parameters child element dataset-name element from the simpleEventSource adapter application configuration file ORACLE-CEP-HOME\ocep_11.1\samples\domains\recplay_domain\defaultserver\applications\recplay\config.xml as Example 2-1 shows.

      Example 2-1 recplay Application Configuration File config.xml: adapter Element

      <adapter>
          <name>simpleEventSource</name>
          <record-parameters>
              <dataset-name>recplay_sample</dataset-name>
              <event-type-list>
                  <event-type>SimpleEvent</event-type>
              </event-type-list>
              <provider-name>test-rdbms-provider</provider-name>
              <batch-size>1</batch-size>
              <batch-time-out>10</batch-time-out>
          </record-parameters>
      </adapter>
      
    • Provider Name: the value of the rdbms-event-store-provider child element name which corresponds to the data-source child element name as Example 2-2 shows.

      When using the default Berkeley database provider, select default provider.

      Example 2-2 recplay Oracle CEP Server Configuration File config.xml: data-source and rdbms-event-store-provider Elements

      <data-source>
          <name>derby1</name>
          <connection-pool-params>
              <initial-capacity>15</initial-capacity>
              <max-capacity>50</max-capacity>
          </connection-pool-params>
          <driver-params>
              <url>jdbc:derby:dbtest1;create=true</url>
              <driver-name>org.apache.derby.jdbc.EmbeddedDriver</driver-name>
          </driver-params>
      </data-source>
      <rdbms-event-store-provider>
          <name>test-rdbms-provider</name>
          <data-source-name>derby1</data-source-name>
      </rdbms-event-store-provider>
      

      For more information, see Section 3.5, "Managing Data Sources".

  7. Configure the Event type list:

    Use the left and right-pointing arrow buttons to move the events you want recorded from the Available event list to the Recorded event list.

    For more information, see Section 3.7, "Managing the Event Type Repository".

  8. Decide when you want recording to start and end:

    1. If you want to schedule a record start and end time:

    2. If you want to record events immediately:

    Oracle CEP Visualizer keeps track of whether a particular stage is currently recording or playing back events; based on this information, the Start and End buttons may be enabled or disabled as appropriate.

    When you start recording using Oracle CEP Visualizer, Oracle CEP uses the event type information from your record entry and begins recording immediately; the pre-scheduled time, if any, remains unchanged. Use the End button to stop recording of your session immediately.

  9. Decide when you want to stop recording:

    1. If you scheduled a stop time, event recording will stop at that time.

    2. If you want to stop event recording immediately, click Stop.

2.2.3.2 How to Playback Events

Using Oracle CEP Visualizer you can playback previously recorded events (see Section 2.2.3.2, "How to Playback Events") for a selected stage.

To playback events:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application you want to record and playback events with.

  3. In the right pane, click the Event Processing Network tab.

    The Event Processor Network panel is displayed as Figure 2-24 shows.

    Figure 2-24 Event Processing Network Panel

    Description of Figure 2-24 follows
    Description of "Figure 2-24 Event Processing Network Panel"

  4. Select the stage for which you wish to playback an event:

    1. To use the EPN diagram:

      • Right-click the stage for which you wish to record an event and select Playback Event.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to record and playback events with.

      • Click the stage for which you wish to record an event.

      • In the right pane, click the Playback tab

    The Record panel appears as shown in Figure 2-25.

    Figure 2-25 The Playback Tab

    Description of Figure 2-25 follows
    Description of "Figure 2-25 The Playback Tab"

    The Playback tab in Oracle CEP Visualizer for a particular stage is divided into the following sections:

    • Playback Current Status: displays the current status of playback. When the system has begun playing back a session, then this field displays a blinking Playback message and it changes back to blank when the playback session ends. This section is read-only.

    • Playback Parameters: specifies the name of the database schema (Dataset name) and the provider information. You must pre-configure the provider for the event repository.

      For more information, see:

    • Event Type List: contains the Event Type List pane that displays the list of event types that are associated with a selected stage of the Oracle CEP application. Choose one or more events to playback.

    • Playback Filter Entry: specify a set of filters using the clock and time controls, to run a playback for an event type in event type repository. Only events that were recorded during the start and end times you specify here will be played back.

    • Playback Schedule Entry: entries in this table displays the playback start time and end time for an event type. The fields in this table are disabled by default. Click Update Playback to enable the fields in this table. The start and end time entries are optional fields, to start recording immediately, click the Start Playback button at the bottom of the panel.

    • Change Playback Filter Parameters: allows you to change some of the properties of the selected playback filter entry.

    • Change Playback Schedule Parameters: allows you to change some of the properties of the selected playback schedule entry. Use the calendar and clock controls to specify or change an existing start and end time for playing back events.

  5. Configure the Playback Parameters:

    • DataSet Name: the value of the record-parameters child element dataset-name element from the simpleEventSource adapter application configuration file ORACLE-CEP-HOME\ocep_11.1\samples\domains\recplay_domain\defaultserver\applications\recplay\config.xml as Example 2-3 shows.

      Example 2-3 recplay Application Configuration File config.xml: stream Element

      <stream>
          <name>eventStream</name>
          <playback-parameters>
              <dataset-name>recplay_sample</dataset-name>
              <event-type-list>
                  <event-type>SimpleEvent</event-type>
              </event-type-list>
              <provider-name>test-rdbms-provider</provider-name>
          </playback-parameters>
          <max-size>10000</max-size>
          <max-threads>2</max-threads>
      </stream> 
      
    • Provider Name: the value of the rdbms-event-store-provider child element name which corresponds to the data-source child element name as Example 2-4 shows.

      When using the default Berkeley database provider, select default provider.

      Example 2-4 recplay Oracle CEP Server Configuration File config.xml: data-source and rdbms-event-store-provider Elements

      <data-source>
          <name>derby1</name>
          <connection-pool-params>
              <initial-capacity>15</initial-capacity>
              <max-capacity>50</max-capacity>
          </connection-pool-params>
          <driver-params>
              <url>jdbc:derby:dbtest1;create=true</url>
              <driver-name>org.apache.derby.jdbc.EmbeddedDriver</driver-name>
          </driver-params>
      </data-source>
      <rdbms-event-store-provider>
          <name>test-rdbms-provider</name>
          <data-source-name>derby1</data-source-name>
      </rdbms-event-store-provider>
      

      For more information, see Section 3.5, "Managing Data Sources".

  6. Configure the Event type list:

    Use the left and right-pointing arrow buttons to move the events you want played back from the Available event list to the Playback event list.

    For more information, see Section 3.7, "Managing the Event Type Repository".

  7. Decide what you want to do:

    1. To add a new playback schedule entry, click Add.

    2. To modify an existing playback filter entry, select the entry in the Playback Filter Entry table and click Edit.

    3. To modify an existing playback schedule entry, select the entry in the Playback Schedule Entry table and click Edit.

    4. To delete an existing playback filter or schedule entry, select the entry in the appropriate table and click Delete.

  8. Decide when you want playback to start and end:

    1. If you want to create a new playback filter entry:

    2. If you want to create a new playback schedule entry:

      • Click the calendar and clock controls in the Change Playback Schedule Parameters area to add a start time and end time and to specify a speed and repeat mode.

        Speed: the default speed value is 1, which corresponds to normal speed. A value of 2 means that events will be played back 2 times faster than the original record speed. Similarly, a value of 0.5 means that events will be played back at half the speed.

        Repeat: set this to true to repeat playback until the scheduled end time or until you stop playback manually; set this to false to playback only once.

      • Click Save.

        An alert dialog appears as Figure 2-27 shows.

        Figure 2-27 Playback Schedule Confirmation Dialog

        Description of Figure 2-27 follows
        Description of "Figure 2-27 Playback Schedule Confirmation Dialog"

      • Click OK.

    3. If you want to playback events immediately:

    Oracle CEP Visualizer keeps track of whether a particular stage is currently recording or playing back events; based on this information, the Start and End buttons may be enabled or disabled as appropriate.

    When you start playback using Oracle CEP Visualizer, Oracle CEP uses the event type information from your playback entry and begins playback immediately; the pre-scheduled time, if any, remains unchanged. Use the End button to stop playback session immediately.

  9. Decide when you want to stop playback:

    1. If you scheduled a stop time, event playback will stop at that time.

    2. If you want to stop event playback immediately, click Stop.

2.2.4 Tracing and Injecting Events in the EPN

Using the Event Inspector service and the stream visualizer, you can:

  • Trace events on any HTTP pub-sub server channel.

  • Trace events on any stage in the EPN on the Event Inspector service dynamic HTTP pub-sub server channel.

  • Inject events to any HTTP pub-sub server channel

  • Inject events into any stage in the EPN using the Event Inspector service dynamic HTTP pub-sub server channel.

Note:

The Event Inspector service is not for use on a production Oracle CEP server. It is for use only during development.

This section describes:

For more information, see:

Alternatively, you can record and playback events as Section 2.2.3, "Recording and Playing Back Events in the EPN" describes.

2.2.4.1 How to Trace Events on a Dynamic Channel

You can use Oracle CEP Visualizer to view the messages that are currently being published to a static channel.

For more information, see Section 3.1.5, "HTTP Publish-Subscribe Server".

To trace events on a dynamic channel:

  1. Optionally, configure the HTTP pub-sub server to use to trace events.

    See Section 3.10, "Managing the Event Inspector Service".

  2. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  3. Select appname, where appname is the name of the application you want to record and playback events with.

  4. In the right pane, click the Event Processing Network tab.

    The Event Processor Network panel is displayed as Figure 2-24 shows.

    Figure 2-29 Event Processing Network Panel

    Description of Figure 2-29 follows
    Description of "Figure 2-29 Event Processing Network Panel"

  5. Select the stage for which you wish to trace events:

    1. To use the EPN diagram:

      • Right-click the stage for which you wish to record an event and select Trace Event.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to record and playback events with.

      • Click the stage for which you wish to record an event.

      • In the right pane, click the Trace Event tab

    The Trace Event panel appears as shown in Figure 2-30.

    Figure 2-30 The Trace Event Tab: Start

    Description of Figure 2-30 follows
    Description of "Figure 2-30 The Trace Event Tab: Start"

  6. Click Start.

    An alert dialog appears as Figure 2-31 shows.

    Figure 2-31 Trace Event Confirmation Dialog

    Description of Figure 2-31 follows
    Description of "Figure 2-31 Trace Event Confirmation Dialog"

  7. Click OK.

    The Status field reads ON.

    The Channel Name field shows the dynamic channel on which events passing through this stage are written. The Event Inspector service HTTP pub-sub channel is named:

    /SERVERNAME/APPLICATIONNAME/STAGENAME/output
    

    Where:

    • SERVERNAME: the name of the Oracle CEP server on which the application and stage you want to trace are executing.

    • APPLICATIONNAME: the name of the Oracle CEP application that owns the stage you want to trace.

    • STAGENAME: the name of the the Oracle CEP application stage you want to trace.

    For example: /NonClusteredServer/cql/orderCSVAdapter/output.

  8. In the top pane, click Viewstream.

    The Stream Visualizer panel appears as Figure 2-32 shows.

    Figure 2-32 Stream Visualizer: Subscribe

    Description of Figure 2-32 follows
    Description of "Figure 2-32 Stream Visualizer: Subscribe"

  9. In the PubSub Server Name pull down menu, select the name of the HTTP pub-sub server to use to trace events.

  10. Click Initialize Client.

  11. Select the Subscribe tab.

  12. Click Refresh.

    The Subscribe tab is refreshed to show the dynamic channel for your stage.

  13. Click the radio button next to the name of the channel to which the Oracle CEP server is publishing messages.

    For example: /NonClusteredServer/cql/orderCSVAdapter/output.

  14. Click Subscribe.

    The Output messages received from subscription text box displays events being published to the channel.

    Note:

    If the Oracle CEP Visualizer fails to subscribe to the channel and displays an error in the Debug Messages area such as:
    14:25:54 GMT-0400: httpFaultHandler(): [RPC Fault faultString="Error #2096" faultCode="InvokeFailed" faultDetail="null"]
    

    Then, confirm the following:

  15. To clear the Output messages received from subscription text , click Clear Text.

  16. To unsubscribe from the channel, click Unsubscribe.

  17. To stop event trace, select the stage you configured to trace events:

    1. To use the EPN diagram:

      • Right-click the stage for which you wish to record an event and select Trace Event.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to record and playback events with.

      • Click the stage for which you wish to record an event.

      • In the right pane, click the Trace Event tab

    The Trace Event panel appears as shown in Figure 2-30.

    Figure 2-33 The Trace Event Tab: Stop

    Description of Figure 2-33 follows
    Description of "Figure 2-33 The Trace Event Tab: Stop"

  18. Click Stop.

    An alert dialog appears as Figure 2-34 shows.

    Figure 2-34 Trace Event Stop Confirmation Dialog

    Description of Figure 2-34 follows
    Description of "Figure 2-34 Trace Event Stop Confirmation Dialog"

  19. Click OK.

    The Status field reads OFF.

    The Channel Name field is blank.

2.2.4.2 How to Inject a Simple Event on an Event Inspector Service Dynamic Channel

You can inject a single, simple event by type into any stage in the EPN using the Event Inspector service dynamic channel.

The Oracle CEP Visualizer only supports simple event types whose properties are all simple Java types without nested Java objects. Event properties must be restricted to the following types:

  • primitive Java types

  • Java array or collection with simple Java type values

  • Date

  • BigDecimal

  • BigInteger

Alternatively, you can inject an event with more complex properties by specifying the event as a JSON message. For more information, see Section 2.2.4.3, "How to Inject an Event as a JSON String on an Event Inspector Service Dynamic Channel".

Note:

The Event Inspector service is not for use on a production Oracle CEP server. It is for use only during development.

To inject a simple event on an Event Inspector service dynamic channel:

  1. Optionally, configure the HTTP pub-sub server to use to trace events.

    See Section 3.10, "Managing the Event Inspector Service".

  2. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  3. Select appname, where appname is the name of the application you want to record and playback events with.

  4. In the right pane, click the Event Processing Network tab.

    The Event Processor Network panel is displayed as Figure 2-24 shows.

    Figure 2-35 Event Processing Network Panel

    Description of Figure 2-35 follows
    Description of "Figure 2-35 Event Processing Network Panel"

  5. Select the stage for which you wish to inject events:

    1. To use the EPN diagram:

      • Right-click the stage for which you wish to record an event and select Inject Event.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to record and playback events with.

      • Click the stage for which you wish to record an event.

      • In the right pane, click the Inject Event tab

    The Inject Event panel appears as shown in Figure 2-30.

    Figure 2-36 The Inject Event Tab: Start

    Description of Figure 2-36 follows
    Description of "Figure 2-36 The Inject Event Tab: Start"

  6. Click Start.

    An alert dialog appears as Figure 2-31 shows.

    Figure 2-37 Inject Event Start Confirmation Dialog

    Description of Figure 2-37 follows
    Description of "Figure 2-37 Inject Event Start Confirmation Dialog"

  7. Click OK.

    The Status field reads ON.

    The Channel Name field shows the dynamic channel on which events passing through this stage are injected. The Event Inspector service HTTP pub-sub channel is named:

    /SERVERNAME/APPLICATIONNAME/STAGENAME/input
    

    Where:

    • SERVERNAME: the name of the Oracle CEP server on which the application and stage you want to trace are executing.

    • APPLICATIONNAME: the name of the Oracle CEP application that owns the stage you want to trace.

    • STAGENAME: the name of the the Oracle CEP application stage you want to trace.

    For example: /NonClusteredServer/cql/orderCSVAdapter/input.

  8. In the top pane, click Viewstream.

    The Viewstream panel appears as Figure 2-38 shows.

    Figure 2-38 Stream Visualizer: Publish

    Description of Figure 2-38 follows
    Description of "Figure 2-38 Stream Visualizer: Publish"

  9. In the PubSub Server Name pull down menu, select the name of the HTTP pub-sub server to use to trace events.

  10. Click Initialize Client.

  11. Select the Publish tab.

  12. Click Refresh.

    The Publish tab is refreshed to show the dynamic channel for your stage.

  13. Click the radio button next to the name of the channel to which the Oracle CEP server will inject messages.

    For example: /NonClusteredServer/cql/orderCSVAdapter/output.

  14. From the Input Method radio button group, select Form Based Event.

  15. From the Event Type pull down menu, select an event type.

    The View Stream panel updates to list the attributes of the event type you select.

    For example, Figure 2-38 shows the attributes for the DataStockTick event, which include:

    • Price

    • Symbol

    • PercChange

    • Volume

    • LastPrice

    Note:

    The View Stream Event Type pull down menu lists all the events defined in the event type repository that meet the restrictions that Section 2.2.4.2, "How to Inject a Simple Event on an Event Inspector Service Dynamic Channel" describes. To inject a more complex events, see Section 2.2.4.3, "How to Inject an Event as a JSON String on an Event Inspector Service Dynamic Channel".
  16. Configure the attributes for the event type you selected.

    Hover your mouse over an attribute field to display a tool tip that indicates the data type for the attribute.

  17. Click Publish.

    Oracle CEP Visualizer publishes the event on the Event Inspector service dynamic channel and it is received and processed by the stage that the channel identifies.

  18. To stop event injection, select the stage you configured for event injection:

    1. To use the EPN diagram:

      • Right-click the stage for which you wish to record an event and select Inject Event.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to record and playback events with.

      • Click the stage for which you wish to record an event.

      • In the right pane, click the Inject Event tab

    The Inject Event panel appears as shown in Figure 2-39.

    Figure 2-39 The Inject Event Tab: Stop

    Description of Figure 2-39 follows
    Description of "Figure 2-39 The Inject Event Tab: Stop"

  19. Click Stop.

    An alert dialog appears as Figure 2-31 shows.

    Figure 2-40 Inject Event Stop Confirmation Dialog

    Description of Figure 2-40 follows
    Description of "Figure 2-40 Inject Event Stop Confirmation Dialog"

  20. Click OK.

    The Status field reads OFF.

    The Channel Name field is blank.

2.2.4.3 How to Inject an Event as a JSON String on an Event Inspector Service Dynamic Channel

You can inject a single event directly to the HTTP pub-sub channel as a JSON-formatted character string.

You can use any event property that JSON can represent.

For details on the Event Inspector service JSON event structure and mandatory attributes, see "Event Inspector Event Types" in the Oracle CEP Developer's Guide for Eclipse.

Alternatively, you can inject a simple, pre-existing event. For more information, see Section 2.2.4.2, "How to Inject a Simple Event on an Event Inspector Service Dynamic Channel".

Note:

The Event Inspector service is not for use on a production Oracle CEP server. It is for use only during development.

To inject an event as a JSON string on an Event Inspector service dynamic channel:

  1. Optionally, configure the HTTP pub-sub server to use to trace events.

    See Section 3.10, "Managing the Event Inspector Service".

  2. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  3. Select appname, where appname is the name of the application you want to record and playback events with.

  4. In the right pane, click the Event Processing Network tab.

    The Event Processor Network panel is displayed as Figure 2-24 shows.

    Figure 2-41 Event Processing Network Panel

    Description of Figure 2-41 follows
    Description of "Figure 2-41 Event Processing Network Panel"

  5. Select the stage for which you wish to inject events:

    1. To use the EPN diagram:

      • Right-click the stage for which you wish to record an event and select Inject Event.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to record and playback events with.

      • Click the stage for which you wish to record an event.

      • In the right pane, click the Inject Event tab

    The Inject Event panel appears as shown in Figure 2-30.

    Figure 2-42 The Inject Event Tab: Start

    Description of Figure 2-42 follows
    Description of "Figure 2-42 The Inject Event Tab: Start"

  6. Click Start.

    An alert dialog appears as Figure 2-31 shows.

    Figure 2-43 Inject Event Start Confirmation Dialog

    Description of Figure 2-43 follows
    Description of "Figure 2-43 Inject Event Start Confirmation Dialog"

  7. Click OK.

    The Status field reads ON.

    The Channel Name field shows the dynamic channel on which events passing through this stage are injected. The Event Inspector service HTTP pub-sub channel is named:

    /SERVERNAME/APPLICATIONNAME/STAGENAME/input
    

    Where:

    • SERVERNAME: the name of the Oracle CEP server on which the application and stage you want to trace are executing.

    • APPLICATIONNAME: the name of the Oracle CEP application that owns the stage you want to trace.

    • STAGENAME: the name of the the Oracle CEP application stage you want to trace.

    For example: /NonClusteredServer/cql/orderCSVAdapter/input.

  8. In the top pane, click Viewstream.

    The Viewstream panel appears as Figure 2-44 shows.

    Figure 2-44 Stream Visualizer: Publish

    Description of Figure 2-44 follows
    Description of "Figure 2-44 Stream Visualizer: Publish"

  9. In the PubSub Server Name pull down menu, select the name of the HTTP pub-sub server to use to trace events.

  10. Click Initialize Client.

  11. Select the Publish tab.

  12. Click Refresh.

    The Publish tab is refreshed to show the dynamic channel for your stage.

  13. Click the radio button next to the name of the channel to which the Oracle CEP server will inject messages.

    For example: /NonClusteredServer/cql/orderCSVAdapter/output.

  14. From the Input Method radio button group, select Json String.

  15. Enter a JSON-formatted string in the text field as Example 2-5 shows.

    Example 2-5 JSON-Formatted Event String

    {
        "event-type": "myEventType",
        "operation": "insert",
        "binding": "outbound",
        "value":{
            "firstname": "Jane",
            "lastname": "Doe",
            "phone": {
                "code": 12345,
                "number": "office"
            },
        }
    }
    

    For complete details on the Event Inspector service JSON event structure and mandatory attributes, see "Event Inspector Event Types" in the Oracle CEP Developer's Guide for Eclipse.

  16. Click Publish.

    Oracle CEP Visualizer publishes the event on the Event Inspector service dynamic channel and it is received and processed by the stage that the channel identifies.

  17. To stop event injection, select the stage you configured for event injection:

    1. To use the EPN diagram:

      • Right-click the stage for which you wish to record an event and select Inject Event.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to record and playback events with.

      • Click the stage for which you wish to record an event.

      • In the right pane, click the Inject Event tab

    The Inject Event panel appears as shown in Figure 2-39.

    Figure 2-45 The Inject Event Tab: Stop

    Description of Figure 2-45 follows
    Description of "Figure 2-45 The Inject Event Tab: Stop"

  18. Click Stop.

    An alert dialog appears as Figure 2-31 shows.

    Figure 2-46 Inject Event Stop Confirmation Dialog

    Description of Figure 2-46 follows
    Description of "Figure 2-46 Inject Event Stop Confirmation Dialog"

  19. Click OK.

    The Status field reads OFF.

    The Channel Name field is blank.

2.2.5 Monitoring a Channel Stage in the EPN

You can use Oracle CEP Visualizer to monitor any channel stage (stream) of the event processing network (EPN) of an application. Oracle CEP defines the following metrics that you can monitor for each channel:

  • size: the number of events in the channel's queue.

To monitor a channel in the EPN:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application you want to record and playback events with.

  3. In the right pane, click the Channel Monitor tab.

    The Channel Monitor tab appears as Figure 2-47 shows.

    Figure 2-47 Channel Monitor Tab

    Description of Figure 2-47 follows
    Description of "Figure 2-47 Channel Monitor Tab"

  4. To monitor a channel, click on a channel in the All Channels list and drag and drop it onto one of the four graphs in the Channel Monitor tab.

    The channel name is added to a color-coded legend below the graph. The color corresponds to the channel's line in the graph.

    The channel name is also added to the Monitored Channels list.

    You can display all channels on one graph or distribute channels amongst the four graphs in any combination.

  5. To change the scale of the graphs, click on the slider to the left of the vertical axis and drag it up or down.

  6. To stop monitoring a channel, click the Remove button associated with it in the Monitored Channels list.

2.2.6 Monitoring the Throughput and Latency of a Stage or Path in the EPN

You can use Oracle CEP Visualizer to monitor the entry and exit points of a stage, or a specified path, of the event processing network (EPN) of an application. Oracle CEP defines the following metrics that you can monitor for each stage or path:

  • Throughput: The number of events processed by the stage.

  • Average Latency: The average amount of time it takes an event to pass through a specified path of the EPN, or latency.

  • Maximum Latency: The maximum amount of time it takes an event to pass through a specified path of the EPN.

  • Average Latency Threshold: Calculates the average latency values greater than the specified threshold value for specified start and end points.

The Oracle CEP Visualizer monitoring feature is itself implemented as an Oracle CEP application; this means that the diagnostic information can be viewed as an event, and the application uses EPL rules to process these diagnostic events.

To monitor the throughput and latency of a stage or path in the EPN:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application you want to record and playback events with.

  3. Select the stage you wish to view and configure:

    1. To use the EPN diagram:

      • Click the Event Processing Network tab.

      • Double-click the stage you wish to monitor or the first stage in the path that you want to monitor.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to monitor.

      • Click the stage you wish to monitor or the first stage in the path that you want to monitor.

      • In the right pane, click the General tab

    The stage's General tab appears. For example, Figure 2-48 shows the General tab for a channel.

    Figure 2-48 General Tab for Channel Stage

    Description of Figure 2-48 follows
    Description of "Figure 2-48 General Tab for Channel Stage"

  4. Click the Create Diagnostics button.

    A New Latency Profile accordion menu appears as shown in Figure 2-49. It contains the following tabs:

    • Profile Information

    • Latency

    • Throughput

  5. Click the Profile Information tab in the accordion menu as shown in Figure 2-49 and enter the information that Table 2-5 lists.

    Figure 2-49 New Latency Profile Screen - Profile Information Tab

    Description of Figure 2-49 follows
    Description of "Figure 2-49 New Latency Profile Screen - Profile Information Tab"

    Table 2-5 Profile Information Attributes

    Attribute Description

    Profile Name

    The name of the diagnostic profile that you want to create.

    State

    Select On if you want to enable the profile for immediate use.

    Select Off if you do not want to enable the profile for immediate use.


  6. Click the Latency tab in the accordion menu as shown in Figure 2-50 and enter the information that Table 2-6 lists.

    Figure 2-50 New Latency Profile Screen - Latency Tab

    Description of Figure 2-50 follows
    Description of "Figure 2-50 New Latency Profile Screen - Latency Tab"

    Table 2-6 Latency Attributes

    Attribute Description

    Max Latency Metric

    Specifies that you want to monitor the maximum amount of time it takes for events to flow through a stage or a subset of the event processing network (path).

    Average Latency Metric

    Specifies that you want to monitor the average amount of time it takes for events to flow through a stage or a subset of the event processing network (path)

    Average Collection Interval

    Specifies the time interval for which you want to gather diagnostic data. In other words, the sliding window across which the Average Latency Metric is computed.

    This value is enabled only if you specify Max Latency Metric.

    Threshold

    Specify a value if you are interested in only receiving latency metrics that exceed a certain value. For example, if you would like to know when the latency exceeds 250 ms, specify a Threshold value of 250 ms.

    This value is enabled only if you specify Average Latency Metric.

    Start Stage Name

    Specifies the name that you have provided for the start stage.

    If you want to monitor just the current stage, rather than a path in the EPN, then set the Start Stage Name and End Stage Name to the name of the current stage.

    Select Entry for the Start Stage Name option and Exit for the End Stage Name.

    End Stage Name

    Specifies the name that you have provided for the end stage.

    If you want to monitor a path in the EPN, Oracle CEP Visualizer assumes that the current stage is the start of the path, and thus automatically selects it for the Start Stage Name field.

    Specify whether the start of the path should be the Entry or Exit of the current stage. Then, select the End Stage Name, or the end of the path you want to monitor, and specify whether the end of the path should be the Entry or Exit of the stage


  7. Click the Latency tab in the accordion menu as shown in Figure 2-50 and enter the information that Table 2-6 lists.

    Figure 2-51 New Latency Profile Screen - Throughput Tab

    Description of Figure 2-51 follows
    Description of "Figure 2-51 New Latency Profile Screen - Throughput Tab"

    Table 2-7 Throughput Attributes

    Attribute Description

    Average Throughput Metric

    Specifies that you want to monitor the average throughput of events flowing through the stage.

    Stage Name

    Specify whether you want to monitor the throughput at the entry or exit of the stage

    Throughput Interval

    Specifies the period of time for which the throughput is calculated.

    For example, if you specify a Throughput Interval of 1 second, the number of events passing through the stage in 1 second will be calculated. This will be averaged over the Average Interval you specify.

    Specify the time unit as Second, Millisecond, or Microsecond.

    Average Interval

    Specifies the interval for gathering the average throughput.

    For example, if you specify a Throughput Interval of 1 second, the number of events passing through the stage in 1 second will be calculated. This will be averaged over the Average Interval you specify.

    Specify the time unit as Second, Millisecond, or Microsecond.


  8. Click Save.

    A pop-up confirmation dialog appears in the lower-right corner of the panel.

    The saved diagnostic profile appears in the left domain tree, under the stage from which you created it, as shown in Figure 2-52.

    Figure 2-52 Left Domain Tree - Mydiagprofile

    Description of Figure 2-52 follows
    Description of "Figure 2-52 Left Domain Tree - Mydiagprofile"

    Note:

    You can now restart a server or undeploy an application without losing the diagnostic profile you created.
  9. Click OK.

  10. Add the diagnostic profile to the Oracle CEP Visualizer Dashboard:

    1. Select the diagnostic profile in the left domain tree and click the Add to Dashboard button.

    2. Click the Dashboard link at the top of Oracle CEP Visualizer and drag and drop the diagnostic profile you created from the domain tree in the left pane to the table at the bottom of the right pane.

  11. Click the Dashboard link at the top of Oracle CEP Visualizer.

    The Dashboard screen is displayed with the Management Events and Performance Monitoring panes as Figure 2-53 shows.

  12. Click the name of the diagnostic profile in the table.

    The latency and throughput information is displayed in the graphs in the middle of the dashboard as Figure 2-53 shows.

    Figure 2-53 Oracle CEP Visualizer Dashboard With Diagnostic Profiles

    Description of Figure 2-53 follows
    Description of "Figure 2-53 Oracle CEP Visualizer Dashboard With Diagnostic Profiles"

  13. To expand the performance monitoring graphs to fill the screen, click Expand Chart.

  14. To restore the performance monitoring graphs to their original size, click Restore Chart.

The Management Events section at the top of the Dashboard displays alerts about the incoming monitoring events. The Oracle CEP monitoring feature defines a set of default EPL rules that specify when these alerts show up in the Management Events table. You can change the EPL rules to customize this behavior, as described in Section 2.5.4, "Changing the dataservices Application Event Filter Rule Using EPL."

2.3 Managing Application Lifecycle

This section describes:

For more information, see Section 2.1.2, "Application Lifecycle".

2.3.1 Deploying an Application in a Standalone-Server Domain

Deploying an application refers to uploading to the server the JAR file that contains the application and then installing it, which makes it available to clients.

Oracle CEP internally deploys an application as a two step processes. The first step involves starting the application bundle inside the OSGi container. The second step involves starting and initializing the application. Because the second step is asynchronous in nature, Oracle CEP Visualizer does not wait for the completion of the second operation. As soon as the application has successfully started, the Oracle CEP Visualizer navigation tree is updated automatically with the new deployment and a successful message will be sent to the dashboard. However, if the application fails to start, you must check for errors on the server side because no messages/updates will occur on the Oracle CEP Visualizer.

When you deploy an application, the Oracle CEP server starts a new configuration history for it. See Section 2.1.4, "Configuration History Management".

This section describes how to deploy an application to a standalone-server domain. For information on deploying an application in a multi-server domain, see Section 2.3.2, "Deploying an Application in a Multi-Server Domain".

To deploy an application in a standalone-server domain:

  1. In the left pane, navigate to and select the Deployment node.

    The Deployed Applications table is displayed in the Deployment screen on the right pane.

  2. Click the Install button.

    The Install Application screen is displayed.

  3. Click the Upload tab.

  4. Click the ... button to open a file browsing window.

  5. Browse to the local directory that contains the JAR file of the application you want to install and click Open.

  6. Click Upload.

    In the Install Application tab, the JAR file appears in the table of uploaded files, as shown in Figure 2-54.

    Figure 2-54 The Install Application Screen: Standalone-Server Domain

    Description of Figure 2-54 follows
    Description of "Figure 2-54 The Install Application Screen: Standalone-Server Domain"

  7. If you want the application JAR file removed from the Oracle CEP server after deploying, check the Remove file after deploy check box.

    In this case, you must upload the application JAR file again if you want to redeploy this application.

  8. Select your application in the table and click Deploy.

    The Review Deployment Information screen is displayed, as shown in Figure 2-55.

    Figure 2-55 The Review Deployment Information Screen: Standalone-Server Domain

    Description of Figure 2-55 follows
    Description of "Figure 2-55 The Review Deployment Information Screen: Standalone-Server Domain"

  9. Click OK.

    Your application is deployed and ready for use.

2.3.2 Deploying an Application in a Multi-Server Domain

Deploying an application refers to uploading to the server the JAR file that contains the application and then installing it, which makes it available to clients.

Oracle CEP internally deploys an application as a two step processes. The first step involves starting the application bundle inside the OSGi container. The second step involves starting and initializing the application. Because the second step is asynchronous in nature, Oracle CEP Visualizer does not wait for the completion of the second operation. As soon as the application has successfully started, the Oracle CEP Visualizer navigation tree is updated automatically with the new deployment and a successful message will be send to the dashboard. However, if the application fails to start, you must check for errors on the server side because no messages/updates will occur on the Oracle CEP Visualizer.

When you deploy an application, the Oracle CEP server starts a new configuration history for it. See Section 2.1.4, "Configuration History Management".

This section describes how to deploy an application to a multi-server domain. For information on deploying an application in a standalone-server domain, see Section 2.3.1, "Deploying an Application in a Standalone-Server Domain".

For more information, see Section 3.9, "Managing Multi-Server Domains".

To deploy an application in a multi-server domain:

  1. In the left pane, navigate to and select the Deployment node.

    The Deployed Applications table is displayed in the Deployment screen on the right pane.

  2. Click the Install button.

    The Install Application screen is displayed.

  3. Click the Upload tab.

  4. Click the ... button to open a file browsing window.

  5. Browse to the local directory that contains the JAR file of the application you want to install and click Open.

  6. Click Upload.

    In the Install Application tab, the JAR file appears in the table of uploaded files, as shown in Figure 2-56.

    Figure 2-56 The Install Application Screen: Multi-Server Domain

    Description of Figure 2-56 follows
    Description of "Figure 2-56 The Install Application Screen: Multi-Server Domain"

  7. Configure the Select Target Group to Deploy field.

    The group name appears in the Target Group to Deploy field.

    To unselect this selection, click the Clear Group button.

  8. Select your application in the table and click Deploy.

    The Review Deployment Information screen is displayed, as shown in Figure 2-57.

    Figure 2-57 The Review Deployment Information Screen: Multi-Server Domain

    Description of Figure 2-57 follows
    Description of "Figure 2-57 The Review Deployment Information Screen: Multi-Server Domain"

  9. Click OK.

    Oracle CEP Visualizer deploys your application to all servers in the selected target group as Figure 2-58 shows.

    Figure 2-58 HelloWorld Application Deployed to All the Servers in Group testgroup

    Description of Figure 2-58 follows
    Description of "Figure 2-58 HelloWorld Application Deployed to All the Servers in Group testgroup"

2.3.3 Suspending or Resuming an Application

You can temporarily suspend an application from running and resume the operation using the Suspend and Resume operations in the Deployment screen.

To suspend or resume an application:

  1. In the left pane, navigate to Deployment node. The Deployed Applications table is displayed in the Deployment screen on the right pane.

  2. Select the application you want to suspend or resume by checking the box to the left of its name.

  3. Click Suspend to suspend the application or Resume to resume a suspended application.

2.3.4 Updating an Application

You can update your currently existing application with your latest application using the Update operation in the Deployment screen.

When you update an application, the Oracle CEP server erases the application's existing configuration history and starts a new configuration history for it. See Section 2.1.4, "Configuration History Management".

To update an application:

  1. In the left pane, navigate to Deployment node. The Deployed Applications table is displayed in the Deployment screen on the right pane.

  2. Select the application you want to update by checking the box to the left of its name.

  3. Click Update. The Update application screen is displayed.

  4. Click the Upload tab.

  5. Click on the "..." button to invoke a file browsing window, browse to the directory that contains the JAR file of application, and click Open.

  6. Click Upload. In the Update Application tab, the JAR file appears in the table of uploaded files.

  7. Select your application in the table and click OK.

    The existing application is updated with the latest application.

2.3.5 Uninstalling an Application

When you uninstall an application, you completely remove it from the server so that you can no longer access it.

When you uninstall an application, the Oracle CEP server erases the application's existing configuration history. See Section 2.1.4, "Configuration History Management".

To uninstall an application:

  1. In the left pane, navigate to Deployment node. The Deployed Applications table is displayed in the Deployment screen on the right pane.

  2. Select the application you want to uninstall by checking the box to the left of its name.

  3. Click Uninstall.

    You have undeployed the application successfully.

2.4 Managing Oracle CQL Rules

This section describes:

Note:

Any changes to rules and Oracle high availability adapters are propagated to the other servers in the same group. That is, all rule and and Oracle high availability adapter configurations is automatically synchronized. Other configuration changes are not synchronized. For example, if you change record/playback or JMS adapter configuration on one server in a multi-server domain, then these changes are not synchronized with the other servers in the same group. For more information, see Section 3.9, "Managing Multi-Server Domains"

For more information, see:

2.4.1 Creating a Rule in an Oracle CQL Processor Using the Query Wizard

Oracle CEP Visualizer provides a sophisticated Query Wizard to simplify Oracle CQL view and query construction. You can drag and drop Oracle CQL elements to construct a view or query or you can drag and drop a complete Oracle CQL view or query template and customize it to suit your needs. The Oracle CQL Query Wizard is designed to allow business users to efficiently create syntactically correct Oracle CQL views and queries and apply them immediately to a deployed Oracle CEP application.

Using the Query Wizard, you can create Oracle CQL views and query. You cannot create Oracle CQL streams and relations. Your deployed Oracle CEP application must provide the streams and relations. For more information, see Oracle CEP Developer's Guide for Eclipse.

Alternatively, you can modify an existing Oracle CQL view or query; see Section 2.4.2, "Modifying a Rule in an Oracle CQL Processor Using the Query Wizard".

To create a rule in an Oracle CQL processor using the Query Wizard:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application you want to use.

  3. Select the Oracle CQL processor you wish to use:

    1. To use the EPN diagram:

      • Click the Event Processing Network tab.

      • Double-click the Oracle CQL processor you wish to use.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to use.

      • Click the Oracle CQL processor you wish to use.

      • In the right pane, click the General tab

    The Processor panel is displayed as Figure 2-59 shows.

    Figure 2-59 Oracle CQL Processor Panel

    Description of Figure 2-59 follows
    Description of "Figure 2-59 Oracle CQL Processor Panel"

  4. Click the Query Wizard tab.

    The Query Wizard tab appears as Figure 2-130 shows.

    Figure 2-60 Oracle CQL Query Wizard

    Description of Figure 2-60 follows
    Description of "Figure 2-60 Oracle CQL Query Wizard"

    For information on the various tools along the top of the Query Wizard canvas, see Section 2.4.8, "Managing the Query Wizard Diagram".

  5. Decide how you want to create the Oracle CQL statement:

    1. To construct the query based on an existing Oracle CEP server template:

      • Click the Templates tab.

      • Select a template and drag and drop it into the canvas.

    2. To construct the query based on an existing user-defined template:

      • Click the User defined templates tab.

      • Select a template and drag and drop it into the canvas.

      Note:

      For more information about adding user-defined Oracle CQL statement templates, see Section 2.4.7, "Creating an Oracle CQL Template for the Query Wizard".
    3. To construct the query one operator at a time or to add additional operators to a template-based Oracle CQL statement:

      • Click the CQL Constructs tab.

      • Select a construct and drag and drop it into the canvas.

      • Repeat until you have added the required constructs to the canvas.

  6. Configure the connections between constructs:

    1. To connect constructs, click on a source construct and drag to a destination construct.

      Oracle CEP Visualizer only allows interconnections that conform to Oracle CQL syntax.

      Figure 2-61 shows a valid interconnection.

      Figure 2-61 Valid Connection

      Description of Figure 2-61 follows
      Description of "Figure 2-61 Valid Connection"

      Figure 2-62 shows an invalid interconnection.

      Figure 2-62 Invalid Connection

      Description of Figure 2-62 follows
      Description of "Figure 2-62 Invalid Connection"

      For more information about valid Oracle CQL syntax, see "Oracle CQL Statements" in the Oracle CEP CQL Language Reference.

    2. To abandon a connection attempt, click the Esc key on your keyboard.

    3. To delete an existing connection, click on the connection to select it and then click the Delete key on your keyboard.

  7. Configure each construct by double-clicking the construct and using the editor dialog that appears.

    A construct icon without a green check mark is not configured.

    A construct icon with a green check mark is configured.

    For more information, see:

  8. To save your Oracle CQL statement at any time, click the Save Query button.

    The All Saved Queries dialog appears as Figure 2-63 shows.

    The All Saved Queries dialog lists any saved queries for the processor you are configuring.

    Figure 2-63 All Saved Queries Dialog: Saving

    Description of Figure 2-63 follows
    Description of "Figure 2-63 All Saved Queries Dialog: Saving"

  9. Enter a query name in the Query Id field and click Save.

    A confirmation dialog appears as Figure 2-64 shows.

    Figure 2-64 Query Save Dialog

    Description of Figure 2-64 follows
    Description of "Figure 2-64 Query Save Dialog"

  10. Click OK.

    Your query is saved to the local disk of the computer you are currently using. To reload your query, you must access the Oracle CEP Visualizer from the same local host.

  11. To reload your Oracle CQL statement after saving, click the Open Query button.

    The All Saved Queries dialog appears as Figure 2-65 shows.

    Figure 2-65 All Saved Queries Dialog: Loading

    Description of Figure 2-65 follows
    Description of "Figure 2-65 All Saved Queries Dialog: Loading"

  12. Select your query and click Load CQL.

    The Oracle CQL statement is loaded to the canvas.

  13. To inject your Oracle CQL statement into the Oracle CQL processor, edit the Output CQL construct and click Inject Rule.

    The rule now appears on the CQL Rules tab.

    For more information, see Section 2.4.6.16, "Configuring an Output CQL Construct".

  14. After you create a query, update the selector for the outbound channel (the channel down-stream from the Oracle CQL processor you created your query on). This will only work with pre-existing event types.

    For more information, see Section 2.2.2.2, "Channel Properties: Outbound Channel".

2.4.2 Modifying a Rule in an Oracle CQL Processor Using the Query Wizard

Oracle CEP Visualizer provides a sophisticated Query Wizard to simplify Oracle CQL query construction. You can select an existing query on the CQL Query tab and edit the query in the Query Wizard. The Oracle CQL Query Wizard is designed to allow business users to efficiently create syntactically correct Oracle CQL queries and apply them to a deployed Oracle CEP application.

Query Wizard will import a given rule and display it graphically as a set of Oracle CQL operators. You can go into an individual operator and make changes (for example, to change the select expression) without affecting other parts of the Oracle CQL statement.

You can edit existing Oracle CQL queries and views. You cannot edit Oracle CQL streams and relations. Your deployed Oracle CEP application must provide the streams and relations. For more information, see Oracle CEP Developer's Guide for Eclipse.

To modify a rule in an Oracle CQL processor using the Query Wizard:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application you want to use.

  3. Select the Oracle CQL processor you wish to use:

    1. To use the EPN diagram:

      • Click the Event Processing Network tab.

      • Double-click the Oracle CQL processor you wish to use.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to use.

      • Click the Oracle CQL processor you wish to use.

      • In the right pane, click the General tab

    The Processor panel is displayed as Figure 2-59 shows.

    Figure 2-66 Oracle CQL Processor Panel

    Description of Figure 2-66 follows
    Description of "Figure 2-66 Oracle CQL Processor Panel"

  4. Click the CQL Rules tab.

    The CQL Rules tab appears as Figure 2-77 shows.

    Figure 2-67 CQL Rules Tab

    Description of Figure 2-67 follows
    Description of "Figure 2-67 CQL Rules Tab"

  5. Select the rule you want to edit and click the Query Wizard button.

    The Query Wizard opens with the selected rule on the canvas as Figure 2-68 shows.

    Figure 2-68 Query Wizard: With Existing Rule

    Description of Figure 2-68 follows
    Description of "Figure 2-68 Query Wizard: With Existing Rule"

    For information on the various tools along the top of the Query Wizard canvas, see Section 2.4.8, "Managing the Query Wizard Diagram".

  6. To view the Oracle CQL statements associated with any operator:

    • Ensure that the Hover check box is checked.

    • Hover the mouse pointer over an operator.

    The Oracle CQL statement appears as Figure 2-69 shows.

    Figure 2-69 Hovering Over an Oracle CQL Operator

    Description of Figure 2-69 follows
    Description of "Figure 2-69 Hovering Over an Oracle CQL Operator"

  7. To modify the Oracle CQL statements associated with any operator, double click the operator.

    The corresponding editor dialog appears.

    Figure 2-70 shows the editor dialog after double clicking the Join operator.

    Figure 2-70 Editor Dialog for Oracle CQL Join Operator

    Description of Figure 2-70 follows
    Description of "Figure 2-70 Editor Dialog for Oracle CQL Join Operator"

  8. Use the editor dialog to modify the operator.

    For information on configuring all the Query Wizard editor dialogs, see Section 2.4.6, "Configuring Query Wizard Oracle CQL Constructs".

  9. Click the Add Join button to apply your changes to the generated Oracle CQL statement.

  10. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  11. Click Save to save your changes.

    Your query is saved in memory.

  12. Double click your query's Output operator.

  13. Click Replace Rule.

    The Oracle CQL rule is now changed and the new version appears in the CQL Rules tab.

  14. Close the Output construct.

2.4.3 Deleting a Rule in an Oracle CQL Processor

You can delete an existing Oracle CQL view or query or delete all Oracle CQL views or queries in an Oracle CQL processor.

To delete a rule in an Oracle CQL processor:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application you want to use.

  3. Select the Oracle CQL processor you wish to use:

    1. To use the EPN diagram:

      • Click the Event Processing Network tab.

      • Double-click the Oracle CQL processor you wish to use.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to use.

      • Click the Oracle CQL processor you wish to use.

      • In the right pane, click the General tab

    The Processor panel is displayed as Figure 2-71 shows.

    Figure 2-71 Oracle CQL Processor Panel

    Description of Figure 2-71 follows
    Description of "Figure 2-71 Oracle CQL Processor Panel"

  4. Click the CQL Rules tab.

    The CQL Rules tab appears as Figure 2-77 shows.

    Figure 2-72 CQL Rules Tab

    Description of Figure 2-72 follows
    Description of "Figure 2-72 CQL Rules Tab"

  5. Filter the list of rules to show only the type of rule you want to delete:

    1. Select View to see only view rules.

    2. Select Query to see only query views.

    Note:

    You cannot add, delete, or modify a single rule if you select All Rules. You must select a particular view or query to add, delete, or modify a single rule. To make changes to either views or queries, you must select View or Query. The All Rules page is a read-only panel.

    Also note that you can turn off a query dynamically using the Enable radio buttons.

    The Delete All Views or Delete All Queries button is active as Figure 2-73 shows.

    Figure 2-73 CQL Rules: Filtered by View

    Description of Figure 2-73 follows
    Description of "Figure 2-73 CQL Rules: Filtered by View"

  6. Decide what rules you want to delete:

    1. To delete a single rule:

    2. To delete all rules:

  7. Click OK.

2.4.4 Replacing a Rule in an Oracle CQL Processor

Using Oracle CEP Visualizer, you can replace an existing view or query by either editing the Oracle CQL statement directly or using the Query Wizard.

To replace a rule in an Oracle CQL processor:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application you want to use.

  3. Select the Oracle CQL processor you wish to use:

    1. To use the EPN diagram:

      • Click the Event Processing Network tab.

      • Double-click the Oracle CQL processor you wish to use.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to use.

      • Click the Oracle CQL processor you wish to use.

      • In the right pane, click the General tab

    The Processor panel is displayed as Figure 2-76 shows.

    Figure 2-76 Oracle CQL Processor Panel

    Description of Figure 2-76 follows
    Description of "Figure 2-76 Oracle CQL Processor Panel"

  4. Click the CQL Rules tab.

    The CQL Rules tab appears as Figure 2-77 shows.

    Figure 2-77 CQL Rules Tab

    Description of Figure 2-77 follows
    Description of "Figure 2-77 CQL Rules Tab"

  5. Filter the list of rules to show only the type of rule you want to replace:

    1. Select View to see only view rules.

    2. Select Query to see only query views.

  6. Select the rule you wish to replace.

    The View or Query field is now editable and the Replace Rule button is active as Figure 2-78 shows.

    Figure 2-78 CQL Rules: Filtered by View

    Description of Figure 2-78 follows
    Description of "Figure 2-78 CQL Rules: Filtered by View"

  7. Edit the Oracle CQL statement by doing one of the following:

    1. Directly edit the Oracle CQL statement in the View or Query field.

    2. Click the Query Wizard button to edit the rule in the Query Wizard.

      For more information, see Section 2.4.2, "Modifying a Rule in an Oracle CQL Processor Using the Query Wizard".

  8. Commit your changes:

    1. If you directly edited the Oracle CQL statement in the View or Query field, click Replace View or Replace Query.

    2. If you edited the Oracle CQL statement using the Query Wizard, you commit your changes in the Query Wizard.

      For more information, see Section 2.4.2, "Modifying a Rule in an Oracle CQL Processor Using the Query Wizard".

2.4.5 Viewing a Rule in an Oracle CQL Processor

Using Oracle CEP Visualizer, you can view the existing rules defined on an Oracle CQL processor.

To view a rule in an Oracle CQL processor:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application you want to use.

  3. Select the Oracle CQL processor you wish to use:

    1. To use the EPN diagram:

      • Click the Event Processing Network tab.

      • Double-click the Oracle CQL processor you wish to use.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to use.

      • Click the Oracle CQL processor you wish to use.

      • In the right pane, click the General tab

    The Processor panel is displayed as Figure 2-59 shows.

    Figure 2-79 Oracle CQL Processor Panel

    Description of Figure 2-79 follows
    Description of "Figure 2-79 Oracle CQL Processor Panel"

  4. Click the CQL Rules tab.

    The CQL Rules tab appears as Figure 2-77 shows.

    Figure 2-80 CQL Rules Tab

    Description of Figure 2-80 follows
    Description of "Figure 2-80 CQL Rules Tab"

2.4.6 Configuring Query Wizard Oracle CQL Constructs

This section describes how to configure the various Oracle CQL constructs that the Query Wizard provides, including:

2.4.6.1 Configuring an RSource CQL Construct

The RSource Oracle CQL construct represents an Oracle CQL relation that your Oracle CEP application provides or a relation type of view that you create. To create a stream type of source, an SSource, see Section 2.4.6.2, "Configuring an SSource CQL Construct".

For more information and detailed syntax, see:

To configure an RSource CQL construct:

  1. Double click the RSource icon as Figure 2-81 shows.

    Figure 2-81 RSource Icon

    RSource icon

    The RSource editor dialog appears as Figure 2-82 shows.

    Figure 2-82 Query Wizard RSource Editor Dialog

    Description of Figure 2-82 follows
    Description of "Figure 2-82 Query Wizard RSource Editor Dialog"

  2. Edit the dialog as Table 2-8 describes.

    Table 2-8 Query Wizard RSource Editor Attributes

    Attribute Description

    Type

    Select the type of source:

    • Relation: select this option to process events offered by a relation (query) currently running on this Oracle CQL processor.

    • View: select this option to process events offered by a view currently running on this Oracle CQL processor.

    Select a source

    Select the relation or view to use as the source of events.

    As

    Optionally specify an alias for this source.

    Source Properties

    Read-only list of the properties of the event offered by this source.

    Generated CQL Statement

    Read-only Oracle CQL fragment associated with this CQL Construct.


  3. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  4. Click Save.

    The RSource icon displays a green check mark to indicate that it is configured.

2.4.6.2 Configuring an SSource CQL Construct

The SSource Oracle CQL construct represents an Oracle CQL stream that your Oracle CEP application provides or a stream type of view you create. To create a relation type of source, an RSource, see Section 2.4.6.1, "Configuring an RSource CQL Construct".

For more information and detailed syntax, see:

To configure an SSource CQL construct:

  1. Double click the SSource icon as Figure 2-81 shows.

    Figure 2-83 SSource Icon

    SSource icon

    The SSource editor dialog appears as Figure 2-82 shows.

    Figure 2-84 Query Wizard Source Editor Dialog

    Description of Figure 2-84 follows
    Description of "Figure 2-84 Query Wizard Source Editor Dialog"

  2. Edit the dialog as Table 2-8 describes.

    Table 2-9 Query Wizard Source Editor Attributes

    Attribute Description

    Type

    Select the type of source:

    • Stream: select this option to process events offered by a stream provided by your Oracle CEP application.

    • View: select this option to process events offered by a view currently running on this Oracle CQL processor.

    Select a source

    Select the stream or view to use as the source of events.

    As

    Optionally specify an alias for this source.

    Source Properties

    Read-only list of the properties of the event offered by this source.

    Generated CQL Statement

    Read-only Oracle CQL fragment associated with this CQL Construct.


  3. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  4. Click Save.

    The Source icon displays a green check mark to indicate that it is configured.

2.4.6.3 Configuring a Cache-Table CQL Construct

The Cache-Table CQL construct represents an external relation, usually a pull data source, that a cache or relational database table provides. The only operation that is allowed on the Cache-Table CQL construct is a join with another stream source using the Now window.

For more information, see:

To configure a Cache-Table CQL construct:

  1. Double click the Cache-Table icon as Figure 2-85 shows.

    Figure 2-85 Cache-Table Icon

    Cache-Table icon

    The Cache-Table editor dialog appears as Figure 2-86 shows.

    Figure 2-86 Query Wizard Cache-Table Editor Dialog

    Description of Figure 2-86 follows
    Description of "Figure 2-86 Query Wizard Cache-Table Editor Dialog"

  2. Edit the dialog as Table 2-10 describes.

    Table 2-10 Query Wizard Cache-Table Editor Attributes

    Attribute Description

    Select a source

    Select the cache to use as the source of events.

    As

    Optionally specify an alias for this source.

    Source Properties

    Read-only list of the properties of the event offered by this source.

    Generated CQL Statement

    Read-only Oracle CQL fragment associated with this CQL Construct.


  3. Click Save.

    The Cache-Table icon displays a green check mark to indicate that it is configured.

2.4.6.4 Configuring a Pattern CQL Construct

The Pattern Oracle CQL construct represents the Oracle CQL MATCH_RECOGNIZE condition. The MATCH_RECOGNIZE condition is the principle means of performing complex event processing. Using its various clauses, you can succinctly express complex conditions among stream elements to perform advanced comparisons optimized for data streams.

The Pattern Oracle CQL construct editor provides a tab for each of the following MATCH_RECOGNIZE sub-clauses:

For more information and detailed syntax, see:

To configure a Pattern CQL construct:

  1. Double click the Pattern icon as Figure 2-87 shows.

    Figure 2-87 Pattern Icon

    Pattern icon

    The Pattern editor dialog appears as Figure 2-88 shows.

    Figure 2-88 Query Wizard Pattern Editor Dialog: Pattern Tab

    Description of Figure 2-88 follows
    Description of "Figure 2-88 Query Wizard Pattern Editor Dialog: Pattern Tab"

  2. Edit the Pattern tab as Table 2-11 describes.

    Table 2-11 Query Wizard Pattern Editor Attributes: Pattern Tab

    Attribute Description

    Pattern Expression

    Use this clause to specify quantifiers that constrain and control when conditions in the DEFINE clause match. For example:

    (A B* C)
    

    Table 2-12 lists the pattern quantifiers Oracle CQL supports. Use the pattern quantifiers to specify the allowed range of pattern matches. The one-character pattern quantifiers are maximal or "greedy"; they will attempt to match the biggest quantity first. The two-character pattern quantifiers are minimal or "reluctant"; they will attempt to match the smallest quantity first.

    For more information, see "PATTERN Clause" in the Oracle CEP CQL Language Reference.

    Duration

    By default, Oracle CEP updates the output relation at the time it recognizes a pattern match. Enter a duration value to specify a time delay between when Oracle CEP recognizes a pattern match and when it updates the output relation. You can use either of the following:

    • When you specify a duration like 10, each time Oracle CEP recognizes a pattern match, it delays the specified time interval before updating the output relation. If no input matches the pattern, Oracle CEP does not update the output relation

    • When you specify a duration like MULTIPLES OF 10, each time Oracle CEP recognizes a pattern match, it delays the specified time interval before updating the output relation. If no input matches the pattern or if no input is received, Oracle CEP still updates the output relation. In this case, some terms in the selection may be null and aggregate values may be reset.

    For more information, see "DURATION Clause" in the Oracle CEP CQL Language Reference.

    Partition By

    Use this optional clause to specify the stream elements by which a MATCH_RECOGNIZE clause should partition its results. You can reference any stream elements in the schema of the stream, view, or sliding window specified by the identifier you used in the query or view select statement.

    To add a stream element to the partition by list, select a stream element from the pull-down menu and click the Add button.

    To remove a stream element from the partition by list, click the Undo button.

    For more information, see "PARTITION BY Clause" in the Oracle CEP CQL Language Reference.

    Pattern Alias

    Specifies the relation_variable clause AS operator to define an alias to label the immediately preceding expression in the select list so that you can reference the result by that name. The alias effectively renames the select list item for the duration of the query.

    Specifying a pattern alias of its would correspond to the following example:

    <query id="detectPerish"><![CDATA[ 
        select its.itemId as badItem from ItemTempStream 
        MATCH_RECOGNIZE (
            PARTITION BY ...
            MEASURES ...
            PATTERN ...
            DEFINE ...
        ) as its
    ]]></query>
    

    For more information, see "Aliases in the relation_variable Clause" in the Oracle CEP CQL Language Reference.

    All Matches

    Check this option to configure Oracle CEP to match overlapping patterns.

    Uncheck this option to configure Oracle CEP to match only one pattern.

    For more information, see "ALL MATCHES Clause" in the Oracle CEP CQL Language Reference.

    Generated CQL Statement

    Editable Oracle CQL fragment associated with this CQL Construct.


    Table 2-12 Pattern Quantifiers

    Maximal Minimal Description

    *

    *?

    0 or more times

    +

    +?

    1 or more times.

    ?

    ??

    0 or 1 time.


    For more information, see "PATTERN Clause" in the Oracle CEP CQL Language Reference.

  3. Click the Define tab.

    The Define tab appears as Figure 2-89 shows.

    Figure 2-89 Query Wizard Pattern Editor Dialog: Define Tab

    Description of Figure 2-89 follows
    Description of "Figure 2-89 Query Wizard Pattern Editor Dialog: Define Tab"

  4. Edit the Define tab as Table 2-12 describes.

    Table 2-13 Query Wizard Pattern Editor Attributes: Define Tab

    Attribute Description

    Object Name

    Enter an object name as you specified in the Pattern Expression attribute of the Pattern tab (see Table 2-11). For example, if the pattern expression is:

    (A B* C)
    

    Then create a definition for each of A, B, and C.

    AS

    Define an expression by clicking the Expression Builder button.

    For example:

    A AS  (A.temp >= 25)
    B  AS  ((B.temp >= 25) and 
                (B.element_time - A.element_time < INTERVAL "0 00:00:05:00" DAY TO SECOND))
    C  AS  (C.element_time - A.element_time >= INTERVAL "0 00:00:05:00" DAY TO SECOND)
    

    For more information, see Section 2.4.6.17, "Configuring an Expression Using the Expression Builder".

    Object List

    A list of the definitions you specify.

    To add a definition to the Object List, click the Add button.

    To remove a definition from the Object List, click the Delete button.

    Generated CQL Statement

    Read-only Oracle CQL fragment associated with this CQL Construct.


    For more information, see "DEFINE Clause" in the Oracle CEP CQL Language Reference.

  5. Click the Subset tab.

    The Subset tab appears as Figure 2-90 shows.

    Figure 2-90 Query Wizard Pattern Editor Dialog: Subset Tab

    Description of Figure 2-90 follows
    Description of "Figure 2-90 Query Wizard Pattern Editor Dialog: Subset Tab"

  6. Edit the Subset tab as Table 2-14 describes.

    Table 2-14 Query Wizard Pattern Editor Attributes: Subset Tab

    Attribute Description

    Subset name

    Enter a name for the subset.

    AS

    Enter a list of the object names as you specified in the Pattern Expression attribute of the Pattern tab (see Table 2-11). For example, given the following pattern:

    (A W+ X+ Y+ Z+)
    

    You could define subsets such as:

    S1 AS (Z)
    S2 AS (A)
    S3 AS (A,W,Y)
    

    Subset List

    A list of the subsets you specify.

    To add a subset to the Subset List, click the Add button.

    To remove a subset from the Subset List, click the Delete button.

    Generated CQL Statement

    Read-only Oracle CQL fragment associated with this CQL Construct.


    For more information, see "SUBSET Clause" in the Oracle CEP CQL Language Reference.

  7. Click the Measure tab.

    The Measure tab appears as Figure 2-91 shows.

    Figure 2-91 Query Wizard Pattern Editor Dialog: Measure Tab

    Description of Figure 2-91 follows
    Description of "Figure 2-91 Query Wizard Pattern Editor Dialog: Measure Tab"

  8. Edit the Measure tab as Table 2-15 describes.

    Table 2-15 Query Wizard Pattern Editor Attributes: Measure Tab

    Attribute Description

    Object Name

    Enter an object name as you specified in the Pattern Expression attribute of the Pattern tab (see Table 2-11) or Subset name attribute of the Subset tab (see Figure 2-90).

    For example, if the pattern expression is:

    (A B* C)
    

    Then you could create a measure for any of A, B, and C.

    If you define subsets:

    S1 AS (Z)
    S2 AS (A)
    S3 AS (A,W,Y)
    

    Then you could create a measure for any of S1, S2, and S3.

    AS

    Define an expression by clicking the Expression Builder button.

    For example:

    sumDecrArm as sum(S3.c2)
    

    For more information, see Section 2.4.6.17, "Configuring an Expression Using the Expression Builder".

    Measure List

    A list of the measures you specify.

    To add a measure to the Properties list, click the Add button.

    To remove a measure from the Properties list, click the Delete button.

    Generated CQL Statement

    Read-only Oracle CQL fragment associated with this CQL Construct.


    For more information, see "MEASURES Clause" in the Oracle CEP CQL Language Reference.

  9. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  10. Click Save.

    The Pattern icon displays a green check mark to indicate that it is configured.

2.4.6.5 Configuring a Select CQL Construct

The Select Oracle CQL construct represents the Oracle CQL SELECT clause. For information on representing the WHERE clause, see Section 2.4.6.9, "Configuring a Filter CQL Construct".

The Select Oracle CQL construct editor provides a tab for each of the following sub-clauses:

For more information, see:

To configure a Select CQL construct:

  1. Double click the Select icon as Figure 2-92 shows.

    Figure 2-92 Select Icon

    Select icon

    The Select editor dialog appears as Figure 2-93 shows.

    Figure 2-93 Query Wizard Select Editor Dialog: Project Tab

    Description of Figure 2-93 follows
    Description of "Figure 2-93 Query Wizard Select Editor Dialog: Project Tab"

  2. Edit the Project tab as Table 2-16 describes.

    The general procedure is:

    1. Select a Source.

    2. Select a Target event type.

    3. Double click a property in the Properties list to add the property to the Project expression field.

    4. Click the Expression Builder button and create a Project expression.

    5. In the AS field, enter an alias for the project expression result or select one of the Target event type attributes.

    6. Click the Add button.

      To remove a project expression, select it in the Project predicates list and click Delete.

    7. Optionally, check Distinct.

    Table 2-16 Query Wizard Select Editor Attributes: Project Tab

    Attribute Description

    Distinct

    Check this option if you want Oracle CEP to return only one copy of each set of duplicate tuples selected.

    Uncheck this option if you want Oracle CEP to return all tuples selected, including duplicates.

    Duplicate tuples are those with matching values for each expression in the select list. Oracle CEP does not support nested aggregations.

    Target event type

    Select or input the name of the event expected by the down-stream channel you connected to this Oracle CQL processor.

    For more information, see "Event Types" in the Oracle CEP Developer's Guide for Eclipse

    Source

    Select the name of the stream, relation, or view Source CQL Construct that you connected to this Project CQL construct.

    For more information, see Section 2.4.6.1, "Configuring an RSource CQL Construct".

    Properties

    Read-only list of the properties of the event offered by this source.

    For more information, see Section 2.4.6.1, "Configuring an RSource CQL Construct".

    Project Predicates

    A list of the project expressions you define.

    To add a project expression to the Project Predicates list, click the Add button.

    To remove a project expression from the Project Predicates list, select the project expression in the Project Predicates list and click the Delete button.

    Project Expressions

    Define an expression by clicking the Expression Builder button.

    For example:

    LENGTH( FxQuoteStream.symbol < 100 )
    

    For more information, see Section 2.4.6.17, "Configuring an Expression Using the Expression Builder".

    AS

    Enter an alias for the project expression result or select one of the Target event type attributes.

    Generated CQL Statement

    Read-only Oracle CQL fragment associated with this CQL Construct.


    For more information, see "select_clause" in the Oracle CEP CQL Language Reference.

  3. Click the Group tab.

    The Group tab editor dialog appears as Figure 2-93 shows.

    Figure 2-94 Query Wizard Select Editor Dialog: Group Tab

    Description of Figure 2-94 follows
    Description of "Figure 2-94 Query Wizard Select Editor Dialog: Group Tab"

  4. Edit the Group tab as Table 2-17 describes.

    The general procedure is:

    1. Select a source from the pull down menu.

    2. Select a property in the Properties list.

    3. To add the selected property to the Grouping properties list, click the Add button.

      To remove a property from the Grouping properties list, select the property in the Grouping properties list and click the Delete button.

    Table 2-17 Query Wizard Select Editor Attributes: Group Tab

    Attribute Description

    Select a source

    Select a source from the pull-down menu.

    Properties

    The properties of the event offered by the selected source.

    Grouping Properties

    A list of the grouping properties you define.

    To add the selected property to the Grouping properties list, click the Add button.

    To remove a property from the Grouping properties list, select the property in the Grouping properties list and click the Delete button.

    Generated CQL Statement

    Editable Oracle CQL fragment associated with this CQL Construct.


    For more information, see "opt_group_by_clause" in the Oracle CEP CQL Language Reference.

  5. Click the Condition tab.

    The Condition tab editor dialog appears as Figure 2-93 shows.

    Figure 2-95 Query Wizard Select Editor Dialog: Condition Tab

    Description of Figure 2-95 follows
    Description of "Figure 2-95 Query Wizard Select Editor Dialog: Condition Tab"

  6. Edit the Condition tab as Table 2-18 describes.

    Table 2-18 Query Wizard Select Editor Attributes: Condition Tab

    Attribute Description

    Having Predicate

    Define an expression by entering a having predicate directly or clicking the Expression Builder button.

    For example:

    lastPrice > 500
    

    For more information, see Section 2.4.6.17, "Configuring an Expression Using the Expression Builder".

    To add a condition expression to the generated CQL statement, click the Add button.

    To remove the condition expression from the generated CQL statement, click the Delete button.

    Generated CQL Statement

    Editable Oracle CQL fragment associated with this CQL Construct.


    For more information, see "opt_having_clause" in the Oracle CEP CQL Language Reference.

  7. Click the Order tab.

    The Order tab editor dialog appears as Figure 2-93 shows.

    Figure 2-96 Query Wizard Select Editor Dialog: Order Tab

    Description of Figure 2-96 follows
    Description of "Figure 2-96 Query Wizard Select Editor Dialog: Order Tab"

  8. Edit the Order tab as Table 2-19 describes.

    The general procedure is:

    1. Select a source from the pull down menu.

    2. Select a property in the Properties list.

    3. To add the selected property to the Ordering properties list, click the Add button.

      To remove a property from the Ordering properties list, select the property in the Ordering properties list and click the Delete button.

    Table 2-19 Query Wizard Select Editor Attributes: Order Tab

    Attribute Description

    Select a source

    Select a source from the pull-down menu.

    Properties

    The properties of the event offered by the selected source.

    Ordering Properties

    A list of the ordering properties you define.

    To add the selected property to the Ordering properties list, click the Add button.

    To remove a property from the Ordering properties list, select the property in the Ordering properties list and click the Delete button.

    Generated CQL Statement

    Editable Oracle CQL fragment associated with this CQL Construct.


    For more information, see "order_by_clause" in the Oracle CEP CQL Language Reference.

  9. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  10. Click Save.

    The Select icon displays a green check mark to indicate that it is configured.

2.4.6.6 Configuring a Join CQL Construct Using + Syntax

The Join Oracle CQL construct represents an Oracle CQL join between two or more sources. You can create and inner joins and left and right outer joins using the (deprecated) + syntax.

Note:

If your Oracle CQL rule uses the LEFT or RIGHT OUTER JOIN clause, see Section 2.4.6.7, "Configuring a Join CQL Construct Using LEFT or RIGHT OUTER JOIN".

For more information, see:

To configure a Join CQL construct:

  1. Double click the Join icon as Figure 2-97 shows.

    Figure 2-97 Join Icon

    Join icon

    The Join editor dialog appears as Figure 2-98 shows.

    Figure 2-98 Query Wizard Join Editor Dialog

    Description of Figure 2-98 follows
    Description of "Figure 2-98 Query Wizard Join Editor Dialog"

  2. Edit the dialog as Table 2-20 describes.

    Table 2-20 Query Wizard Join Editor Attributes

    Attribute Description

    Source 1

    Select the first source to join.

    Properties

    Read-only list of properties of Source 1.

    Source 2

    Select the second source to join.

    Properties

    Read-only list of properties of Source 2.

    Join Type

    Select the type of join:

    Join Predicate

    Create the Join Predicate by doing either of the following:

    • Click the Plus Sign button to create the join predicate using the Source 1 and Source 2 properties you select.

    • Click the Expression Builder button to create the join predicate using any of the Source 1 and Source 2 properties and Oracle CQL functions and operators.

    Generated CQL Statement

    Editable Oracle CQL fragment associated with this CQL Construct.


  3. Select a source from the Source 1 pull-down menu.

  4. Select a source from the Source 2 pull-down menu.

  5. Select a property in the Source 1 Properties list to join on.

  6. Select a property in the Source 2 Properties list to join on.

  7. Choose the Join Type.

  8. Create the Join Predicate by doing either of the following:

    1. Click the Plus Sign button to create the join predicate using the Source 1 and Source 2 properties you select.

    2. Click the Expression Builder button to create the join predicate using any of the Source 1 and Source 2 properties and Oracle CQL functions and operators.

  9. To add the join predicate to the generated CQL statement, click the Add Join button.

  10. To remove the join predicate from the generated CQL statement, click the Undo Join button.

  11. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  12. Click Save.

    The Join icon displays a green check mark to indicate that it is configured.

2.4.6.7 Configuring a Join CQL Construct Using LEFT or RIGHT OUTER JOIN

The Join Oracle CQL construct represents an Oracle CQL join between two or more sources. You can view the configuration of an Oracle CQL rule using the LEFT or RIGHT OUTER join syntax.

Note:

If your Oracle CQL rule uses an inner join or outer join using the deprecated + syntax, see Section 2.4.6.6, "Configuring a Join CQL Construct Using + Syntax".

Figure 2-99 shows an example Oracle CQL outer join in the query constructor.

Figure 2-99 Oracle CQL Outer Join

Description of Figure 2-99 follows
Description of "Figure 2-99 Oracle CQL Outer Join"

For more information, see:

To configure a Join CQL construct using LEFT or RIGHT OUTER JOIN:

  1. Double click the Join icon as Figure 2-100 shows.

    Figure 2-100 Join Icon

    Join icon

    The Join editor dialog appears as Figure 2-101 shows.

    Figure 2-101 Query Wizard Join Editor Dialog: LEFT or RIGHT OUTER JOIN Syntax

    Description of Figure 2-101 follows
    Description of "Figure 2-101 Query Wizard Join Editor Dialog: LEFT or RIGHT OUTER JOIN Syntax"

2.4.6.8 Configuring a Window CQL Construct

The Window Oracle CQL construct represents an Oracle CQL stream-to-relation operator.

For more information, see:

To configure a Window CQL construct:

  1. Double click the Window icon as Figure 2-102 shows.

    Figure 2-102 Window Icon

    Window icon

    The Window editor dialog appears as Figure 2-103 shows.

    Figure 2-103 Query Wizard Window Editor Dialog

    Description of Figure 2-103 follows
    Description of "Figure 2-103 Query Wizard Window Editor Dialog"

  2. Edit the dialog as Table 2-21 describes.

    Table 2-21 Query Wizard Window Editor Attributes

    Attribute Description

    Partition List

    Select one or more stream elements to add to the partition list if you want to create a partitioned window.

    To remove stream elements from the Partition List, click and drag to select the values in the Partition List and press the Delete key on your keyboard.

    Type

    The type of window to create:

    Now: Select this option to create a time-based range window that defines its output relation such that, when T = 0, the relation at time t consists of tuples obtained from elements of S with timestamp t. For more information, see "S[now]" in the Oracle CEP CQL Language Reference.

    Time: Select this option to create a time-based range window that defines its output relation over time by sliding an interval of size T time units capturing the latest portion of an ordered stream. Elements that have been in the window for more than T time units are subject to deletion. In this case, the range and slide are equal. For more information, see "S[range T]" in the Oracle CEP CQL Language Reference. Optionally, specify a time-based slide for this window using the Slide attribute.

    Row: Select this option to create a tuple-based window that defines its output relation over time by sliding a window of the last N tuples of an ordered stream. For the output relation R of S [rows N], the relation at time t consists of the N tuples of S with the largest timestamps <= t (or all tuples if the length of S up to t is <= N). For more information, see "S[rows N]" in the Oracle CEP CQL Language Reference. Optionally, specify a row-based slide for this window using the Slide attribute.

    Partition: Select this option to create any of the following partitioned windows:

    The Partition type is inactive unless you add one or more stream elements to the Partition List. Optionally, specify a time-based slide for this window using the Slide attribute.

    Unbounded: Select this option to create a time-based range window defines its output relation such that, when T = infinity, the relation at time t consists of tuples obtained from all elements of S up to t. Elements remain in the window indefinitely. For more information, see "S[range unbounded]" in the Oracle CEP CQL Language Reference.

    Slide

    Specify a sliding window:

    Row Based: Select this option to create any of the following row-based sliding windows:

    Time Based: Select this option to create any of the following time-based sliding windows:

    Generated CQL Statement

    Editable Oracle CQL fragment associated with this CQL Construct.


  3. If you want a partitioned window, select the stream elements you want in the Partition List.

    To remove stream elements from the Partition List, click and drag to select the values in the Partition List and press the Delete key on your keyboard.

  4. Select the Type.

    The Partition type is inactive unless you add one or more stream elements to the Partition List.

  5. Select Row Based or Time Based for the selected type.

  6. Enter the size of the window:

    1. For a Row Based type, enter a number of rows (tuples or stream elements).

    2. For a Time Based type, enter a number of time units and select the time unit.

  7. Select a Slide:

    1. For a Row Based type, enter a number of rows (tuples or stream elements).

    2. For a Time Based type, enter a number of time units and select the time unit.

  8. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  9. To add the window to the generated CQL statement, click the Add Window button.

  10. Click Save.

    The Window icon displays a green check mark to indicate that it is configured.

2.4.6.9 Configuring a Filter CQL Construct

The Filter Oracle CQL construct represents an Oracle CQL WHERE clause. For information on representing the SELECT and FROM clauses, see Section 2.4.6.5, "Configuring a Select CQL Construct".

For more information, see:

To configure a Filter CQL construct:

  1. Double click the Filter icon as Figure 2-104 shows.

    Figure 2-104 Filter Icon

    Filter icon

    The Filter editor dialog appears as Figure 2-105 shows.

    Figure 2-105 Query Wizard Filter Editor Dialog

    Description of Figure 2-105 follows
    Description of "Figure 2-105 Query Wizard Filter Editor Dialog"

  2. Edit the dialog as Table 2-22 describes.

    Table 2-22 Query Wizard Filter Editor Attributes

    Attribute Description

    Filter Predicate

    Define an expression by entering a filter predicate directly or clicking the Expression Builder button.

    For example:

    SUM( FxQuoteStream.lastPrice < 5000 )
    

    For more information, see Section 2.4.6.17, "Configuring an Expression Using the Expression Builder".

    To add the filter predicate to the generated CQL statement, click the Add Filter button.

    To remove the filter predicate from the generated CQL statement, click the Delete Filter button.

    Generated CQL Statement

    Editable Oracle CQL fragment associated with this CQL Construct.


  3. Define the filter predicate by doing one of the following:

    1. Enter the filter predicate directly.

    2. Click the Expression Builder button.

      For more information, see Section 2.4.6.17, "Configuring an Expression Using the Expression Builder".

  4. To add a condition expression to the generated CQL statement, click the Add Filter button.

  5. To remove the condition expression from the generated CQL statement, click the Delete Filter button.

  6. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  7. Click Save.

    The Source icon displays a green check mark to indicate that it is configured.

2.4.6.10 Configuring a Union CQL Construct

The Union Oracle CQL construct represents an Oracle CQL UNION or UNION ALL clause. You can perform a union between two relations; relation can be emitted either from a view or a channel. You can perform a union between two relations or two streams. You cannot perform a union between a relation and a stream.

For more information, see:

To configure a Union CQL construct:

  1. Double click the Union icon as Figure 2-106 shows.

    Figure 2-106 Union Icon

    Union icon

    The Union editor dialog appears as Figure 2-107 shows.

    Figure 2-107 Query Wizard Union Editor Dialog

    Description of Figure 2-107 follows
    Description of "Figure 2-107 Query Wizard Union Editor Dialog"

  2. Edit the dialog as Table 2-23 describes.

    Table 2-23 Query Wizard Union Editor Attributes

    Attribute Description

    Source 1

    Select the first source to union.

    Properties

    Read-only list of properties of Source 1.

    Source 2

    Select the second source to union.

    Properties

    Read-only list of properties of Source 2.

    Union Type

    Select the type of union:

    • Union: select this to create a UNION statement.

    • Union All: select this option to create a UNION ALL statement.

    For more information, see "BINARY Example: UNION and UNION ALL" in the Oracle CEP CQL Language Reference.

    Generated CQL Statement

    Editable Oracle CQL fragment associated with this CQL Construct.


  3. Select a source from the Source 1 pull-down menu.

  4. Select a source from the Source 2 pull-down menu.

  5. Choose the Union Type.

  6. To add the union clause to the generated CQL statement, click the Add Union button.

  7. To remove the union clause from the generated CQL statement, click the Undo Union button.

  8. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  9. Click Save.

    The Union icon displays a green check mark to indicate that it is configured.

2.4.6.11 Configuring an Intersect CQL Construct

The Intersect Oracle CQL construct represents an Oracle CQL INTERSECT clause. You can perform an intersect between two relations. You cannot perform an intersect between a relation and a stream or between two streams.

For more information, see:

To configure an Intersect CQL construct:

  1. Double click the Intersect icon as Figure 2-108 shows.

    Figure 2-108 Intersect Icon

    Intersect icon

    The Intersect editor dialog appears as Figure 2-109 shows.

    Figure 2-109 Query Wizard Intersect Editor Dialog

    Description of Figure 2-109 follows
    Description of "Figure 2-109 Query Wizard Intersect Editor Dialog"

  2. Edit the dialog as Table 2-24 describes.

    Table 2-24 Query Wizard Intersect Editor Attributes

    Attribute Description

    Source 1

    Select the first source to intersect.

    Properties

    Read-only list of properties of Source 1.

    Source 2

    Select the second source to intersect.

    Properties

    Read-only list of properties of Source 2.

    Generated CQL Statement

    Editable Oracle CQL fragment associated with this CQL Construct.


  3. To add the intersect clause to the generated CQL statement, click the Add Intersect button.

  4. To remove the intersect clause from the generated CQL statement, click the Undo Intersect button.

  5. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  6. Click Save.

    The Intersect icon displays a green check mark to indicate that it is configured.

2.4.6.12 Configuring a Minus CQL Construct

The Minus Oracle CQL construct represents an Oracle CQL MINUS clause. You can perform a minus between two relations. You cannot perform a minus between a relation and a stream or between two streams.

For more information, see:

To configure a Minus CQL construct:

  1. Double click the Intersect icon as Figure 2-110 shows.

    Figure 2-110 Minus Icon

    Minus icon

    The Minus editor dialog appears as Figure 2-111 shows.

    Figure 2-111 Query Wizard Minus Editor Dialog

    Description of Figure 2-111 follows
    Description of "Figure 2-111 Query Wizard Minus Editor Dialog"

  2. Edit the dialog as Table 2-25 describes.

    Table 2-25 Query Wizard Minus Editor Attributes

    Attribute Description

    Source 1

    Select the first source to minus.

    Properties

    Read-only list of properties of Source 1.

    Source 2

    Select the second source to minus.

    Properties

    Read-only list of properties of Source 2.

    Generated CQL Statement

    Editable Oracle CQL fragment associated with this CQL Construct.


  3. To add the minus clause to the generated CQL statement, click the Add Minus button.

  4. To remove the minus clause from the generated CQL statement, click the Undo Minus button.

  5. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  6. Click Save.

    The Minus icon displays a green check mark to indicate that it is configured.

2.4.6.13 Configuring an IStream CQL Construct

The IStream Oracle CQL construct represents an Oracle CQL IStream relation-to-stream operator. Istream (for "Insert stream") applied to a relation R contains (s,t) whenever tuple s is in R(t) - R(t-1), that is, whenever s is inserted into R at time t. If a tuple happens to be both inserted and deleted with the same timestamp then IStream does not output the insertion.

For more information, see:

To configure an IStream CQL construct:

  1. Double click the IStream icon as Figure 2-112 shows.

    Figure 2-112 IStream Icon

    IStream icon

    The IStream editor dialog appears as Figure 2-113 shows.

    Figure 2-113 Query Wizard IStream Editor Dialog

    Description of Figure 2-113 follows
    Description of "Figure 2-113 Query Wizard IStream Editor Dialog"

  2. Edit the dialog as Table 2-26 describes.

    Table 2-26 Query Wizard IStream Editor Attributes

    Attribute Description

    Generated CQL Statement

    Wrap the editable Oracle CQL fragment associated with this CQL Construct in:

    IStream()
    

  3. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  4. Click Save.

    The IStream icon displays a green check mark to indicate that it is configured.

2.4.6.14 Configuring a DStream CQL Construct

The DStream Oracle CQL construct represents an Oracle CQL DStream relation-to-stream operator. Dstream (for "Delete stream") applied to a relation R contains (s,t) whenever tuple s is in R(t-1) - R(t), that is, whenever s is deleted from R at time t.

For more information, see:

To configure a DStream CQL construct:

  1. Double click the DStream icon as Figure 2-114 shows.

    Figure 2-114 DStream Icon

    Dstream icon

    The DStream editor dialog appears as Figure 2-115 shows.

    Figure 2-115 Query Wizard DStream Editor Dialog

    Description of Figure 2-115 follows
    Description of "Figure 2-115 Query Wizard DStream Editor Dialog"

  2. Edit the dialog as Table 2-27 describes.

    Table 2-27 Query Wizard DStream Editor Attributes

    Attribute Description

    Generated CQL Statement

    Wrap the editable Oracle CQL fragment associated with this CQL Construct in:

    DStream()
    

  3. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  4. Click Save.

    The Dstream icon displays a green check mark to indicate that it is configured.

2.4.6.15 Configuring an RStream CQL Construct

The RStream Oracle CQL construct represents an Oracle CQL RStream relation-to-stream operator. The RStream operator maintains the entire current state of its input relation and outputs all of the tuples as insertions at each time step. Since Rstream outputs the entire state of the relation at every instant of time, it can be expensive if the relation set is not very small.

For more information, see:

To configure an RStream CQL construct:

  1. Double click the RStream icon as Figure 2-116 shows.

    Figure 2-116 RStream Icon

    RStream icon

    The RStream editor dialog appears as Figure 2-117 shows.

    Figure 2-117 Query Wizard RStream Editor Dialog

    Description of Figure 2-117 follows
    Description of "Figure 2-117 Query Wizard RStream Editor Dialog"

  2. Edit the dialog as Table 2-28 describes.

    Table 2-28 Query Wizard RStream Editor Attributes

    Attribute Description

    Generated CQL Statement

    Wrap the editable Oracle CQL fragment associated with this CQL Construct in:

    RStream()
    

  3. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  4. Click Save.

    The RStream icon displays a green check mark to indicate that it is configured.

2.4.6.16 Configuring an Output CQL Construct

The Output Oracle CQL construct represents the complete Oracle CQL query or view. Using the Output CQL construct, you can:

  • Review and edit the complete Oracle CQL statement.

  • Create a copy of the Oracle CQL statement and inject it into the Oracle CQL processor under a different name. This is a convenient way of duplicating and modifying an existing statement when you need to create multiple statements that share a common structure.

  • Convert between a view and query.

For more information, see:

To configure an Output CQL construct:

  1. Double click the Output icon as Figure 2-118 shows.

    Figure 2-118 Output Icon

    Output icon

    The Output editor dialog appears as Figure 2-119 shows.

    Figure 2-119 Query Wizard Output Editor Dialog

    Description of Figure 2-119 follows
    Description of "Figure 2-119 Query Wizard Output Editor Dialog"

  2. Edit the dialog as Table 2-29 describes.

    Table 2-29 Query Wizard Output Editor Attributes

    Attribute Description

    Type

    The type of rule:

    • Query: An Oracle CQL query is an operation that you express in Oracle CQL syntax and execute on an Oracle CQL Processor to process data from one or more streams or views.

    • View: An Oracle CQL view represents an alternative selection on a stream or relation. In Oracle CQL, you use a view instead of a subquery.

    For more information, see "Queries, Views, and Joins" in the Oracle CEP CQL Language Reference.

    Query Name

    The name of the query.

    Enable

    Set this option to true to run the rule immediately after saving.

    Set this option to false to not run the rule after saving.

    A view cannot be enabled or disabled. If the query that uses a view is enabled, then the view is also enabled. If the query that uses a view is disabled, then the view is effectively disabled.

    View Name

    The name of the view.

    View Schema

    Editable list of the properties you specify in the SELECT clause.

    If you edit the generated CQL statement to add or remove properties from the SELECT clause, you must make the same change to the View Schema.

    Project List

    Read-only list of the properties you specify in the SELECT clause.

    Generated CQL Statement

    Editable Oracle CQL fragment associated with this CQL Construct.


  3. To inject a new instance of the entire Oracle CQL rule into the Oracle CQL processor:

    1. If you are creating a new rule, Click Inject Rule.

      A new instance of the Oracle CQL rule is now visible on the Oracle Rules tab.

    2. If you are modifying an existing rule:

      • Click in the Query Name or View Name field and change the query or view name.

      • Click Inject Rule.

      A new instance of the Oracle CQL rule is now visible on the Oracle Rules tab with the new name.

  4. To replace an existing instance of the entire Oracle CQL rule in the Oracle CQL processor, click Replace Rule.

    The existing instance of the Oracle CQL rule is updated on the Oracle Rules tab with the existing name.

  5. Click the Validate button to ensure that your changes are syntactically correct.

    Correct any errors before proceeding.

  6. Click Save.

    The Output icon displays a green check mark to indicate that it is configured.

2.4.6.17 Configuring an Expression Using the Expression Builder

You can use the Query Wizard Expression Builder to construct an expression using various Oracle CQL operators, expressions, built-in single-row and aggregate functions, and user-defined functions.

For more information, see:

To configure an expression using the Expression Builder:

  1. Click the Expression Builder button on the CQl construct editor dialog.

    The Expression Builder dialog appears. Figure 2-120 shows the Expression Builder after clicking the Expression Builder button in the Pattern construct editor.

    Figure 2-120 Query Wizard Expression Builder

    Description of Figure 2-120 follows
    Description of "Figure 2-120 Query Wizard Expression Builder"

  2. Edit the dialog as Table 2-29 describes.

    Table 2-30 Query Wizard Expression Builder Attributes

    Attribute Description

    Expression Builder

    Editable field that contains the expression.

    Variables

    Select a source from the Variables pull-down menu to list the properties it provides in the Properties list.

    Double-click a property to select it and add it to the Expression Builder at the current insertion point.

    Functions

    Select a function category from the Functions pull-down menu to list the functions it provides in the Functions list.

    Select a function to see its syntax in the Function Description field.

    Double-click a function to select it and add it to the Expression Builder at the current insertion point.

    Operands

    Double-click an operand to select it and add it to the Expression Builder at the current insertion point.

    Function Description

    Read-only field that shows the syntax for the currently selected function.


  3. Select a source from the Variables pull-down menu.

  4. Select a function category from the Functions pull-down menu.

  5. Double-click a function to select it and add it to the Expression Builder.

  6. Double-click a property to select it and make it the argument of the function.

  7. Use your mouse to position the insertion bar after the closing bracket of the function.

  8. Double click an operand to select it and add it to the Expression Builder.

  9. Double-click another property or type in a literal value in the Expression Builder.

  10. To undo an operation, click the Undo button.

  11. To redo an operation, click the Redo button.

  12. To clear the Expression Builder, click the Erase button.

  13. Click Save to save the expression and return to the CQL construct editor dialog.

2.4.7 Creating an Oracle CQL Template for the Query Wizard

Oracle CEP Visualizer provides a sophisticated Query Wizard to simplify Oracle CQL view and query construction. You can drag and drop a complete Oracle CQL view or query template and customize it to suit your needs. This procedure describes how to create your own templates and add them to the Query Wizard Templates palette.

An Oracle CQL template is based on the wlevs_queryconstructor_config.xsd from Appendix A, "Oracle CQL Query Wizard Template Schema Reference". However, a user-defined template may contain only the following:

  • select-block

  • from-block

  • where-block

  • Operator element and attributes ID and type

  • Operator element inputs child element

For more information on using templates to create an Oracle CQL rule, see Section 2.4.1, "Creating a Rule in an Oracle CQL Processor Using the Query Wizard".

To create an Oracle CQL template for the Query Wizard:

  1. Using your favorite editor, create an XML file and add the header shown in Example 2-6.

    Example 2-6 myTemplate.xml XML File

    <?xml version="1.0" encoding="UTF-8"?>
    
  2. Create a Rule element as Example 2-7 shows.

    Example 2-7 Rule Element

    <?xml version="1.0" encoding="UTF-8"?>
    <Rule>
        <select-block>
    
        </select-block>
    
        <from-block>
    
        </from-block>
    
        <where-block>
    
        </where-block>
    
    
    </Rule>
    
  3. Add Operator elements to your template as Example 2-8 shows.

    Configure each Operator with a unique ID and specify the type attribute.

    Configure the Rule element root attribute with the ID of the operator that is the root (or ending point) of your rule. In Example 2-8, the Operator of type Output with the ID 10 is the root of the rule.

    Example 2-8 Rule Element: Operators

    <?xml version="1.0" encoding="UTF-8"?>
    <Rule root="10">
        <select-block>
    
            <Operator ID="10" type="Output">
            </Operator>
    
            <Operator ID="9" type="IStream">
            </Operator>
    
            <Operator ID="7" type="Select">
            </Operator>
    
        </select-block>
    
        <from-block>
    
            <Operator ID="1" type="SSource">
            </Operator>
     
            <Operator ID="2" type="Window">
            </Operator>
            
            <Operator ID="3" type="SSource">
            </Operator>
            
            <Operator ID="4" type="Window">
            </Operator>
    
        </from-block>
    
        <where-block>
    
            <Operator ID="5" type="Join">
            </Operator>
    
        </where-block>
    </Rule>
    
  4. Connect your operators together by adding inputs elements as Example 2-9 shows.

    Example 2-9 Rule Element: Connect Operators

    <?xml version="1.0" encoding="UTF-8"?>
    <Rule root="9">
        <select-block>
    
            <Operator ID="10" type="Output">
                <inputs>
                    <input>9</input>
                </inputs>
            </Operator>
    
            <Operator ID="9" type="IStream">
                <inputs>
                    <input>8</input>
                </inputs>
            </Operator>
    
            <Operator ID="7" type="Select">
                <inputs>
                    <input>5</input>
                </inputs>
            </Operator>
    
        </select-block>
    
        <from-block>
    
            <Operator ID="1" type="SSource">
            </Operator>
     
            <Operator ID="2" type="Window">
                <inputs>
                    <input>1</input>
                </inputs>
            </Operator>
            
            <Operator ID="3" type="SSource">
            </Operator>
            
            <Operator ID="4" type="Window">
                <inputs>
                    <input>3</input>
                </inputs>
            </Operator>
    
        </from-block>
    
        <where-block>
    
            <Operator ID="5" type="Join">
                <inputs>
                    <input>2</input>
                    <input>4</input>
                </inputs>
            </Operator>
    
        </where-block>
    
    </Rule>
    
  5. Save and close your template XML file.

    Note:

    If you enter double-byte characters in your template XML file, ensure that you save the file using UTF-8 encoding. For more information, see Section 1.5.1, "Configuration File Encoding: UTF-8".
  6. Copy your template XML file to the ORACLE_CEP_HOME/user_projects/domains/DOMAIN_DIR/servername/cqltemplate directory of your Oracle CEP server, where ORACLE_CEP_HOME refers to the Oracle CEP installation directory such as d:\oracle_cep, DOMAIN_DIR refers to the name of your domain directory, and servername refers to the name of your server. For example: d:\oracle_cep_home\user_projects\domains\mydomain\myserver1\cqltemplate.

  7. Add the name of your template XML file to the ORACLE_CEP_HOME/user_projects/domains/DOMAIN_DIR/servername/cqltemplate/registry.xml file.

    Example 2-10 shows how to register the template XML file example.xml.

    Example 2-10 Oracle CEP registry.xml File

    <?xml version="1.0" encoding="UTF-8"?>
    <templates>
        <template>
            <name>example</name>
            <filename>example.xml</filename>
            <description>This is an example user-defined cql statement</description>
        </template>
    </templates>
    

    The template element name child element determines the title that the Query Wizard displays in the User-defined templates tab for this template.

  8. Exit out of the Oracle CEP Visualizer and log back in.

    For more information, see Section 1.2, "Starting the Oracle CEP Visualizer".

  9. Open the Oracle CQL Query Wizard and locate your template in the User-defined templates tab as Figure 2-121 shows.

    Figure 2-121 Query Wizard User-defined templates Tab

    Description of Figure 2-121 follows
    Description of "Figure 2-121 Query Wizard User-defined templates Tab"

    For more information, see Section 2.4.1, "Creating a Rule in an Oracle CQL Processor Using the Query Wizard".

2.4.8 Managing the Query Wizard Diagram

This section describes the various tools along the top of the Query Wizard canvas as Figure 2-122 shows.

Figure 2-122 Query Wizard Tools

Description of Figure 2-122 follows
Description of "Figure 2-122 Query Wizard Tools"

You use these tools to manage the Query Wizard diagram of your Oracle CQL statement.

2.4.8.1 Choose Layout

Use the Choose Layout pull-down menu to select alternate ways of distributing CQL constructs and showing their dependencies. You can choose any of:

  • Left-Right

  • Bottom-Top

  • Right-Left

  • Top-Bottom

2.4.8.2 Clear Canvas

Click the Clear Canvas button to erase the current Oracle CQL statement and its diagram from the Query Wizard canvas.

2.4.8.3 Save Query

Click the Save Query button at any time (even if you have not yet completed your Oracle CQL statement) to save your work to your local disk instead of the host.

2.4.8.4 Open Query

Click the Open Query button to reload a previously saved query.

2.4.8.5 Hover

Check the Hover option to display the Oracle CQL statement fragment associated with a given stage when you hover your mouse pointer over that stage.

Uncheck the Hover option to disable this feature.

2.4.8.6 Zoom In and Zoom Out

Click the Zoom In and Zoom Out buttons to change the zoom level. This is an alternative to using the Zoom slider (see Section 2.4.8.9, "Zoom").

2.4.8.7 Fit Content

Click the Fit Content button to adjust the zoom level automatically to make all of the diagram visible in the current browser window.

2.4.8.8 Toggle Constructs

Click the Toggle Constructs button to alternately hide and show the CQL Constructs and Templates gallery.

2.4.8.9 Zoom

Use the Zoom slider to increase or decrease the zoom level. This is an alternative to using the Zoom In and Zoom Out buttons (see Section 2.4.8.6, "Zoom In and Zoom Out").

2.4.9 Viewing a Query Plan for an Oracle CQL Processor

Oracle CEP Visualizer provides a sophisticated Query Plan facility to simplify Oracle CQL query optimization.

Using the Query Plan facility, you can decompose a given Oracle CQL processor into its internal operators, states, and synopsis and you can gather various statistics on these operators such as incoming and outgoing number of messages. The Query Plan facility generates one query plan per Oracle CQL processor and applies to all the queries and views you define on that Oracle CQL processor.

The Oracle CQL Query Plan facility is designed to allow system administrators to efficiently diagnose and optimize Oracle CQL query performance.

Note:

Before Oracle CEP Visualizer can generate a query plan, there must be at least one running Oracle CQL query (with the Running attribute set to true) on the Oracle CQL processor. For more information, see Section 2.4.5, "Viewing a Rule in an Oracle CQL Processor".

To view a query plan for an Oracle CQL processor:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application you want to use.

  3. Select the Oracle CQL processor you wish to use:

    1. To use the EPN diagram:

      • Click the Event Processing Network tab.

      • Double-click the Oracle CQL processor you wish to use.

    2. To use the domain tree:

      • Expand the appname > Stages node, where appname is the name of the application you want to use.

      • Click the Oracle CQL processor you wish to use.

      • In the right pane, click the General tab

    The Processor panel is displayed as Figure 2-59 shows.

    Figure 2-123 Oracle CQL Processor Panel

    Description of Figure 2-123 follows
    Description of "Figure 2-123 Oracle CQL Processor Panel"

  4. Click the Query Plan tab.

    The Query Plan tab appears as Figure 2-124 shows.

    Figure 2-124 Query Plan Tab

    Description of Figure 2-124 follows
    Description of "Figure 2-124 Query Plan Tab"

    For information on the various tools along the top of the Query Plan canvas, see Section 2.4.10, "Managing the Query Plan Diagram".

  5. To view properties and values in the Property table for any stage, do either of the following:

    1. Click the stage icon in the query plan diagram on the right.

      The corresponding row in the Data table on the left is also selected.

    2. Click the row in the Data table on the left that corresponds to the stage.

      The corresponding stage icon in the query plan diagram is also selected.

  6. To configure the query plan, click the Query Plan Preference button.

    The Query Plan Preference dialog appears as Figure 2-125 shows.

    Figure 2-125 Query Plan Preference Dialog

    Description of Figure 2-125 follows
    Description of "Figure 2-125 Query Plan Preference Dialog"

  7. Edit the dialog as Table 2-31 describes.

    Table 2-31 Query Plan Preference Attributes

    Attribute Description

    Draw store/states

    Check this option to have Oracle CEP display store and states in the query plan diagram.

    Displayed Operator Statistics Fields

    Check the statistics you want to see in the Data table on the Query Plan tab.

    To configure the statistics displayed in the table, select:

    • In Messages: the total number of events received by this stage from its inbound stage.

    • Out Messages: the total number of events transmitted by this stage to its outbound stage.

    • Executions: the number of times an Oracle CQL query was executed on this stage.

    • Latest In Messages: the number of messages received from all input queues during the last invocation.

    • Latest out Messages: the number of tuples output by this operator during the last invocation.

    To configure the statistics displayed in the graph, select:

    • NumInMessages: the total number of events received by this stage from its inbound stage.

    • NumOutMessages: the total number of events transmitted by this stage to its outbound stage.

    • NumExecutions: the number of times an Oracle CQL query was executed on this stage.

    • NumInMessagesLatest: the number of messages received from all input queues during the last invocation.

    • NumOutMessagesLatest: the number of tuples output by this operator during the last invocation.

    Note: The Threshold value applies to the statistic you select here

    Threshold

    The maximum value for the Displayed Operator Stats Field in Graph statistic. If a stage exceeds this threshold, the value is colored on the query plan diagram using the color you specify for Alert Color.

    Default: 500.

    Alert Color

    Choose the color used to highlight stages that violate their threshold in the query plan display.

    If you do not want to show violations in color, select white as the alert color.

    Default: red.

    Statistics Refresh Interval (Seconds).

    Specify the frequency at which Oracle CEP collects statistics (in seconds).

    Default: 5.


  8. To start gathering statistics, click the Get Stats button.

    The Get Stats button turns into a Stop Stats button.

    The Data table columns display the current statistics (according to your Displayed Operator Stats Fields in Table preference configuration) and threshold violations (according to your Displayed Operator Stats Field in Graph and Threshold preference configuration) are shown in the query plan diagram in red as Figure 2-126 shows.

    Figure 2-126 Query Plan While Getting Statistics

    Description of Figure 2-126 follows
    Description of "Figure 2-126 Query Plan While Getting Statistics"

  9. To stop getting statistics, click the Stop Stats button.

  10. To drill-down into a stage to determine rate determining steps, do either of the following:

    1. Click the stage icon in the query plan diagram on the right that shows a threshold violation.

      The corresponding row in the Data table on the left is also selected and

    2. Click the row in the Data table on the left that corresponds to the stage.

      The corresponding stage icon in the query plan diagram is also selected.

  11. To view dependencies amongst stages, click on an Output row in the Data table.

    All the dependent stages are selected in the query plan diagram as Figure 2-127 shows.

    Figure 2-127 Query Plan Showing Dependencies

    Description of Figure 2-127 follows
    Description of "Figure 2-127 Query Plan Showing Dependencies"

2.4.10 Managing the Query Plan Diagram

This section describes the various tools along the top of the Query Wizard canvas as Figure 2-128 shows.

Figure 2-128 Query Plan Tools

Description of Figure 2-128 follows
Description of "Figure 2-128 Query Plan Tools"

You use these tools to manage the Query Wizard diagram of your Oracle CQL statement.

2.4.10.1 Choose Layout

Use the Choose Layout pull-down menu to select alternate ways of distributing CQL constructs and showing their dependencies. You can choose any of:

  • Left-Right

  • Bottom-Top

  • Right-Left

  • Top-Bottom

2.4.10.2 Collapse All and Expand All

Use the Collapse All and Expand All buttons to collapse or expand the entries in the Data table.

2.4.10.3 Get Statistics and Stop Statistics

Use the Get Statistics button to instruct Oracle CEP to begin collecting statistics for the stages of the query plan.

When you click on the Get Statistics button, it turns into a Stop Statistics button. Click the Stop Statistics button to stop collecting statistics.

2.4.10.4 Refresh

Use the Refresh button to refresh the Query Plan diagram and Data table.

2.4.10.5 Show Legend

Use the Show Legend check box to show (checked) or hide (unchecked) the CQL Constructs Legend.

2.4.10.6 Preferences

Use the Preferences button to open the Query Plan pre-Renaissance dialog as Figure 2-125 shows.

2.4.10.7 Fit Content

Click the Fit Content button to adjust the zoom level automatically to make all of the diagram visible in the current browser window.

2.4.10.8 Zoom

Use the Zoom slider to increase or decrease the zoom level.

2.5 Managing EPL Rules

This section describes:

Note:

Any changes to rules and Oracle high availability adapters are propagated to the other servers in the same group. That is, all rule and and Oracle high availability adapter configurations is automatically synchronized. Other configuration changes are not synchronized. For example, if you change record/playback or JMS adapter configuration on one server in a multi-server domain, then these changes are not synchronized with the other servers in the same group. For more information, see Section 3.9, "Managing Multi-Server Domains"

For more information, see:

Note:

Oracle CQL replaces Event Processing Language (EPL) in Oracle CEP 11g Release 1 (11.1.1). Oracle CEP supports EPL for backwards compatibility. For more information, see Section 2.4, "Managing Oracle CQL Rules".

2.5.1 Creating a Rule in an EPL Processor

You can create a new rule in an existing Oracle CEP application that uses one or more EPL processors.

To create a rule in an EPL processor:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Expand the appname > Stages node to see a list of the EPN stages in the domain tree, where appname is the name of the application.

  3. Click the EPL processor in which you want to create an EPL rule.

    The Processor panel is displayed as Figure 2-129 shows.

    Figure 2-129 EPL Processor Panel

    Description of Figure 2-129 follows
    Description of "Figure 2-129 EPL Processor Panel"

  4. In the right pane, click the Rules tab.

    The Rules tab appears as Figure 2-130 shows.

    Figure 2-130 EPL Rules Tab

    Description of Figure 2-130 follows
    Description of "Figure 2-130 EPL Rules Tab"

  5. Click in the Rule ID field and enter the name of the rule you want to create.

  6. Click in the Rule field and enter the EPL query string.

  7. Click Create Rule.

    A confirmation dialog appears as Figure 2-131 shows.

    Figure 2-131 Create Rule Dialog

    Description of Figure 2-131 follows
    Description of "Figure 2-131 Create Rule Dialog"

  8. Click OK.

2.5.2 Deleting a Rule From an EPL Processor

You can delete an existing rule in an existing Oracle CEP application that uses one or more EPL processors.

To delete a rule in an EPL processor:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Expand the appname > Stages node to see a list of the EPN stages in the domain tree, where appname is the name of the application.

  3. Click the EPL processor in which you want to create an EPL rule.

    The Processor panel is displayed as Figure 2-129 shows.

    Figure 2-132 EPL Processor Panel

    Description of Figure 2-132 follows
    Description of "Figure 2-132 EPL Processor Panel"

  4. In the right pane, click the Rules tab.

    The Rules tab appears as Figure 2-133 shows.

    Figure 2-133 EPL Rules Tab

    Description of Figure 2-133 follows
    Description of "Figure 2-133 EPL Rules Tab"

  5. Decide what rules you want to delete:

    1. To delete a single rule:

    2. To delete all rules:

  6. Click OK.

2.5.3 Replacing a Rule in an EPL Processor

You can use the replace rule feature of Oracle CEP Visualizer to modify an existing rule. However, you should use this feature with extreme caution; this is because, internally, Oracle CEP Visualizer first deletes the rule and then adds it back again with the replaced text. The deletion of the rule causes all states to be lost before the rule is added again. For this reason, you should replace only stateless rules.

To replace a rule associated with an EPL processor:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Expand the appname > Stages node to see a list of the EPN stages in the domain tree, where appname is the name of the application.

  3. Click the EPL processor in which you want to create an EPL rule.

    The Processor panel is displayed as Figure 2-129 shows.

    Figure 2-136 EPL Processor Panel

    Description of Figure 2-136 follows
    Description of "Figure 2-136 EPL Processor Panel"

  4. In the right pane, click the Rules tab.

    The Rules tab appears as Figure 2-133 shows.

    Figure 2-137 EPL Rules Tab

    Description of Figure 2-137 follows
    Description of "Figure 2-137 EPL Rules Tab"

  5. Select the rule you want to replace.

  6. Click in the Rule field and enter the new EPL query string.

  7. Click Replace Rule.

    A confirmation dialog appears as Figure 2-131 shows.

    Figure 2-138 Replace Rule Dialog

    Description of Figure 2-138 follows
    Description of "Figure 2-138 Replace Rule Dialog"

  8. Click OK.

2.5.4 Changing the dataservices Application Event Filter Rule Using EPL

The com.bea.wlevs.dataservices application includes the MonitorProcessor which in turn is associated with a default rule used to filter the events that are outputted to the diagnostic Dashboard. You can change this rule, or add new ones, if you want to customize this filtering.

You can only change the dataservices application event filter rule using EPL rules.

The event type used in an EPL rule is com.bea.wlev.dataservice.cep.DSMonitorEvent; it has the following properties:

  • profile—Name of the diagnostic profile.

  • date —Date and timestamp.

  • metric—Metric number.

  • start—Start stage name.

  • end—End stage name.

  • type—The type of metric; valid values are avg-latency, avg-throughput or max-latency.

  • application—Application name

For example, if you want to filter the monitoring events by type and metric, you might change the EPL rules to the following:

  SELECT * FROM DSMonitorEvent 
  RETAIN 1 EVENT 
  WHERE metric < 300 AND type = 'avg-latency'
  SELECT * FROM DSMonitorEvent 
  RETAIN 1 EVENT 
  WHERE metric < 300 AND type = 'avg-throughput'
  SELECT * FROM DSMonitorEvent 
  RETAIN 1 EVENT 
  WHERE metric < 300 AND type = 'max-latency'

If you want to continuously view three events where the number of metrics is less than 300 and group the events by type, try this EPL rule:

  SELECT *, COUNT(metric)
  FROM DSMonitorEvent
  RETAIN BATCH OF 3 EVENTS PARTITION BY type
  WHERE metric < 300
  HAVING COUNT(metric) = 3
  OUTPUT LAST 1 EVERY 3 EVENTS

If you want to continuously view three events where the average number of metrics is less than 300 and group the events by type, try this EPL rule:

  SELECT *, AVG(metric)
  FROM DSMonitorEvent
  RETAIN BATCH OF 3 EVENTS PARTITION BY type
  HAVING AVERAGE(metric) < 300
  OUTPUT LAST 1 EVERY 3 EVENTS

For more information, see Oracle CEP EPL Language Reference.

To change the dataservices application event filter rule using EPL:

  1. In the left pane, click Domain > Server > Applications > com.bea.wlevs.dataservices > Stages > MonitorProcessor, where Domain is the name of your domain and Server is the name of your server.

  2. In the right pane, click the Rules tab.

    The Rules tab appears as Figure 2-139 shows.

    Figure 2-139 EPL Rules Tab

    Description of Figure 2-139 follows
    Description of "Figure 2-139 EPL Rules Tab"

  3. To create a new Rule, enter a the name of the rule in the Rule ID field, enter the EPL query string in the Rule field, then click Create Rule.

    For more information, see Section 2.5.1, "Creating a Rule in an EPL Processor".

  4. To delete an existing rule, select a rule in the table and click Delete Rule.

    For more information, see Section 2.5.2, "Deleting a Rule From an EPL Processor".

  5. To change the default rule, click its name in the Rules table, make the change in the Rule field in the Working Area, and click Replace Rule.

    For more information, see Section 2.5.3, "Replacing a Rule in an EPL Processor".

2.6 Managing Configuration History

This section describes:

For more information, see Section 2.1.4, "Configuration History Management".

2.6.1 How to Manage Resource Configuration History

You can manage configuration history by resource. You can manage the configuration history of the resources that Section 2.1.4.1, "Resource Configuration History Management" describes.

Alternatively, you can view configuration change history by application (see Section 2.6.2, "How to Manage Application Configuration History").

To manage resource configuration history:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application whose configuration history you want to manage.

  3. In the right pane, click the History tab.

    The History tab is displayed as Figure 2-140 shows.

  4. In the right pane, click the Revisions tab.

    The Revisions tab appears as Figure 2-141 shows.

    Figure 2-141 Revisions Tab

    Description of Figure 2-141 follows
    Description of "Figure 2-141 Revisions Tab"

  5. Filter the list of revisions by entering an appropriate Start Time and End Time and then click Refresh.

    The list refreshes to show only the revisions made in this time period.

  6. Manage the resource change records:

    • To delete a revision, click Delete.

      All the revisions pertaining to the selected Start Time and End Time are deleted from the resource change history but resource configuration is unchanged.

    • To undo (roll back) the changes that the revision specifies, click Undo.

      All the revisions pertaining to the selected Start Time and End Time are rolled back and the affected resources assume the configuration of the previous change record.

2.6.2 How to Manage Application Configuration History

You can manage configuration history by application.

Alternatively, you can manage configuration change history by resource (see Section 2.6.1, "How to Manage Resource Configuration History").

To manage application configuration history:

  1. In the left pane, navigate to and expand the Applications node of the Oracle CEP instance to which the application is deployed.

  2. Select appname, where appname is the name of the application whose configuration history you want to manage.

  3. In the right pane, click the History tab.

    The History tab is displayed as Figure 2-1 shows.

  4. In the right pane, click the Changes tab.

    The Changes tab appears as Figure 2-143 shows.

  5. Filter the list of change records by entering an appropriate Start Time and End Time and then click Refresh.

    The list refreshes to show only the change records that were made in this time period.

  6. Manage the application change records:

    • To delete change records, click Delete.

      All the change records pertaining to the selected Start Time and End Time are deleted from the application change history but the application configuration is unchanged.

    • To undo (roll back) the changes that a change record specifies, click Undo.

      All the change records pertaining to the selected Start Time and End Time are rolled back and the affected application assumes the configuration of the previous change record.