6 Managing Oracle CQL Rules

This section contains the typical application tasks you can perform with Oracle CEP Visualizer to manage Oracle CQL rules, including:

For more information, see:

6.1 Using the Query Wizard

Using the Oracle CEP Visualizer, you can manage the Oracle CQL rules in the Oracle CQL processors of an Oracle CEP application.

This section describes the following topics:

6.1.1 How to Create 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 Complex Event Processing Developer's Guide for Eclipse.

Note:

An Oracle CQL query will immediately begin outputting events if its input channels provide input events. If you plan to use a query selector on a channel with an upstream Oracle CQL processor, you may observe unwanted query results on the downstream channel between the time you add the query to the upstream Oracle CQL processor and the time you configure the query selector on the downstream channel. For more information, see Section 4.2.1.3, "Channel Properties: Outbound Channel With Query Selector".

Alternatively, you can modify an existing Oracle CQL view or query; see Section 6.1.2, "How to Edit 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 6-1 shows.

    Figure 6-1 Oracle CQL Processor Panel

    Description of Figure 6-1 follows
    Description of "Figure 6-1 Oracle CQL Processor Panel"

  4. Click the Query Wizard tab.

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

    Figure 6-2 Oracle CQL Query Wizard

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

    For information on the various tools along the top of the Query Wizard canvas, see Section 6.1.11, "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 6.1.10, "How to Create 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 6-3 shows a valid interconnection.

      Figure 6-3 Valid Connection

      Description of Figure 6-3 follows
      Description of "Figure 6-3 Valid Connection"

      Figure 6-4 shows an invalid interconnection.

      Figure 6-4 Invalid Connection

      Description of Figure 6-4 follows
      Description of "Figure 6-4 Invalid Connection"

      For more information about valid Oracle CQL syntax, see "Oracle CQL Statements" in the Oracle Complex Event Processing 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 6-5 shows.

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

    Figure 6-5 All Saved Queries Dialog: Saving

    Description of Figure 6-5 follows
    Description of "Figure 6-5 All Saved Queries Dialog: Saving"

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

    A confirmation dialog appears as Figure 6-6 shows.

    Figure 6-6 Query Save Dialog

    Description of Figure 6-6 follows
    Description of "Figure 6-6 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 6-7 shows.

    Figure 6-7 All Saved Queries Dialog: Loading

    Description of Figure 6-7 follows
    Description of "Figure 6-7 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 6.1.9.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 4.2.1.2, "Channel Properties: Outbound Channel".

6.1.2 How to Edit 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 Complex Event Processing Developer's Guide for Eclipse.

To edit 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 6-1 shows.

    Figure 6-8 Oracle CQL Processor Panel

    Description of Figure 6-8 follows
    Description of "Figure 6-8 Oracle CQL Processor Panel"

  4. Click the CQL Rules tab.

    The CQL Rules tab appears as Figure 6-32 shows.

  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 6-10 shows.

    Figure 6-10 Query Wizard: With Existing Rule

    Description of Figure 6-10 follows
    Description of "Figure 6-10 Query Wizard: With Existing Rule"

    For information on the various tools along the top of the Query Wizard canvas, see Section 6.1.11, "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 6-11 shows.

    Figure 6-11 Hovering Over an Oracle CQL Operator

    Description of Figure 6-11 follows
    Description of "Figure 6-11 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 6-12 shows the editor dialog after double clicking the Join operator.

    Figure 6-12 Editor Dialog for Oracle CQL Join Operator

    Description of Figure 6-12 follows
    Description of "Figure 6-12 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 6.1.9, "How to Configure 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.

6.1.3 How to Create a Parameterized Rule in an Oracle CQL Processor

You can create a parameterized Oracle CQL query.

Note:

You cannot delete a parameterized query and you cannot edit the Oracle CQL query using the Query Wizard.

For more information, see:

To create a parameterized 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 6-1 shows.

    Figure 6-13 Oracle CQL Processor Panel

    Description of Figure 6-13 follows
    Description of "Figure 6-13 Oracle CQL Processor Panel"

  4. Click the CQL Rules tab.

    The CQL Rules tab appears as Figure 6-32 shows.

    Figure 6-14 CQL Rules Tab

    Description of Figure 6-14 follows
    Description of "Figure 6-14 CQL Rules Tab"

  5. Click the Query radio button.

  6. Click Add Query.

  7. Enter a query name in the Query Id field.

  8. Enter the Oracle CQL query in the Query field.

    Use placeholder characters (:n) to specify parameterized values.

  9. Configure the Enable option:

    1. To enable the query as soon as it is saved, click true.

    2. To keep the query disabled after it is saved, click false.

  10. Click Save.

    A confirmation dialog appears as Figure 6-15 shows.

    Figure 6-15 Query Save Dialog

    Description of Figure 6-15 follows
    Description of "Figure 6-15 Query Save Dialog"

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

  12. Edit the parameterized query to add parameter values as Section 6.1.4, "How to Edit a Parameterized Query in an Oracle CQL Processor" describes.

  13. 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 4.2.1.2, "Channel Properties: Outbound Channel".

6.1.4 How to Edit a Parameterized Query in an Oracle CQL Processor

You can edit the parameter values of an existing Oracle CQL parameterized query. You can add a new list of parameter values, modify an existing list of paramter values, or delete an existing list of paramter values.

Note:

You cannot add or remove placeholder characters (:n) nor can you edit the Oracle CQL query using the Query Wizard.

For more information, see:

To edit a parameterized query 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 6-1 shows.

    Figure 6-16 Oracle CQL Processor Panel

    Description of Figure 6-16 follows
    Description of "Figure 6-16 Oracle CQL Processor Panel"

  4. Click the CQL Rules tab.

    The CQL Rules tab appears as Figure 6-32 shows.

    Figure 6-17 CQL Rules Tab: Parameterized Query

    Description of Figure 6-17 follows
    Description of "Figure 6-17 CQL Rules Tab: Parameterized Query"

    Note:

    The Query Wizard button is not available for parameterized queries.
  5. Select the parameterized query.

  6. Use the CQL Rules tab to modify the paramaterized query:

6.1.4.1 Adding a Parameter

To add a parameter to a paramterized query:

  1. Click the Add Parameter button.

    The CQL Rules tab changes as Figure 6-18 shows.

    Figure 6-18 CQL Rules Tab: Add Parameter

    Description of Figure 6-18 follows
    Description of "Figure 6-18 CQL Rules Tab: Add Parameter"

  2. Enter a binding name in the Binding Name field.

  3. Enter the new parameter values as a comma-separated list of values in the Binding Values field.

  4. Click Save.

    The Add New Binding Dialog appears as Figure 6-19 shows.

    Figure 6-19 Add New Binding Dialog

    Description of Figure 6-19 follows
    Description of "Figure 6-19 Add New Binding Dialog"

  5. Click OK.

    The CQL Rules tab updates to list the new parameter as Figure 6-20 shows.

    Figure 6-20 CQL Rules Tab: Add Parameter Complete

    Description of Figure 6-20 follows
    Description of "Figure 6-20 CQL Rules Tab: Add Parameter Complete"

6.1.4.2 Replacing a Parameter

To replace a parameter in a paramterized query:

  1. Select an existing parameter as Figure 6-21 shows.

    Figure 6-21 CQL Rules Tab: Select Parameter

    Description of Figure 6-21 follows
    Description of "Figure 6-21 CQL Rules Tab: Select Parameter"

  2. Click Replace Parameter.

  3. The CQL Rules tab changes as Figure 6-22 shows.

    Figure 6-22 CQL Rules: Replace Parameter

    Description of Figure 6-22 follows
    Description of "Figure 6-22 CQL Rules: Replace Parameter"

  4. Edit the Binding Values field.

  5. Click Save.

    The Update Binding Dialog appears as Figure 6-23 shows.

    Figure 6-23 Update Binding Dialog

    Description of Figure 6-23 follows
    Description of "Figure 6-23 Update Binding Dialog"

  6. Click OK.

6.1.4.3 Deleting a Parameter

To delete a parameter in a parametrized query:

  1. Select an existing parameter as Figure 6-24 shows.

    Figure 6-24 CQL Rules Tab: Select Parameter

    Description of Figure 6-24 follows
    Description of "Figure 6-24 CQL Rules Tab: Select Parameter"

  2. Click Delete Parameter.

    The Delete Binding Dialog appears as Figure 6-23 shows.

    Figure 6-25 Delete Binding Dialog

    Description of Figure 6-25 follows
    Description of "Figure 6-25 Delete Binding Dialog"

  3. Click OK.

6.1.4.4 Editing the Query

To edit a parameterized query, you must first delete all query parameters before the Edit Query button is available. For information on deleting parameters, see Section 6.1.4.3, "Deleting a Parameter."

6.1.4.5 Deleting the Query

