Configure the Output as follows: Click OK. Click Save. Click on the CQL Rules tab. Click on the Query radio button. In the Oracle CEP Visualizer, click the ViewStream button in the top pane. Click Initialize Client. Enter stockmoving in the Inititalize cl

3-84 Oracle Complex Event Processing Getting Started Figure 3–72 Output Configuration Dialog

45. Configure the Output as follows:

■ Select Query. ■ Enter MovingAverage as the Query Name. 46. Click Inject Rule. The Inject Rule Confirmation dialog appears as Figure 3–46 shows. Figure 3–73 Inject Rule Confirmation Dialog

47. Click OK.

The Query Wizard adds the rule to the cqlProc processor.

48. Click Save.

49. Click on the CQL Rules tab.

The CQL Rules tab appears as Figure 3–47 shows.

50. Click on the Query radio button.

Confirm that your MovingAverage query is present. Oracle CEP Samples 3-85 Figure 3–74 CQL Rules Tab With View MovingAverage To test the moving average query: 1. To simulate the data feed for the moving average query, open a new command window and set your environment as described in Section 3.5, Setting Your Development Environment. 2. Change to the ORACLE_CEP_HOME\ocep_11.1\utils\load-generator directory, where ORACLE_CEP_HOME refers to the main Oracle CEP installation directory, such as d:\oracle_cep. 3. Run the load generator using the stockData.prop properties file: a. On Windows: prompt runloadgen.cmd stockData.prop b. On UNIX: prompt runloadgen.sh stockData.prop

4. In the Oracle CEP Visualizer, click the ViewStream button in the top pane.

The Stream Visualizer screen appears as Figure 3–27 shows. 3-86 Oracle Complex Event Processing Getting Started Figure 3–75 Stream Visualizer: Showing Moving Average Query Output

5. Click Initialize Client.

6. Enter stockmoving in the Inititalize client field.

7. Click Subscribe.

As the moving average query outputs events, the Oracle CEP updates the Received Messages area showing the events generated.

3.8 Oracle Spatial Example

This example shows how to use Oracle Spatial with Oracle CQL queries to process a stream of Global Positioning System GPS events to track the GPS location of buses and generate alerts when a bus arrives at its pre-determined bus stop positions. Figure 3–76 shows Oracle Spatial example Event Processing Network EPN. The EPN contains the components that make up the application and how they fit together.