JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Java CAPS Intelligent Event Processor (IEP) User's Guide     Java CAPS Documentation
search filter icon
search icon

Document Information

Designing Intelligent Event Processor (IEP) Projects

Intelligent Event Processor Overview

Complex Event Processing and Event Stream Processing

Typical IEP Scenarios

IEP Architecture

IEP Design-Time and Runtime Components

Basic Workflow

Creating an Intelligent Event Processing Module Project

To Create an Intelligent Event Processing Module Project

To Add an Event Processor to the Project

Adding and Configuring IEP Operators

To Add IEP Operators to an Event Processor

To Configure IEP Operators in an Event Processor

Disabling the Generation of Bindings and Services

To Disable the Generation of Bindings and Services

Validating Event Processors

To Validate Event Processors

Creating and Deploying the Composite Application Project

To Create a Composite Application Project

To Add the IEP Module Project to the Composite Application Project

To Define the Binding Components and Connections

To Deploy the Composite Application Project

Introduction to IEP Operators

Understanding Schemas

Understanding Streams

Understanding Relations

Supported Data Types

IEP Operator Inputs and Outputs

Aggregator Operators

Relation Aggregator

To Create a Relation Aggregator Operator

Time Based Aggregator

To Create a Time Based Aggregator Operator

Tuple Based Aggregator

To Create a Tuple Based Aggregator Operator

Correlation and Filter Operators

Relation Map

To Create a Relation Map Operator

Stream Projection and Filter

To Create a Stream Projection and Filter Operator

Tuple Serial Correlation

To Create a Tuple Serial Correlation Operator

Input Operators

External Table Polling Stream

To Create an External Table Polling Stream Operator

Replay Stream

To Create a Replay Stream Operator

Stream Input

To Create a Stream Input Operator

Table Input

To Create a Table Input Operator

Output Operators

Batched Stream Output

To Create a Batched Stream Output Operator

Invoke Stream

To Create an Invoke Stream Operator

Relation Output

To Create a Relation Output Operator

Save Stream

To Enable the Save Stream Operator Dynamically at Runtime

To Disable the Save Stream Operator Dynamically at Runtime

Stream Output

To Create a Stream Output Operator

Table Output

To Create a Table Output Operator

Relation Converter Operators

Delete Stream

To Create a Delete Stream Operator

Insert Stream

To Create an Insert Stream Operator

Notification Stream

To Create a Notification Stream Operator

Relation Stream

To Create a Relation Stream Operator

Relation Operators

Distinct

To Create a Distinct Operator

Intersect

To Create an Intersect Operator

Minus

To Create a Minus Operator

Union

To Create a Union Operator

Union All

To Create a Union All Operator

Sequence Operators

Contiguous Order

To Create a Contiguous Order Operator:

Gap Window

To Create a Gap Window Operator:

Stream Converter Operators

Attribute Based Window

To Create an Attribute Based Window Operator

Partitioned Window

To Create a Partitioned Window Operator

Time Based Window

To Create a Time Based Window Operator

Tuple Based Window

To Create a Tuple Based Window Operator

WSDL Documents in IEP Module Projects

Data Types in the WSDL Document

Message Objects in the WSDL Document

Bindings and Services in the WSDL Document

Generating Concrete WSDL Documents

Generating Abstract WSDL Documents

Understanding the IEP Database

Configuring the IEP Database to Use Oracle

To Create the IEP User in the Oracle Database

To Install the Oracle Database Driver in the Application Server

To Create the Non-XA Connection Pool

To Create the Non-XA JDBC Resource

To Create the XA Connection Pool

To Create the XA JDBC Resource

To Enable Automatic Recovery of XA Transactions

To Configure the IEP Service Engine to Use the JDBC Resources

To Restart the IEP Service Engine and Create the Database Tables

Configuring the IEP Database to Use MySQL

To Create the IEP User in the MySQL Database

To Install the MySQL Database Driver in the Application Server

To Create the Non-XA Connection Pool

To Create the Non-XA JDBC Resource

To Create the XA Connection Pool

To Create the XA JDBC Resource

To Enable Automatic Recovery of XA Transactions

To Configure the IEP Service Engine to Use the JDBC Resources

To Restart the IEP Service Engine and Create the Database Tables

IEP Service Engine-Specific Database Tables

EMS_PLAN Table