To delete a parameterized query, you must first delete all query parameters before the Delete Query button is available. For more information, see Section 6.1.4.3, "Deleting a Parameter."

6.1.5 How to Stop and Start a Parameterized Query

When you stop or start a parameterized query, all bindings associated with the parameterized query are stopped or started.

To stop or start a parameterized query, select the query on the CQL Rules tab and click the Stop or Start button.

6.1.6 How to Delete 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 6-26 shows.

    Figure 6-26 Oracle CQL Processor Panel

    Description of Figure 6-26 follows
    Description of "Figure 6-26 Oracle CQL Processor Panel"

  4. Click the CQL Rules tab.

    The CQL Rules tab appears as Figure 6-32 shows.

    Figure 6-27 CQL Rules Tab

    Description of Figure 6-27 follows
    Description of "Figure 6-27 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 6-28 shows.

    Figure 6-28 CQL Rules: Filtered by View

    Description of Figure 6-28 follows
    Description of "Figure 6-28 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.

6.1.7 How to Replace 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 6-31 shows.

    Figure 6-31 Oracle CQL Processor Panel

    Description of Figure 6-31 follows
    Description of "Figure 6-31 Oracle CQL Processor Panel"

  4. Click the CQL Rules tab.

    The CQL Rules tab appears as Figure 6-32 shows.

    Figure 6-32 CQL Rules Tab

    Description of Figure 6-32 follows
    Description of "Figure 6-32 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 6-33 shows.

    Figure 6-33 CQL Rules: Filtered by View

    Description of Figure 6-33 follows
    Description of "Figure 6-33 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 6.1.2, "How to Edit 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 6.1.2, "How to Edit a Rule in an Oracle CQL Processor Using the Query Wizard".

6.1.8 How to View 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 6-1 shows.

    Figure 6-34 Oracle CQL Processor Panel

    Description of Figure 6-34 follows
    Description of "Figure 6-34 Oracle CQL Processor Panel"

  4. Click the CQL Rules tab.

    The CQL Rules tab appears as Figure 6-32 shows.

    Figure 6-35 CQL Rules Tab

    Description of Figure 6-35 follows
    Description of "Figure 6-35 CQL Rules Tab"

6.1.9 How to Configure Query Wizard Oracle CQL Constructs

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

6.1.9.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 6.1.9.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 6-36 shows.

    Figure 6-36 RSource Icon

    RSource icon

    The RSource editor dialog appears as Figure 6-37 shows.

    Figure 6-37 Query Wizard RSource Editor Dialog

    Description of Figure 6-37 follows
    Description of "Figure 6-37 Query Wizard RSource Editor Dialog"

  2. Edit the dialog as Table 6-1 describes.

    Table 6-1 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.

6.1.9.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 6.1.9.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 6-36 shows.

    Figure 6-38 SSource Icon

    SSource icon

    The SSource editor dialog appears as Figure 6-37 shows.

    Figure 6-39 Query Wizard Source Editor Dialog

    Description of Figure 6-39 follows
    Description of "Figure 6-39 Query Wizard Source Editor Dialog"

  2. Edit the dialog as Table 6-1 describes.

    Table 6-2 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.

6.1.9.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 6-40 shows.

    Figure 6-40 Cache-Table Icon

    Cache-Table icon

    The Cache-Table editor dialog appears as Figure 6-41 shows.

    Figure 6-41 Query Wizard Cache-Table Editor Dialog

    Description of Figure 6-41 follows
    Description of "Figure 6-41 Query Wizard Cache-Table Editor Dialog"

  2. Edit the dialog as Table 6-3 describes.

    Table 6-3 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.

