Skip Headers
Oracle® Fusion Middleware Visualizer User's Guide for Oracle Event Processing
11g Release 1 (11.1.1.7)

Part Number E14302-09
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

7 Managing EPL Rules

This chapter describes how you can use Oracle Event Processing Visualizer to develop and manage Event Processing Language (EPL) rules, a deprecated language for selecting events as they pass through an event processing network (new applications should use Oracle Continuous Query Language).

This chapter includes the following sections:

Note:

Oracle CQL replaces Event Processing Language (EPL). Oracle Event Processing supports EPL for backwards compatibility. For more information, see Chapter 6, "Managing Oracle CQL Rules".

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 Chapter 18, "Managing Multi-Server Domains"

For more information, see:

7.1 Creating a Rule in an EPL Processor

You can create a new rule in an existing Oracle Event Processing application that uses one or more EPL processors.

7.1.1 How to Create a Rule in an EPL Processor

You can create a rule in an EPL processor using the Oracle Event Processing Visualizer.

To create a rule in an EPL processor:

  1. In the left pane, navigate to and expand the Applications node of the Oracle Event Processing 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 7-1 shows.

    Figure 7-1 EPL Processor Panel

    Description of Figure 7-1 follows
    Description of "Figure 7-1 EPL Processor Panel"

  4. In the right pane, click the Rules tab.

    The Rules tab appears as Figure 7-2 shows.

  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 7-3 shows.

    Figure 7-3 Create Rule Dialog

    Description of Figure 7-3 follows
    Description of "Figure 7-3 Create Rule Dialog"

  8. Click OK.

7.2 Deleting a Rule From an EPL Processor

You can delete an existing rule in an existing Oracle Event Processing application that uses one or more EPL processors.

7.2.1 How to Delete a Rule in an EPL Processor

You can delete a rule in an EPL processor using the Oracle Event Processing Visualizer.

To delete a rule in an EPL processor:

  1. In the left pane, navigate to and expand the Applications node of the Oracle Event Processing 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 7-1 shows.

    Figure 7-4 EPL Processor Panel

    Description of Figure 7-4 follows
    Description of "Figure 7-4 EPL Processor Panel"

  4. In the right pane, click the Rules tab.

    The Rules tab appears as Figure 7-5 shows.

  5. Decide what rules you want to delete:

    1. To delete a single rule:

    2. To delete all rules:

  6. Click OK.

7.3 Replacing a Rule in an EPL Processor

You can use the replace rule feature of Oracle Event Processing Visualizer to modify an existing rule. However, you should use this feature with extreme caution; this is because, internally, Oracle Event Processing 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.

7.3.1 How to Replace a Rule in an EPL Processor

You can replace a rule in an EPL processor using the Oracle Event Processing Visualizer.

To replace a rule in an EPL processor:

  1. In the left pane, navigate to and expand the Applications node of the Oracle Event Processing 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 7-1 shows.

    Figure 7-8 EPL Processor Panel

    Description of Figure 7-8 follows
    Description of "Figure 7-8 EPL Processor Panel"

  4. In the right pane, click the Rules tab.

    The Rules tab appears as Figure 7-5 shows.

  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 7-3 shows.

    Figure 7-10 Replace Rule Dialog

    Description of Figure 7-10 follows
    Description of "Figure 7-10 Replace Rule Dialog"

  8. Click OK.

7.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:

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 Fusion Middleware EPL Language Reference for Oracle Event Processing.

7.4.1 How to Change the Dataservices Application Event Filter Rule Using EPL

You can change the dataservices application event filter EPL rule using the Oracle Event Processing Visualizer.

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 7-11 shows.

    Figure 7-11 EPL Rules Tab

    Description of Figure 7-11 follows
    Description of "Figure 7-11 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 7.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 7.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 7.3, "Replacing a Rule in an EPL Processor".