EMS_OUTPUT Table

EMS_ENGINE Table

EMS_TOKEN Table

Event Process-Specific Database Tables

EMS_PROCESSING_STATE_N Tables

EMS_TABLE_USAGE_N Tables

Operator-Specific Database Tables

Configuring Message Reliability in an IEP Module Project

To Disable Message Reliability for Outbound Messages

Index

Understanding the IEP Database

IEP uses a set of database tables to maintain information about the IEP Service Engine and deployed event processes. You can connect to the database through NetBeans, and then view the tables and their content through NetBeans windows. To view the IEP database tables, click the Services window of the NetBeans IDE. Expand the Databases node, the connection node, and the Tables node.

image:Figure shows the IEP database tables in the Services window.

To view the contents of an IEP database table, right-click the table node and choose View Data. The SQL Editor appears and displays the appropriate SQL SELECT statement, which is performed on the table. The results of the query appear near the bottom of the SQL Editor.

The following image shows the contents of the EMS_PLAN table.

image:Screen capture of the contents of the EMS_PLAN table.

For information about supported database platforms and versions for the IEP database, see Java CAPS 6.3 Components and Supported External Systems in Planning for Oracle Java CAPS 6.3 Installation .

Configuring the IEP Database to Use Oracle

By default, the IEP database is configured to use Java DB. Java DB is the supported distribution of the open source Apache Derby database. After installation, you can configure the IEP database to use Oracle instead.

The first task is to create an IEP user in the Oracle database. You can run a provided SQL script that creates the IEP user and grants the appropriate privileges. The default version of the script contains the following SQL statements:

CREATE TABLESPACE "IEPSEDB_DB"
 DATAFILE
  'IEPSEDB_DB1.dat' SIZE 2000M,
  'IEPSEDB_DB2.dat' SIZE 2000M;

CREATE USER IEPSEDB IDENTIFIED BY IEPSEDB
DEFAULT TABLESPACE IEPSEDB_DB
QUOTA UNLIMITED ON IEPSEDB_DB
TEMPORARY TABLESPACE temp
QUOTA 0M ON system;

GRANT CONNECT TO IEPSEDB;
GRANT RESOURCE TO IEPSEDB;
GRANT CREATE VIEW TO IEPSEDB;

grant select on sys.dba_pending_transactions to IEPSEDB;
grant select on sys.pending_trans$ to IEPSEDB;
grant select on sys.dba_2pc_pending to IEPSEDB;
grant execute on sys.dbms_system to IEPSEDB;
grant select on SYS.dba_2pc_neighbors to IEPSEDB;
grant force any transaction to IEPSEDB;

You need to create two sets of connection pools and JDBC resources. A connection pool is a group of reusable connections for a particular database. The server maintains a pool of available connections to increase performance. A JDBC resource provides applications with a means of connecting to a database. Additional configuration of the service engine is also required.

To configure the IEP Service Engine to use Oracle, perform the following steps:

To Create the IEP User in the Oracle Database

  1. In a web browser, enter the following URL: http://wiki.open-esb.java.net/Wiki.jsp?page=HowToRunIEPOnOracle.
  2. Download the create_iepse_user.sql script.
  3. Open the create_iepse_user.sql script and review the instructions.
  4. The names of the tablespace, data files, user, and password include the string IEPSEDB. If you want to change this string to a different string, then replace all occurrences of IEPSEDB with the new string.
  5. Connect to the Oracle database as a user with the SYSDBA privilege.
  6. Run the create_iepse_user.sql script against the database.

To Install the Oracle Database Driver in the Application Server

  1. Go to the computer where the application server is installed.
  2. Copy and paste the Oracle database driver (for example, ojdbc14.jar) to the glassfish-home/lib directory.
  3. Restart the application server.

To Create the Non-XA Connection Pool

  1. Log in to the GlassFish Admin Console.
  2. In the left navigation panel, expand Resources and JDBC, and then select Connection Pools.
  3. Click New.

    The New JDBC Connection Pool page appears.

  4. Do the following:
    1. In the Name field, specify a name for the non-XA connection pool (for example, iepseOraclePoolNonXA).
    2. In the Resource Type field, select javax.sql.DataSource.
    3. In the Database Vendor field, select Oracle.
    4. Click Next.
  5. Scroll down to the Additional Properties table, and then do the following:
    1. In the User row, enter the user name of the IEP user (for example, IEPSEDB).
    2. In the Password row, enter the password of the IEP user (for example, IEPSEDB).
    3. In the URL row, enter the string for connecting to the database (for example, jdbc:oracle:thin:@myserver:1521:orcl).
  6. Click Finish.

    The connection pool is created.

  7. Click the connection pool that you just created.

    The Edit Connection Pool page appears.

  8. Click Ping.

    The Admin Console attempts to connect to the database. If the connection does not succeed, check to see whether the database is running and verify the database connectivity properties, such as the URL string.