6.1.9.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 6-42 shows.

    Figure 6-42 Pattern Icon

    Pattern icon

    The Pattern editor dialog appears as Figure 6-43 shows.

    Figure 6-43 Query Wizard Pattern Editor Dialog: Pattern Tab

    Description of Figure 6-43 follows
    Description of "Figure 6-43 Query Wizard Pattern Editor Dialog: Pattern Tab"

  2. Edit the Pattern tab as Table 6-4 describes.

    Table 6-4 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 6-5 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 Complex Event Processing 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 Complex Event Processing 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 Complex Event Processing 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 Complex Event Processing 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 Complex Event Processing CQL Language Reference.

    Generated CQL Statement

    Editable Oracle CQL fragment associated with this CQL Construct.


    Table 6-5 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 Complex Event Processing CQL Language Reference.

  3. Click the Define tab.

    The Define tab appears as Figure 6-44 shows.

    Figure 6-44 Query Wizard Pattern Editor Dialog: Define Tab

    Description of Figure 6-44 follows
    Description of "Figure 6-44 Query Wizard Pattern Editor Dialog: Define Tab"

  4. Edit the Define tab as Table 6-5 describes.

    Table 6-6 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 6-4). 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 6.1.9.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 Complex Event Processing CQL Language Reference.

  5. Click the Subset tab.

    The Subset tab appears as Figure 6-45 shows.

    Figure 6-45 Query Wizard Pattern Editor Dialog: Subset Tab

    Description of Figure 6-45 follows
    Description of "Figure 6-45 Query Wizard Pattern Editor Dialog: Subset Tab"

  6. Edit the Subset tab as Table 6-7 describes.

    Table 6-7 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 6-4). 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 Complex Event Processing CQL Language Reference.

  7. Click the Measure tab.

    The Measure tab appears as Figure 6-46 shows.

    Figure 6-46 Query Wizard Pattern Editor Dialog: Measure Tab

    Description of Figure 6-46 follows
    Description of "Figure 6-46 Query Wizard Pattern Editor Dialog: Measure Tab"

  8. Edit the Measure tab as Table 6-8 describes.

    Table 6-8 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 6-4) or Subset name attribute of the Subset tab (see Figure 6-45).

    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 6.1.9.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 Complex Event Processing 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.

6.1.9.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 6.1.9.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 6-47 shows.

    Figure 6-47 Select Icon

    Select icon

    The Select editor dialog appears as Figure 6-48 shows.

    Figure 6-48 Query Wizard Select Editor Dialog: Project Tab

    Description of Figure 6-48 follows
    Description of "Figure 6-48 Query Wizard Select Editor Dialog: Project Tab"

  2. Edit the Project tab as Table 6-9 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 6-9 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 Complex Event Processing 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 6.1.9.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 6.1.9.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 6.1.9.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 Complex Event Processing CQL Language Reference.

  3. Click the Group tab.

    The Group tab editor dialog appears as Figure 6-48 shows.

    Figure 6-49 Query Wizard Select Editor Dialog: Group Tab

    Description of Figure 6-49 follows
    Description of "Figure 6-49 Query Wizard Select Editor Dialog: Group Tab"

  4. Edit the Group tab as Table 6-10 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 6-10 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 Complex Event Processing CQL Language Reference.

  5. Click the Condition tab.

    The Condition tab editor dialog appears as Figure 6-48 shows.

    Figure 6-50 Query Wizard Select Editor Dialog: Condition Tab

    Description of Figure 6-50 follows
    Description of "Figure 6-50 Query Wizard Select Editor Dialog: Condition Tab"

  6. Edit the Condition tab as Table 6-11 describes.

    Table 6-11 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 6.1.9.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 Complex Event Processing CQL Language Reference.

  7. Click the Order tab.

    The Order tab editor dialog appears as Figure 6-48 shows.

    Figure 6-51 Query Wizard Select Editor Dialog: Order Tab

    Description of Figure 6-51 follows
    Description of "Figure 6-51 Query Wizard Select Editor Dialog: Order Tab"

  8. Edit the Order tab as Table 6-12 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 6-12 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 Complex Event Processing 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.

6.1.9.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 6.1.9.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 6-52 shows.

    Figure 6-52 Join Icon

    Join icon

    The Join editor dialog appears as Figure 6-53 shows.

    Figure 6-53 Query Wizard Join Editor Dialog

    Description of Figure 6-53 follows
    Description of "Figure 6-53 Query Wizard Join Editor Dialog"

  2. Edit the dialog as Table 6-13 describes.

    Table 6-13 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:

    • No outer join: select this option to create a simple join. For more information, see "Inner Joins" in the Oracle Complex Event Processing CQL Language Reference.

    • Left outer join: select this option to create a left outer join. For more information, see "Left Outer Joins" in the Oracle Complex Event Processing CQL Language Reference.

    • Right outer join: select this option to create a right outer join. For more information, see "Right Outer Joins" in the Oracle Complex Event Processing CQL Language Reference.

    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.

6.1.9.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 6.1.9.6, "Configuring a Join CQL Construct Using + Syntax".

Figure 6-54 shows an example Oracle CQL outer join in the query constructor.

Figure 6-54 Oracle CQL Outer Join

