Oracle® CEP IDE Developer's Guide for Eclipse Release 11gR1 (11.1.1) E14301-01 |
|
![]() Previous |
![]() Next |
The Oracle CEP Event Processing Network (EPN) is the central concept in an Oracle CEP application. It is the primary point where application components are wired together. Using Oracle CEP IDE for Eclipse, you can use an EPN Editor that provides a graphical view of the EPN and offers visualization and navigation features to help you build Oracle CEP applications.
This section describes how to use the editor and the information it displays, including:
You can open the EPN Editor from either the project folder or a context or configuration file of an Oracle CEP application.
You can open the EPN Editor from the Eclipse project folder of an Oracle CEP application. Alternatively, you can open the EPN Editor from a context or configuration file (see Section 5.1.2, "How to Open the EPN Editor from a Context or Configuration File").
To open the EPN Editor from a project:
Launch the Oracle CEP IDE for Eclipse.
Open your Oracle CEP project in the Project Explorer.
Right-click the project folder and select Open EPN Editor as Figure 5-1 shows.
Figure 5-1 Opening the EPN Editor from a Project
The EPN Editor opens in a tab named EPN:
PROJECT-NAME
, where PROJECT-NAME
is the name of your Oracle CEP project, as Figure 5-2 shows.
You can open the EPN Editor from a Spring context file or an Oracle CEP server configuration file in an Oracle CEP application. Alternatively, you can open the EPN Editor from a context or configuration file (see Section 5.1.1, "How to Open the EPN Editor from a Project Folder")
To open the EPN Editor from a context or configuration file:
Launch the Oracle CEP IDE for Eclipse.
Open your Oracle CEP project in the Project Explorer.
Right-click a context or configuration file and select Open in EPN Editor as Figure 5-3 shows.
Figure 5-3 Opening the EPN Editor from a Context or Configuration File
The EPN Editor opens in a tab named EPN:
PROJECT-NAME
, where PROJECT-NAME
is the name of your Oracle CEP project, as Figure 5-4 shows.
This section describes the main controls you use to manage the EPN view and how the EPN Editor displays Oracle CEP application information, including:
The primary display in the editor is of the flow inside the application as Figure 5-5 shows.
The EPN is composed of nodes connected by links and streams. Nodes are of various types including adapter, processor, database table, bean, and cache. For more information on the graphic notation the EPN Editor uses on nodes, links, and streams, see:
Although you often specify your EPN in a single assembly file, you may specify an EPN across multiple assembly files. By default the EPN Editor shows the entire network with the information combined from all files. To see the network for a single assembly file simply select that file from the Filter pull-down menu as Figure 5-6 shows.
Figure 5-6 Filtering the EPN by Assembly File
You can optimize and simplify the EPN layout by clicking Layout EPN as Figure 5-7 shows.
You can also filter out <bean>
elements with no references in the EPN. Clicking Show/Hide Unconnected Beans will toggle the visibility of such beans as Figure 5-8 shows. For more information, see Section 5.4.3, "Laying Out Nodes".
You can change the zoom level of the EPN Editor by entering a percent value into the zoom field or selecting a value from the zoom field pull-down menu as Figure 5-9 shows. To fit the EPN into the current EPN Editor window, select Fit to Window.
You can export the EPN Editor view to an image file by clicking Export to Image as Figure 5-10 shows. You can export the image as a .bmp
, .gif
, .jpg
, or .png
file.
Figure 5-10 Exporting the EPN as an Image File
You can print the EPN Editor view by clicking Print as Figure 5-11 shows.
Nodes that have configuration information in one of the configuration files in the META-INF/wlevs
directories are badged with an indicator on the bottom right as Figure 5-12 shows.
Nodes with this badge will also have the Go To Configuration Source context menu item.
When working with streams, you can specify a link in the assembly file as a:
source element in the downstream node.
listener element in the upstream node
A circle on the line indicates where a particular link is specified in the assembly file.
Figure 5-13 shows an example in which the link is specified as a source element on the downstream node outStream
so the circle is next to the outStream
node. Figure 5-14 shows the corresponding assembly file.
Figure 5-15 shows an example in which the link is specified as a listener element in the upstream node algoTradingProcessor
so the circle is next to the algoTradingProcessor
node. Figure 5-16 shows the corresponding assembly file.
When you define a child node within a parent node, the child node is said to be nested. Only the parent node can specify the child node as a listener. You can drag references from a nested element, but not to them. For more information, see Section 5.4.2, "Connecting Nodes".
Consider the EPN that Figure 5-17 shows. Example 5-1 shows the EPN assembly source for this EPN. Note that the HelloWorldBean
is nested within the helloworldOutputChannel
. As a result, it appears within a box in the EPN diagram. Only the parent helloworldOutputChannel
may specify the nested bean as a listener.
Example 5-1 Assembly Source for EPN With Nested Bean
<wlevs:adapter id="helloworldAdapter" class="com.bea.wlevs.adapter.example.helloworld.HelloWorldAdapter" > <wlevs:instance-property name="message" value="HelloWorld - the current time is:"/> </wlevs:adapter> <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" > <wlevs:listener ref="helloworldProcessor"/> <wlevs:source ref="helloworldAdapter"/> </wlevs:channel> <wlevs:processor id="helloworldProcessor" /> <wlevs:channel id="helloworldOutputChannel" event-type="HelloWorldEvent" advertise="true"> <wlevs:listener> <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/> </wlevs:listener> <wlevs:source ref="helloworldProcessor"/> </wlevs:channel>
Alternatively, you can define this EPN so that all nodes are nested as Figure 5-18 shows. Example 5-2 shows the EPN assembly source for this EPN. Note that all the nodes are nested and as a result, all nodes appear within a box in the EPN diagram. The helloworldAdapter
is the outermost parent node and does not appear within a box in the EPN diagram.
Example 5-2 Assembly Source for EPN With all Nodes Nested
<wlevs:adapter id="helloworldAdapter" class="com.bea.wlevs.adapter.example.helloworld.HelloWorldAdapter" > <wlevs:instance-property name="message" value="HelloWorld - the current time is:"/> <wlevs:listener> <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" > <wlevs:listener> <wlevs:processor id="helloworldProcessor"> <wlevs:listener> <wlevs:channel id="helloworldOutputChannel" event-type="HelloWorldEvent"> <wlevs:listener> <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/> </wlevs:listener> </wlevs:channel> </wlevs:listener> </wlevs:processor> </wlevs:listener> </wlevs:channel> </wlevs:listener> </wlevs:adapter>
Because the EPN Editor has a view of the whole project it is a natural place from which to navigate to the various artifacts that make up an Oracle CEP application. Oracle CEP IDE for Eclipse offers the following features to help navigate the EPN Editor:
To move the EPN canvas without using the horizontal and vertical scroll bars, you can use any of the following options:
Position the cursor on the canvas, hold down the middle mouse button, and drag.
Hold down the space bar and click and drag the canvas.
In the Overview view, click in the highlight box and drag.
If a node has a configuration object associated with it, then double-clicking that node will open the component configuration file where that node's behavior is defined.
Otherwise, double-clicking that node will open the EPN assembly file (the Spring context file) where that node is defined.
A configuration badge will be shown on nodes with associated configuration objects as shown in Figure 5-19.
Figure 5-19 Node with Configuration Badge
For more information, see:
When editing a component configuration file or EPN assembly file, hold down the Ctrl key to turn on hyperlinking. Using hyperlinking, you can easily move between assembly and configuration files and follow reference IDs to jump to bean implementation classes.
Figure 5-20 shows a component configuration file with the cursor over the value of a processor
element name
child element while holding down the Ctrl key. The name
value has an underline to indicate it is a hyperlink. Click this link to jump to the corresponding element in the EPN assembly file as Figure 5-21 shows.
Figure 5-20 Component Configuration File: Hyperlinking to EPN Assembly File
Similarly, hovering over the wlevs:processor
element id
child element value filterFanoutProcessor
while holding down the Ctrl key allows you to hyperlink back to the component configuration file.
Figure 5-21 EPN Assembly File: Hyperlinking to Component Configuration File
Each node on the EPN Editor has a group of context menu items that provide convenient access to various node-specific functions. Right-click the node to display its context menu.
Depending on the node type, you can use the EPN Editor context menu to select from the following options:
Go to Configuration Source: opens the corresponding component configuration file and positions the cursor in the appropriate element. You can use hyperlinking to quickly move from this file to the corresponding EPN assembly file. For more information, see Section 5.3.3, "Hyperlinking".
Go to Assembly Source: opens the corresponding EPN assembly file and positions the cursor in the appropriate element. You can use hyperlinking to quickly move from this file to the corresponding component configuration file. For more information, see Section 5.3.3, "Hyperlinking"
Go to Java Source: opens the corresponding Java source file for this component.
Delete: deletes the component from both the EPN assembly file and component configuration file (if applicable).
Rename: allows you to change the name of the component. The name is updated in both the EPN assembly file and component configuration file (if applicable).
Help: displays context sensitive help for the component.
Note that these navigation options will become disabled when a corresponding source artifact cannot be found. For example, if an adapter does not have a corresponding entry in a configuration XML file, its Go to Configuration Source menu item will be greyed out.
The EPN Editor allows you to create and edit an application's EPN using actions on the editor surface. Most actions in the EPN Editor result in edits to an assembly file in that application.
The EPN Editor shows the EPN for a single Oracle CEP application bundle. An application may have more than one assembly file that defines the application EPN as Figure 5-22 shows.
When editing an EPN, the assembly file shown in the EPN Editor filter is the assembly file to which new nodes will be added. If the EPN Editor filter is set to Full EPN then the first assembly file in the filter list will be the file to which new nodes will be added. Existing nodes will be edited in or deleted from the assembly file in which they are defined.
If the assembly file the EPN Editor edits is open in an Eclipse source editor, then the edits will be made to the editor for that open file. In this case, you will need to save changes to the open editor before the changes appear in the file on disk.
If the assembly file the EPN Editor edits is not open in an Eclipse source editor, then the edits are immediately applied to the file on disk.
The following sections describe EPN Editor editing tasks, including:
For more information, see:
When adding new nodes to an EPN using the EPN editor, a new node will appear at the location of the mouse click that was used to show the EPN Editor context menu. You can create any of the nodes that Table 5-1 lists.
Table 5-1 EPN Editor Icons
Node | Description |
---|---|
![]() |
Adapter: a node that interfaces an event data source with the EPN or interfaces the EPN with an event data sink. For more information, see: |
|
Bean: a Plain Old Java Object (POJO) node that consumes events. A bean is managed by the Spring framework. For more information, see Chapter 8, "Configuring Custom Adapters, Event Beans, and Spring Beans". |
|
Cache: a node that provides a temporary storage area for events, created exclusively to improve the overall performance of your Oracle CEP application. For more information, see Chapter 12, "Configuring Caching". |
|
Channel: a node that conveys events between an event data source and an event data sink. For more information, see Chapter 9, "Configuring Channels". |
|
Event Bean: a node similar to a standard Spring bean except that it can be managed by the Oracle CEP management framework and can actively use the capabilities of the Oracle CEP server container. For more information, see Chapter 8, "Configuring Custom Adapters, Event Beans, and Spring Beans". |
|
Table: a node that connects a relational database table to the EPN as an event data source. For more information, see Section 10.3, "Configuring an Oracle CQL Processor Table Source". |
|
Processor: a node that executes Oracle CQL or EPL rules on the event data offered to it by one or more channels. For more information, see: |
The user may not reposition the nodes on the EPN Editor. To refresh the layout of the nodes on the EPN Editor, click the Layout EPN button on the EPN Editor toolbar. For more information, see Section 5.4.3, "Laying Out Nodes".
When a child node is nested within a parent node, its icon appears within a box. For more information, see Section 5.2.6, "Nested Stages".
This section describes:
Basic nodes include adapters, beans, caches, channels, event beans, and tables. For information on how to create a processor node, see Section 5.4.1.2, "How to Create a Processor Node".
To create a basic node:
Open the EPN Editor (see Section 5.1, "Opening the EPN Editor").
Right-click on an empty portion of the EPN Editor surface and select New from the context menu as Figure 5-23 shows.
Select the type of node you want to create.
The EPN Editor edits the source file indicated in the EPN Editor filter and the EPN Editor displays the new EPN node. For most nodes, a default ID is chosen and the new node is immediately opened for rename as Figure 5-24 shows.
To rename the node, see Section 5.4.4, "Renaming Nodes".
To reposition the node and update the EPN Editor layout, see Section 5.4.3, "Laying Out Nodes".
Optionally, configure additional node options.
See:
This section describes how to create a processor node using the EPN Editor. For information on creating other node types, see Section 5.4.1.1, "How to Create a Basic Node".
When deploying an Oracle CEP application with a wlevs:processor
node, other nodes in an EPN may reference that processor only if a processor configuration exists for that processor. Processor configurations are defined in Oracle CEP application configuration files. See Section 1.1.5, "Component Configuration Files" for more information about CEP configuration files.
To create a processor node:
Open the EPN Editor (see Section 5.1, "Opening the EPN Editor").
Right-click on an empty portion of the EPN Editor surface and select New from the context menu as Figure 5-25 shows.
Select node type Processor.
The New Processor dialog appears as shown in Figure 5-26.
Configure the New Processor dialog as shown in Table 5-2.
Table 5-2 New Processor Dialog
Attribute | Description |
---|---|
Processor ID |
Specifies the ID of the processor EPN element and the name of the associated processor configuration element |
Create a new file |
Creates the processor configuration in a new file. The new file is created in the application's |
Use an existing configuration file |
Creates the processor configuration in an existing configuration file. The new processor configuration element is appended to the configurations in the selected file. |
Click OK.
The EPN Editor creates the processor configuration in the file you specified in the New Processor dialog, edits the source file indicated in the EPN Editor filter, and displays the new EPN node as Figure 5-27 shows.
To rename the node, see Section 5.4.4, "Renaming Nodes".
To reposition the node and update the EPN Editor layout, see Section 5.4.3, "Laying Out Nodes".
Note: In Oracle CEP, you must use a channel to connect an event source to an Oracle CQL processor and to connect an Oracle CQL processor to an event sink. A channel is optional with other Oracle CEP processor types. |
Optionally, configure additional processor options.
See:
The nodes in the EPN represent the flow of events through an Event Processing Network of an Oracle CEP application. When a node may forward events to another node in the EPN, the EPN Editor allows you to connect that node visually by dragging a line from the source node to the destination node.
This section describes how to connect nodes in the EPN Editor.
To connect nodes:
Open the EPN Editor (see Section 5.1, "Opening the EPN Editor").
Select the source of events and drag to the target of the event flow.
If a connection is allowed, a plug icon is shown at the target end as Figure 5-28 shows.
Figure 5-28 Connecting Nodes: Connection Allowed
If the connection is not allowed, a forbidden icon is shown at the target end as Figure 5-29 shows.
Figure 5-29 Connecting Nodes: Connection Forbidden
Not all nodes may be a target of event flow. For example, connection is forbidden if:
A node does not define a valid identifier.
A node is nested (for more information, see Section 5.2.6, "Nested Stages").
Release the mouse button to complete the connection.
When the connection is made, the EPN Editor updates the EPN assembly file. For example:
When you connect an adapter to a channel or a channel to a processor or event bean, the EPN Editor adds a wlevs:listener
element to the source node with a reference to the target node by ID.
When you connect a table to a processor, the EPN Editor adds a wlevs:table-source
element to the target processor node that references the source table.
For example, suppose you connect the adapter to the channel, and the channel to the processor shown in Figure 5-30.
Figure 5-31 shows the EPN assembly file before connection.
Figure 5-31 EPN Assembly File: Before Connection
Figure 5-32 shows the EPN assembly file after connection.
Figure 5-32 EPN Assembly File: After Connection
Certain EPN Editor actions will use the location of the action as the location of the rendered result. For example, when adding new nodes to an EPN using the EPN editor, a new node will appear at the location of the mouse click that was used to show the EPN Editor context menu. The user may not reposition the nodes on the EPN Editor. To refresh the layout of the nodes on the EPN Editor, click the Layout EPN button on the EPN Editor toolbar as Figure 5-33 shows.
For more information, see Section 5.2.2, "Filtering, Zooming, and Layout".
Most node types support a rename operation that will change all references to the node across both assembly and configuration XML files. You can select Rename from the node's context menu as Figure 5-34 shows.
You may delete most nodes and connections visible on the EPN Editor using the node's context menu. Right-click on the object to show the context menu, then select Delete as Figure 5-35 shows.
When deleting a node, the incoming and outgoing connections are also deleted. For example, Figure 5-36 shows the EPN and Figure 5-38 shows the assembly file before deleting the channel node named stream
.
Figure 5-36 EPN Before Deleting a Channel Node
Figure 5-37 Assembly File Before Deleting a Channel Node
Figure 5-38 shows the EPN and Figure 5-39 shows the assembly file after deleting this channel node.
Figure 5-38 EPN After Deleting a Channel Node
Figure 5-39 Assembly File After Deleting a Channel Node
Note: If abean or other anonymous element is deleted, then the object containing that object is deleted too. For example, given a bean within a wlevs:listener element, then deleting the bean will delete the listener element too. |