Running the CQL Example

Oracle CEP Samples 3-15 Figure 3–2 The CQL Example Event Processing Network The application contains three separate event paths in its EPN: ■ Missing events : this event path consists of an adapter orderCVSAdapter connected to a channel orderChannel. The orderChannel is connected to processor orderProcessor which is connected to channel alertChannel which is connected to adapter alertOutput. This event path is used to detect missing events in a customer order workflow. For more information on how to construct the query that the cqlProc processor executes, see Section 3.7.4.1, Creating the Missing Event Query . ■ Moving average : this event path consists of channel stockChannel connected to processor stockProcessor which is connected to channel movingAvgChannel which is connected to adapter movingOutput. This event path is used to compute a moving average on stock whose volume is greater than 1000. For more information on how to construct the query that the cqlProc processor executes, see Section 3.7.4.2, Creating the Moving Average Query . ■ Cache : this event path consists of adapter adapter connected to channel S1 connected to Oracle CQL processor cacheProcessor connected to channel S2 connected to bean Bean. There is a cache stockCache also connected to the Oracle CQL processor cacheProcessor. There is also a bean Loader. This event path is used to access information from a cache in an Oracle CQL query.

3.7.1 Running the CQL Example

For optimal demonstration purposes, Oracle recommends that you run this example on a powerful computer, such as one with multiple CPUs or a 3 GHz dual-core Intel, with a minimum of 2 GB of RAM. Note: For more information about the various components in the EPN, see the other samples in this book. 3-16 Oracle Complex Event Processing Getting Started The CQL application is pre-deployed to the cql_domain domain. To run the application, you simply start an instance of Oracle CEP server. To run the CQL example: 1. Open a command window and change to the default server directory of the CQL domain directory, located in ORACLE_CEP_HOME\ocep_ 11.1\samples\domains\cql_domain\defaultserver, where ORACLE_ CEP_HOME refers to the main Oracle CEP installation directory, such as d:\oracle_cep. prompt cd d:\oracle_cep\ocep_11.1\samples\domains\cql_domain\defaultserver 2. Set your development environment, as described in Section 3.5, Setting Your Development Environment. 3. Start Oracle CEP by executing the appropriate script with the correct command line arguments: a. On Windows: If you are using the JRockit JDK included in Oracle JRockit Real Time, enable the deterministic garbage collector by passing the -dgc parameter to the command: prompt startwlevs.cmd -dgc If you are not using the JRockit JDK included in Oracle JRockit Real Time: prompt startwlevs.cmd b. On UNIX: If you are using the JRockit JDK included in Oracle JRockit Real Time, enable the deterministic garbage collector by passing the -dgc parameter to the command: prompt startwlevs.sh -dgc If you are not using the JRockit JDK included in Oracle JRockit Real Time: prompt startwlevs.sh The CQL application is now ready to receive data from the data feeds. 4. To simulate the data feed for the missing event query, open a new command window and set your environment as described in Section 3.5, Setting Your Development Environment. 5. 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. 6. Run the load generator using the orderData.prop properties file: a. On Windows: prompt runloadgen.cmd orderData.prop b. On UNIX: prompt runloadgen.sh orderData.prop Oracle CEP Samples 3-17 7. 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. 8. 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. 9. 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 10. To simulate the data feed for the cache query, you only need to run the example. The load data is generated by Adaptor.java and the cache data is generated by Loader.java. You can verify that data is flowing through by turning on statistics in the Oracle CEP Visualizer Query Plan.

3.7.2 Building and Deploying the CQL Example