Description of Figure 6-54 follows
Description of "Figure 6-54 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 6-55 shows.

    Figure 6-55 Join Icon

    Join icon

    The Join editor dialog appears as Figure 6-56 shows.

    Figure 6-56 Query Wizard Join Editor Dialog: LEFT or RIGHT OUTER JOIN Syntax

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

6.1.9.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 6-57 shows.

    Figure 6-57 Window Icon

    Window icon

    The Window editor dialog appears as Figure 6-58 shows.

    Figure 6-58 Query Wizard Window Editor Dialog

    Description of Figure 6-58 follows
    Description of "Figure 6-58 Query Wizard Window Editor Dialog"

  2. Edit the dialog as Table 6-14 describes.

    Table 6-14 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 Complex Event Processing 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 Complex Event Processing 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 Complex Event Processing 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 Complex Event Processing 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.

6.1.9.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 6.1.9.5, "Configuring a Select CQL Construct".

For more information, see:

To configure a Filter CQL construct:

  1. Double click the Filter icon as Figure 6-59 shows.

    Figure 6-59 Filter Icon

    Filter icon

    The Filter editor dialog appears as Figure 6-60 shows.

    Figure 6-60 Query Wizard Filter Editor Dialog

    Description of Figure 6-60 follows
    Description of "Figure 6-60 Query Wizard Filter Editor Dialog"

  2. Edit the dialog as Table 6-15 describes.

    Table 6-15 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 6.1.9.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 6.1.9.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.

6.1.9.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 6-61 shows.

    Figure 6-61 Union Icon

    Union icon

    The Union editor dialog appears as Figure 6-62 shows.

    Figure 6-62 Query Wizard Union Editor Dialog

    Description of Figure 6-62 follows
    Description of "Figure 6-62 Query Wizard Union Editor Dialog"

  2. Edit the dialog as Table 6-16 describes.

    Table 6-16 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 Complex Event Processing 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.

6.1.9.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 6-63 shows.

    Figure 6-63 Intersect Icon

    Intersect icon

    The Intersect editor dialog appears as Figure 6-64 shows.

    Figure 6-64 Query Wizard Intersect Editor Dialog

    Description of Figure 6-64 follows
    Description of "Figure 6-64 Query Wizard Intersect Editor Dialog"

  2. Edit the dialog as Table 6-17 describes.

    Table 6-17 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.

6.1.9.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 6-65 shows.

    Figure 6-65 Minus Icon

    Minus icon

    The Minus editor dialog appears as Figure 6-66 shows.

    Figure 6-66 Query Wizard Minus Editor Dialog

    Description of Figure 6-66 follows
    Description of "Figure 6-66 Query Wizard Minus Editor Dialog"

  2. Edit the dialog as Table 6-18 describes.

    Table 6-18 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.

6.1.9.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 6-67 shows.

    Figure 6-67 IStream Icon

    IStream icon

    The IStream editor dialog appears as Figure 6-68 shows.

    Figure 6-68 Query Wizard IStream Editor Dialog

    Description of Figure 6-68 follows
    Description of "Figure 6-68 Query Wizard IStream Editor Dialog"

  2. Edit the dialog as Table 6-19 describes.

    Table 6-19 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.

6.1.9.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 6-69 shows.

    Figure 6-69 DStream Icon

    Dstream icon

    The DStream editor dialog appears as Figure 6-70 shows.

    Figure 6-70 Query Wizard DStream Editor Dialog

    Description of Figure 6-70 follows
    Description of "Figure 6-70 Query Wizard DStream Editor Dialog"

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

    Table 6-20 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.

6.1.9.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 6-71 shows.

    Figure 6-71 RStream Icon

    RStream icon

    The RStream editor dialog appears as Figure 6-72 shows.

    Figure 6-72 Query Wizard RStream Editor Dialog

    Description of Figure 6-72 follows
    Description of "Figure 6-72 Query Wizard RStream Editor Dialog"

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

    Table 6-21 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.

6.1.9.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 6-73 shows.

    Figure 6-73 Output Icon

    Output icon

    The Output editor dialog appears as Figure 6-74 shows.

    Figure 6-74 Query Wizard Output Editor Dialog

    Description of Figure 6-74 follows
    Description of "Figure 6-74 Query Wizard Output Editor Dialog"

  2. Edit the dialog as Table 6-22 describes.

    Table 6-22 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 Complex Event Processing 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.

