This chapter describes how you can use Oracle Event Processing Visualizer to develop and manage Oracle CQL rules, which you can use to select events as they pass through an event processing network (EPN).
This chapter includes the following sections:
Using the Oracle Event Processing Visualizer, you can manage the Oracle CQL rules in the Oracle CQL processors of an Oracle Event Processing application.
This section describes the following topics:
Oracle Event Processing 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 Event Processing application.
Using the Query Wizard, you can create Oracle CQL views and query. You cannot create Oracle CQL streams and relations. Your deployed Oracle Event Processing application must provide the streams and relations.
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 Channel Properties: Outbound Channel With Query Selector.
Alternatively, you can modify an existing Oracle CQL view or query; see Edit a Rule with the Query Wizard.
Create a Rule with the Query Wizard
In the left pane, navigate to and expand the Applications node of the Oracle Event Processing instance to which the application is deployed.
Select appname, where appname is the name of the application you want to use.
Select the Oracle CQL processor you wish to use:
To use the EPN diagram:
Click the Event Processing Network tab.
Double-click the Oracle CQL processor you wish to use.
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.
Click the Query Wizard tab.
The Query Wizard tab appears as Figure 6-2 shows.
For information on the various tools along the top of the Query Wizard canvas, see Manage the Query Wizard Diagram.
Decide how you want to create the Oracle CQL statement:
To construct the query based on an existing Oracle Event Processing server template:
Click the Templates tab.
Select a template and drag and drop it into the canvas.
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.
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.
Configure the connections between constructs:
To connect constructs, click on a source construct and drag to a destination construct.
Oracle Event Processing Visualizer only allows interconnections that conform to Oracle CQL syntax.
Figure 6-3 shows a valid interconnection.
Figure 6-4 shows an invalid interconnection.
To abandon a connection attempt, click the Esc key on your keyboard.
To delete an existing connection, click on the connection to select it and then click the Delete key on your keyboard.
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.
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
Enter a query name in the Query Id field and click Save.
A confirmation dialog appears as Figure 6-6 shows.
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 Event Processing Visualizer from the same local host.
To reload your Oracle CQL statement after saving, click the Load Query button.
The All Saved Queries dialog appears as Figure 6-7 shows.
Figure 6-7 All Saved Queries Dialog: Loading
Select your query and click Load CQL.
The Oracle CQL statement is loaded to the canvas.
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 Configure an Output CQL Construct.
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 Channel Properties: Outbound Channel .
Oracle Event Processing 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 Event Processing 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 Event Processing application must provide the streams and relations.
Edit a Rule with the Query Wizard:
In the left pane, navigate to and expand the Applications node of the Oracle Event Processing instance to which the application is deployed.
Select appname, where appname is the name of the application you want to use.
Select the Oracle CQL processor you wish to use:
To use the EPN diagram:
Click the Event Processing Network tab.
Double-click the Oracle CQL processor you wish to use.
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-8 shows.
Click the CQL Rules tab.
The CQL Rules tab appears as Figure 6-9 shows.
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
For information on the various tools along the top of the Query Wizard canvas, see Manage the Query Wizard Diagram.
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
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
Use the editor dialog to modify the operator.
For information on configuring all the Query Wizard editor dialogs, see Configure Oracle CQL Constructs with Query Wizard.
Click the Add Join button to apply your changes to the generated Oracle CQL statement.
Click the Validate button to ensure that your changes are syntactically correct.
Correct any errors before proceeding.
Click Save to save your changes.
Your query is saved in memory.
Double click your query's Output operator.
Click Replace Rule.
The Oracle CQL rule is now changed and the new version appears in the CQL Rules tab.
Close the Output construct.
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 Edit a Parameterized Query.
Create a Parameterized Rule
In the left pane, navigate to and expand the Applications node of the Oracle Event Processing instance to which the application is deployed.
Select appname, where appname is the name of the application you want to use.
Select the Oracle CQL processor you wish to use:
To use the EPN diagram:
Click the Event Processing Network tab.
Double-click the Oracle CQL processor you wish to use.
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-13 shows.
Click the CQL Rules tab.
The CQL Rules tab appears as Figure 6-14 shows.
Click the Query radio button.
Click Add Query.
Enter a query name in the Query Id field.
Enter the Oracle CQL query in the Query field.
Use placeholder characters (:
n
) to specify parameterized values.
Configure the Enable option:
To enable the query as soon as it is saved, click true.
To keep the query disabled after it is saved, click false.
Click Save.
A confirmation dialog appears as Figure 6-15 shows.
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 Event Processing Visualizer from the same local host.
Edit the parameterized query to add parameter values as Edit a Parameterized Query describes.
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 Channel Properties: Outbound Channel.
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 parameter values, or delete an existing list of parameter 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:
Parameterized Queries in Oracle CQL Language Reference for Oracle Event Processing.
Edit a Parameterized Query
In the left pane, navigate to and expand the Applications node of the Oracle Event Processing instance to which the application is deployed.
Select appname, where appname is the name of the application you want to use.
Select the Oracle CQL processor you wish to use:
To use the EPN diagram:
Click the Event Processing Network tab.
Double-click the Oracle CQL processor you wish to use.
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-16 shows.
Click the CQL Rules tab.
The CQL Rules tab appears as Figure 6-17 shows.
Figure 6-17 CQL Rules Tab: Parameterized Query
Note:
The Query Wizard button is not available for parameterized queries.
Select the parameterized query.
Use the CQL Rules tab to modify the paramaterized 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 Delete a Parameter.
To delete a parameterized query, you must first delete all query parameters before the Delete Query button is available. For more information, see Delete a Parameter.
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.
You can delete an existing Oracle CQL view or query or delete all Oracle CQL views or queries in an Oracle CQL processor.
Delete a Rule
In the left pane, navigate to and expand the Applications node of the Oracle Event Processing instance to which the application is deployed.
Select appname, where appname is the name of the application you want to use.
Select the Oracle CQL processor you wish to use:
To use the EPN diagram:
Click the Event Processing Network tab.
Double-click the Oracle CQL processor you wish to use.
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.
Click the CQL Rules tab.
The CQL Rules tab appears as Figure 6-27 shows.
Filter the list of rules to show only the type of rule you want to delete:
Select View to see only view rules.
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.
Decide what rules you want to delete:
To delete a single rule:
Select the rule you want to delete.
Click Delete View or Delete Query.
A confirmation dialog appears as Figure 6-29 shows.
To delete all rules:
Click Cancel to unselect any rules that may be currently selected.
Click Delete All Views or Delete All Queries.
A confirmation dialog appears as Figure 6-30 shows.
Click OK.
Using Oracle Event Processing Visualizer, you can replace an existing view or query by either editing the Oracle CQL statement directly or using the Query Wizard.
Replace a Rule
In the left pane, navigate to and expand the Applications node of the Oracle Event Processing instance to which the application is deployed.
Select appname, where appname is the name of the application you want to use.
Select the Oracle CQL processor you wish to use:
To use the EPN diagram:
Click the Event Processing Network tab.
Double-click the Oracle CQL processor you wish to use.
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.
Click the CQL Rules tab.
The CQL Rules tab appears as Figure 6-32 shows.
Filter the list of rules to show only the type of rule you want to replace:
Select View to see only view rules.
Select Query to see only query views.
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.
Edit the Oracle CQL statement by doing one of the following:
Directly edit the Oracle CQL statement in the View or Query field.
Click the Query Wizard button to edit the rule in the Query Wizard.
For more information, see Edit a Rule with the Query Wizard.
Commit your changes:
If you directly edited the Oracle CQL statement in the View or Query field, click Replace View or Replace Query.
If you edited the Oracle CQL statement using the Query Wizard, you commit your changes in the Query Wizard.
For more information, see Edit a Rule with the Query Wizard.
Using Oracle Event Processing Visualizer, you can view the existing rules defined on an Oracle CQL processor.
View a Rule
In the left pane, navigate to and expand the Applications node of the Oracle Event Processing instance to which the application is deployed.
Select appname, where appname is the name of the application you want to use.
Select the Oracle CQL processor you wish to use:
To use the EPN diagram:
Click the Event Processing Network tab.
Double-click the Oracle CQL processor you wish to use.
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-34 shows.
Click the CQL Rules tab.
The CQL Rules tab appears as Figure 6-35 shows.
This section describes how to configure the various Oracle CQL constructs that the Query Wizard provides, including:
The RSource Oracle CQL construct represents an Oracle CQL relation that your Oracle Event Processing application provides or a relation type of view that you create. To create a stream type of source, an SSource, see Configure an SSource CQL Construct.
Configure an RSource CQL Construct
The SSource Oracle CQL construct represents an Oracle CQL stream that your Oracle Event Processing application provides or a stream type of view you create. To create a relation type of source, an RSource, see Configure an RSource CQL Construct.
Configure an SSource 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:
Configure a Cache-Table CQL Construct
The Pattern Oracle CQL construct represents the Oracle CQL MATCH_RECOGNIZE
condition. The MATCH_RECOGNIZE
condition is the principle means of performing 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:
PATTERN
: Use this clause to specify quantifiers that constrain and control when conditions in the DEFINE
clause match.
See Figure 6-43.
DEFINE
: Use this clause to specify one or more conditions. Specify one or more patterns made up of a pattern identifier, the AS
operator, and a condition. The condition can use any stream elements in the schema of the stream, view, or sliding window specified by the identifier you used in your query or view select statement.
See Figure 6-44.
SUBSET
: Using this clause, you can bind a name to the stream elements that one or more patterns select. You can use this named subset in the MEASURE
and DEFINE
clauses.
See Figure 6-45.
MEASURE
: Use this clause to define expressions in a MATCH_RECOGNIZE
condition and to bind stream elements that match conditions in the DEFINE
clause to arguments that you can include in the select statement of a query. You can use any of the Oracle CQL built-in or user-defined functions.
See Figure 6-46.
For more information and detailed syntax, see Pattern Recognition in Oracle CQL Language Reference for Oracle Event Processing.
Configure a Pattern CQL Construct
The Select Oracle CQL construct represents the Oracle CQL SELECT
clause. For information on representing the WHERE
clause, see Configure a Filter CQL Construct.
The Select Oracle CQL construct editor provides a tab for each of the following sub-clauses:
select_clause
: Use this clause to specify the stream elements to select from the stream or view you specify.
See Figure 6-48.
opt_group_by_clause
: Use this clause to specify optional grouping conditions your query applies to its results.
See Figure 6-49.
opt_having_clause
: Use this clause to restrict the groups of returned stream elements to those groups for which the specified condition
is TRUE
. If you omit this clause, then Oracle Event Processing returns summary results for all groups.
See Figure 6-50.
order_by_clause
: Use this clause to specify optional ordering conditions your query applies to its results.
See Figure 6-51.
Configure a Select CQL Construct
Double click the Select icon as Figure 6-47 shows.
Figure 6-47 Select Icon
The Select editor dialog appears as Figure 6-48 shows.
Figure 6-48 Query Wizard Select Editor Dialog: Project Tab
Edit the Project tab as Table 6-9 describes.
The general procedure is:
Select a Source.
Select a Target event type.
Double click a property in the Properties list to add the property to the Project expression field.
Click the Expression Builder button and create a Project expression.
In the AS field, enter an alias for the project expression result or select one of the Target event type attributes.
Click the Add button.
To remove a project expression, select it in the Project predicates list and click Delete.
Optionally, check Distinct.
Table 6-9 Query Wizard Select Editor Attributes: Project Tab
|
Click the Group tab.
The Group tab editor dialog appears as Figure 6-49 shows.
Figure 6-49 Query Wizard Select Editor Dialog: Group Tab
Edit the Group tab as Table 6-10 describes.
The general procedure is:
Select a source from the pull down menu.
Select a property in the Properties list.
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
|
Click the Condition tab.
The Condition tab editor dialog appears as Figure 6-50 shows.
Figure 6-50 Query Wizard Select Editor Dialog: Condition Tab
Edit the Condition tab as Table 6-11 describes.
Table 6-11 Query Wizard Select Editor Attributes: Condition Tab
|
Click the Order tab.
The Order tab editor dialog appears as Figure 6-51 shows.
Figure 6-51 Query Wizard Select Editor Dialog: Order Tab
Edit the Order tab as Table 6-12 describes.
The general procedure is:
Select a source from the pull down menu.
Select a property in the Properties list.
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
|
Click the Validate button to ensure that your changes are syntactically correct.
Correct any errors before proceeding.
Click Save.
The Select icon displays a green check mark to indicate that it is configured.
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 Configure a Join CQL Construct Using LEFT or RIGHT OUTER JOIN.
Configure a Join CQL Construct
Double click the Join icon as Figure 6-52 shows.
Figure 6-52 Join Icon
The Join editor dialog appears as Figure 6-53 shows.
Figure 6-53 Query Wizard Join Editor Dialog
Edit the dialog as Table 6-13 describes.
Table 6-13 Query Wizard Join Editor Attributes
|
Select a source from the Source 1 pull-down menu.
Select a source from the Source 2 pull-down menu.
Select a property in the Source 1 Properties list to join on.
Select a property in the Source 2 Properties list to join on.
Choose the Join Type.
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.
To add the join predicate to the generated CQL statement, click the Add Join button.
To remove the join predicate from the generated CQL statement, click the Undo Join button.
Click the Validate button to ensure that your changes are syntactically correct.
Correct any errors before proceeding.
Click Save.
The Join icon displays a green check mark to indicate that it is configured.
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 Configure a Join CQL Construct Using + Syntax.
Figure 6-54 shows an example Oracle CQL outer join in the query constructor.
Configure a Join CQL Construct Using LEFT or RIGHT OUTER JOIN:
The Window Oracle CQL construct represents an Oracle CQL stream-to-relation operator.
Configure a Window CQL Construct
Double click the Window icon as Figure 6-57 shows.
Figure 6-57 Window Icon
The Window editor dialog appears as Figure 6-58 shows.
Figure 6-58 Query Wizard Window Editor Dialog
Edit the dialog as Table 6-14 describes.
Table 6-14 Query Wizard Window Editor Attributes
|
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.
Select the Type.
The Partition type is inactive unless you add one or more stream elements to the Partition List.
Select Row Based or Time Based for the selected type.
Enter the size of the window:
For a Row Based type, enter a number of rows (tuples or stream elements).
For a Time Based type, enter a number of time units and select the time unit.
Select a Slide:
For a Row Based type, enter a number of rows (tuples or stream elements).
For a Time Based type, enter a number of time units and select the time unit.
Click the Validate button to ensure that your changes are syntactically correct.
Correct any errors before proceeding.
To add the window to the generated CQL statement, click the Add Window button.
Click Save.
The Window icon displays a green check mark to indicate that it is configured.
The Filter Oracle CQL construct represents an Oracle CQL WHERE
clause. For information on representing the SELECT
and FROM
clauses, see Configure a Select CQL Construct.
Configure a Filter CQL Construct
Double click the Filter icon as Figure 6-59 shows.
Figure 6-59 Filter Icon
The Filter editor dialog appears as Figure 6-60 shows.
Figure 6-60 Query Wizard Filter Editor Dialog
Edit the dialog as Table 6-15 describes.
Table 6-15 Query Wizard Filter Editor Attributes
|
Define the filter predicate by doing one of the following:
Enter the filter predicate directly.
Click the Expression Builder button.
For more information, see Configure an Expression Using the Expression Builder.
To add a condition expression to the generated CQL statement, click the Add Filter button.
To remove the condition expression from the generated CQL statement, click the Delete Filter button.
Click the Validate button to ensure that your changes are syntactically correct.
Correct any errors before proceeding.
Click Save.
The Source icon displays a green check mark to indicate that it is configured.
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 all
between two relations or two streams. You cannot perform a union between a relation and a stream.
Configure a Union 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.
Configure an Intersect 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.
Configure a Minus 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.
Configure an IStream 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
.
Configure a DStream 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.
Configure an RStream 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.
Configure an Output CQL Construct
Double click the Output icon as Figure 6-73 shows.
Figure 6-73 Output Icon
The Output editor dialog appears as Figure 6-74 shows.
Figure 6-74 Query Wizard Output Editor Dialog
Edit the dialog as Table 6-22 describes.
Table 6-22 Query Wizard Output Editor Attributes
|
To inject a new instance of the entire Oracle CQL rule into the Oracle CQL processor:
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.
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.
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.
Click the Validate button to ensure that your changes are syntactically correct.
Correct any errors before proceeding.
Click Save.
The Output icon displays a green check mark to indicate that it is configured.
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.
Configure an Expression Using the Expression Builder
Oracle Event Processing 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 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 Create a Rule with the Query Wizard.
Create an Oracle CQL Template for the Query Wizard:
This section describes the various tools along the top of the Query Wizard canvas as Figure 6-77 shows.
You use these tools to manage the Query Wizard diagram of your Oracle CQL statement.
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
Click the Clear Canvas button to erase the current Oracle CQL statement and its diagram from the Query Wizard canvas.
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.
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.
Click the Zoom In and Zoom Out buttons to change the zoom level. This is an alternative to using the Zoom slider (see Zoom).
Click the Fit Content button to adjust the zoom level automatically to make all of the diagram visible in the current browser window.
Click the Toggle Constructs button to alternately hide and show the CQL Constructs and Templates gallery.
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 Zoom In and Zoom Out).
Oracle Event Processing 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 Event Processing 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 View a Rule.
You can view a query plan for an Oracle CQL processor using the Oracle Event Processing Visualizer.
View a Query Plan for an Oracle CQL Processor
In the left pane, navigate to and expand the Applications node of the Oracle Event Processing instance to which the application is deployed.
Select appname, where appname is the name of the application you want to use.
Select the Oracle CQL processor you wish to use:
To use the EPN diagram:
Click the Event Processing Network tab.
Double-click the Oracle CQL processor you wish to use.
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-78 shows.
Click the Query Plan tab.
The Query Plan tab appears as Figure 6-79 shows.
For information on the various tools along the top of the Query Plan canvas, see Manage the Query Plan Diagram.
To view properties and values in the Property table for any stage, do either of the following:
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.
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.
To configure the query plan, click the Query Plan Preference button.
The Query Plan Preference dialog appears as Figure 6-80 shows.
Edit the dialog as Table 6-24 describes.
Table 6-24 Query Plan Preference Attributes
|
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
To stop getting statistics, click the Stop Stats button.
To drill-down into a stage to determine rate determining steps, do either of the following:
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
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.
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
This section describes the various tools along the top of the Query Wizard canvas as Figure 6-83 shows.
You use these tools to manage the Query Wizard diagram of your Oracle CQL statement.
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
Use the Collapse All and Expand All buttons to collapse or expand the entries in the Data table.
Use the Get Statistics button to instruct Oracle Event Processing 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.
Use the Show Legend check box to show (checked) or hide (unchecked) the CQL Constructs Legend.
Use the Preferences button to open the Query Plan pre-Renaissance dialog as Figure 6-80 shows.
Click the Fit Content button to adjust the zoom level automatically to make all of the diagram visible in the current browser window.