To Create the Non-XA JDBC Resource

  1. In the left navigation panel of the Admin Console, expand Resources and JDBC, and then select JDBC Resources.
  2. Click New.

    The New JDBC Resource page appears.

  3. In the JNDI Name field, specify a unique name for the non-XA JDBC resource. By convention, the name begins with the jdbc/ string. For example:

    jdbc/iepseOracleNonXA

    You will use the JNDI name in a later procedure.

  4. In the Pool Name field, select the non-XA connection pool that you created in the previous procedure.
  5. Click OK.

    The JDBC resource is created.

To Create the XA Connection Pool

  1. In the left navigation panel of the Admin Console, expand Resources and JDBC, and then select Connection Pools.
  2. Click New.

    The New JDBC Connection Pool page appears.

  3. For step 1 of the connection pool, do the following:
    1. In the Name field, specify a name for the XA connection pool (for example, iepseOraclePoolXA).
    2. In the Resource Type field, select javax.sql.XADataSource.
    3. In the Database Vendor field, select Oracle.
    4. Click Next.
  4. For step 2 of the connection pool, do the following:
    1. Scroll down to the Connection Validation section.
    2. Select the Enabled check box that appears to the right of the Allow Non Component Callers label.
    3. Scroll down to the Additional Properties table.
    4. In the User row, enter the user name of the IEP user (for example, IEPSEDB).
    5. In the Password row, enter the password of the IEP user (for example, IEPSEDB).
    6. In the URL row, enter the string for connecting to the database (for example, jdbc:oracle:thin:@myserver:1521:orcl).
  5. Click Finish.

    The connection pool is created.

  6. Click the connection pool that you just created.

    The Edit Connection Pool page appears.

  7. Click Ping.

    The Admin Console attempts to connect to the database. If the connection does not succeed, check to see whether the database is running, and verify the connectivity parameters, such as the URL string.

To Create the XA JDBC Resource

  1. In the left navigation panel of the Admin Console, expand Resources and JDBC, and then select JDBC Resources.
  2. Click New.

    The New JDBC Resource page appears.

  3. In the JNDI Name field, specify a unique name for the XA JDBC resource. By convention, the name begins with the jdbc/ string. For example:

    jdbc/iepseOracleXA

    You use the JNDI name in a later procedure.

  4. In the Pool Name drop-down menu, select the XA connection pool that you created.
  5. Click OK.

    The JDBC resource is created.

To Enable Automatic Recovery of XA Transactions

  1. In the left navigation panel of the Admin Console, expand Configuration and then select Transaction Service.
  2. Select the Enabled check box that appears to the right of the On Restart label.
  3. Click Save.

To Configure the IEP Service Engine to Use the JDBC Resources

  1. Log in to the NetBeans IDE.
  2. In the Services window, expand Servers > GlassFish V2 > JBI > Service Engines.
  3. If the IEP Service Engine is not started, right-click sun-iep-engine and select Start.
  4. Right-click sun-iep-engine and select Properties.

    The Properties dialog box appears.

  5. In the Non XA Data Source Name property, enter the non-XA JDBC resource that you created (for example, jdbc/iepseOracleNonXA).
  6. In the XA Data Source Name property, enter the XA JDBC resource that you created (for example, jdbc/iepseOracleXA).
  7. In the Database Schema Name property, enter the user name of the IEP user (for example, IEPSEDB).

    In an Oracle database, the database schema name is identical to the user name.

  8. Click OK.

To Restart the IEP Service Engine and Create the Database Tables

When you restart the IEP Service Engine, the database tables are automatically created in the database you specified through the connection pools and runtime properties.

  1. If any Composite Application projects that contain event processes are currently deployed, undeploy the projects.
  2. In the Services window, expand Servers > GlassFish V2 > JBI > Service Engines.
  3. Right-click sun-iep-engine and select Stop.
  4. Right-click sun-iep-engine and select Start.
  5. If you undeployed any Composite Application projects, you can now redeploy the projects.