6.1.9.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 6-75 shows the Expression Builder after clicking the Expression Builder button in the Pattern construct editor.

    Figure 6-75 Query Wizard Expression Builder

    Description of Figure 6-75 follows
    Description of "Figure 6-75 Query Wizard Expression Builder"

  2. Edit the dialog as Table 6-22 describes.

    Table 6-23 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.

6.1.10 How to Create 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 6.1.1, "How to Create 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 6-1.

    Example 6-1 myTemplate.xml XML File

    <?xml version="1.0" encoding="UTF-8"?>
    
  2. Create a Rule element as Example 6-2 shows.

    Example 6-2 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 6-3 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 6-3, the Operator of type Output with the ID 10 is the root of the rule.

    Example 6-3 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 6-4 shows.

    Example 6-4 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 6-5 shows how to register the template XML file example.xml.

    Example 6-5 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 2.1, "Starting the Oracle CEP Visualizer".

  9. Open the Oracle CQL Query Wizard and locate your template in the User-defined templates tab as Figure 6-76 shows.

    Figure 6-76 Query Wizard User-defined templates Tab

    Description of Figure 6-76 follows
    Description of "Figure 6-76 Query Wizard User-defined templates Tab"

    For more information, see Section 6.1.1, "How to Create a Rule in an Oracle CQL Processor Using the Query Wizard".

6.1.11 Managing the Query Wizard Diagram

This section describes the various tools along the top of the Query Wizard canvas as Figure 6-77 shows.

Figure 6-77 Query Wizard Tools

Description of Figure 6-77 follows
Description of "Figure 6-77 Query Wizard Tools"

You use these tools to manage the Query Wizard diagram of your Oracle CQL statement.

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

6.1.11.2 Clear Canvas

Click the Clear Canvas button to erase the current Oracle CQL statement and its diagram from the Query Wizard canvas.

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

6.1.11.4 Open Query

Click the Open Query button to reload a previously saved query.

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

6.1.11.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 6.1.11.9, "Zoom").

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

6.1.11.8 Toggle Constructs

Click the Toggle Constructs button to alternately hide and show the CQL Constructs and Templates gallery.

6.1.11.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 6.1.11.6, "Zoom In and Zoom Out").

6.2 Using the Query Plan

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.

This section describes the following topics:

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 6.1.8, "How to View a Rule in an Oracle CQL Processor".

6.2.1 How to View a Query Plan for an Oracle CQL Processor

You can view a query plan for an Oracle CQL processor using the Oracle CEP Visualizer.

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 6-1 shows.

    Figure 6-78 Oracle CQL Processor Panel

    Description of Figure 6-78 follows
    Description of "Figure 6-78 Oracle CQL Processor Panel"

  4. Click the Query Plan tab.

    The Query Plan tab appears as Figure 6-79 shows.

    Figure 6-79 Query Plan Tab

    Description of Figure 6-79 follows
    Description of "Figure 6-79 Query Plan Tab"

    For information on the various tools along the top of the Query Plan canvas, see Section 6.2.2, "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 6-80 shows.

    Figure 6-80 Query Plan Preference Dialog

    Description of Figure 6-80 follows
    Description of "Figure 6-80 Query Plan Preference Dialog"

  7. Edit the dialog as Table 6-24 describes.

    Table 6-24 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 6-81 shows.

    Figure 6-81 Query Plan While Getting Statistics

    Description of Figure 6-81 follows
    Description of "Figure 6-81 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 6-82 shows.

    Figure 6-82 Query Plan Showing Dependencies

    Description of Figure 6-82 follows
    Description of "Figure 6-82 Query Plan Showing Dependencies"

6.2.2 Managing the Query Plan Diagram

This section describes the various tools along the top of the Query Wizard canvas as Figure 6-83 shows.

Figure 6-83 Query Plan Tools

Description of Figure 6-83 follows
Description of "Figure 6-83 Query Plan Tools"

You use these tools to manage the Query Wizard diagram of your Oracle CQL statement.

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

6.2.2.2 Collapse All and Expand All

Use the Collapse All and Expand All buttons to collapse or expand the entries in the Data table.

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

6.2.2.4 Refresh

Use the Refresh button to refresh the Query Plan diagram and Data table.

6.2.2.5 Show Legend

Use the Show Legend check box to show (checked) or hide (unchecked) the CQL Constructs Legend.

6.2.2.6 Preferences

Use the Preferences button to open the Query Plan pre-Renaissance dialog as Figure 6-80 shows.

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

6.2.2.8 Zoom

Use the Zoom slider to increase or decrease the zoom level.