Configuring the IEP Database to Use MySQL

By default, the IEP database is configured to use Java DB. Java DB is the supported distribution of the open source Apache Derby database. After installation, you can configure the IEP database to use MySQL instead.

The first task is to create an IEP user in the MySQL database and install the MySQL driver. You also need to create two sets of connection pools and JDBC resources. A connection pool is a group of reusable connections for a particular database. The server maintains a pool of available connections to increase performance. A JDBC resource provides applications with a means of connecting to a database. Additional configuration of the service engine is also required.

To configure the IEP Service Engine to use MySQL, perform the following steps:

To Create the IEP User in the MySQL Database

  1. Connect to the MySQL database as a user as root.
  2. Run the following statements against the database:
    create user username@hostname identified by 'password';
    create database database-name;
    grant all on database-name.* to username@hostname;

    Note - In the default Java DB database, the database schema name, username, and password are all IEPSEDB. You do not need to use these values.


To Install the MySQL Database Driver in the Application Server

  1. Go to the computer where the application server is installed.
  2. Copy and paste the MySQL database driver (mysql-connector-java-5.1.6-bin.jar) to the glassfish-home/lib directory.
  3. Restart the application server.

To Create the Non-XA Connection Pool

  1. Log in to the GlassFish Admin Console.
  2. In the left navigation panel, expand Resources and JDBC, and then select Connection Pools.
  3. Click New.

    The New JDBC Connection Pool page appears.

  4. Do the following:
    1. In the Name field, specify a name for the non-XA connection pool (for example, iepseMySqlPoolNonXA).
    2. In the Resource Type field, select javax.sql.DataSource or javax.sql.ConnectionPoolDataSource.
    3. In the Database Vendor field, select MySQL.
    4. Click Next.
  5. Scroll down to the Additional Properties table, and enter the following values:
    • port – The port number for the database. By default, MySQL uses 3306.

    • databaseName – The name of the database schema.

    • serverName – The name of the server on which the database is located.

    • user – The login ID of the IEP user (for example, IEPSEDB).

    • password – The password of the IEP user (for example, IEPSEDB).

    • url – The string for connecting to the database (for example, jdbc:mysql://myserver:3306/IEPSEDB).

  6. Click Finish.

    The connection pool is created.

  7. Click the connection pool that you just created.

    The Edit Connection Pool page appears.

  8. Click Ping.

    The Admin Console attempts to connect to the database. If the connection does not succeed, check to see whether the database is running and verify the database connectivity properties, such as the URL string.

To Create the Non-XA JDBC Resource

  1. In the left navigation panel of the Admin Console, expand Resources and JDBC, and then select JDBC Resources.
  2. Click New.

    The New JDBC Resource page appears.

  3. In the JNDI Name field, specify a unique name for the non-XA JDBC resource. By convention, the name begins with the jdbc/ string. For example:

    jdbc/iepseMySqlNonXA

    You will use the JNDI name in a later procedure.

  4. In the Pool Name field, select the non-XA connection pool that you created in the previous procedure.
  5. Click OK.

    The JDBC resource is created.

To Create the XA Connection Pool

  1. In the left navigation panel of the Admin Console, expand Resources and JDBC, and then select Connection Pools.
  2. Click New.

    The New JDBC Connection Pool page appears.

  3. Do the following:
    1. In the Name field, specify a name for the XA connection pool (for example, iepseMuyMySqlPoolXA).
    2. In the Resource Type field, select javax.sql.XADataSource.
    3. In the Database Vendor field, select MySQL.
    4. Click Next.
  4. Scroll down to the Connection Validation section, and select the Enabled check box that appears to the right of the Allow Non Component Callers label.
  5. Scroll down to the Additional Properties table, and enter the following values:
    • port – The port number for the database. By default, MySQL uses 3306.

    • databaseName – The name of the database schema.

    • serverName – The name of the server on which the database is located.

    • user – The login ID of the IEP user (for example, IEPSEDB).

    • password – The password of the IEP user (for example, IEPSEDB).

    • url – The string for connecting to the database (for example, jdbc:mysql://myserver:3306/IEPSEDB).

  6. Click Finish.

    The connection pool is created.

  7. Click the connection pool that you just created.

    The Edit Connection Pool page appears.

  8. Click Ping.

    The Admin Console attempts to connect to the database. If the connection does not succeed, check to see whether the database is running, and verify the connectivity parameters, such as the URL string.

To Create the XA JDBC Resource

  1. In the left navigation panel of the Admin Console, expand Resources and JDBC, and then select JDBC Resources.
  2. Click New.

    The New JDBC Resource page appears.

  3. In the JNDI Name field, specify a unique name for the XA JDBC resource. By convention, the name begins with the jdbc/ string. For example:

    jdbc/iepseMySqlXA

    You use the JNDI name in a later procedure.

  4. In the Pool Name drop-down menu, select the XA connection pool that you created.
  5. Click OK.

    The JDBC resource is created.

To Enable Automatic Recovery of XA Transactions

  1. In the left navigation panel of the Admin Console, expand Configuration and then select Transaction Service.
  2. Select the Enabled check box that appears to the right of the On Restart label.
  3. Click Save.

To Configure the IEP Service Engine to Use the JDBC Resources

  1. Log in to the NetBeans IDE.
  2. In the Services window, expand Servers > GlassFish V2 > JBI > Service Engines.
  3. If the IEP Service Engine is not started, right-click sun-iep-engine and select Start.
  4. Right-click sun-iep-engine and select Properties.

    The Properties dialog box appears.

  5. In the Non XA Data Source Name property, enter the non-XA JDBC resource that you created (for example, jdbc/iepseMySqlNonXA).
  6. In the XA Data Source Name property, enter the XA JDBC resource that you created (for example, jdbc/iepseMySQLXA).
  7. In the Database Schema Name property, enter the name of the MySQL schema for the IEP database.
  8. Click OK.

To Restart the IEP Service Engine and Create the Database Tables

When you restart the IEP Service Engine, the database tables are automatically created in the database you specified through the connection pools and runtime properties.

  1. If any Composite Application projects that contain event processes are currently deployed, undeploy the projects.
  2. In the Services window, expand Servers > GlassFish V2 > JBI > Service Engines.
  3. Right-click sun-iep-engine and select Stop.
  4. Right-click sun-iep-engine and select Start.
  5. If you undeployed any Composite Application projects, you can now redeploy the projects.

IEP Service Engine-Specific Database Tables

When you start the IEP Service Engine for the first time, the following tables are created in the IEP database. These tables apply to the IEP Service Engine as a whole.


Caution

Caution - Do not delete or alter these tables.


EMS_PLAN Table

The EMS_PLAN table maintains information about the event processes that are deployed to the IEP Service Engine. The EMS_PLAN table contains the following columns:

EMS_OUTPUT Table

The EMS_OUTPUT table maintains information for event processes that have a Table Output operator. The EMS_OUTPUT table contains the following columns:

EMS_ENGINE Table

The EMS_ENGINE table is used when you are running IEP in cluster mode. The EMS_ENGINE table contains the following columns:

EMS_TOKEN Table

The EMS_TOKEN table is used when you are running IEP in cluster mode. The EMS_TOKEN table contains the following columns:

Event Process-Specific Database Tables

When you deploy an event process, the following tables are created in the IEP database. If you undeploy the event process, then the tables are deleted.


Caution

Caution - Do not delete or alter these tables.


EMS_PROCESSING_STATE_N Tables

The EMS_PROCESSING_STATE_N tables are used by the IEP Service Engine to maintain execution state for an event process. The EMS_PROCESSING_STATE_N tables contain the following columns:

EMS_TABLE_USAGE_N Tables

The EMS_TABLE_USAGE_N tables are used in garbage collection. The EMS_TABLE_USAGE_N tables contain the following columns:

Operator-Specific Database Tables

In the IEP Service Engine, one or more tables are created per operator. These tables are specific to operator behavior and functionality.


Caution

Caution - Do not delete or alter these tables.


The following table names illustrate how the names are formatted.

The first character of the table name is always Q.

The character after the first underscore is the ID of the event processor in the EMS_PLAN table.

The characters after the second underscore are the ID of the operator. You can view the operator ID in the IEP design view by selecting the operator and displaying the Properties window.

image:Screen capture of a selected operator and the Properties window.

The operator ID is automatically generated. You cannot change the ID.