3 Oracle CEP IDE for Eclipse Projects

An Oracle CEP project is an Eclipse project that brings together all Oracle CEP artifacts.

This chapter describes:

3.1 Oracle CEP Project Overview

An Oracle CEP application includes the following artifacts:

  • Java source files

  • XML configuration files

  • OSGi bundle Manifest file

Figure 3-1 shows the Explorer after creating a project.

Figure 3-1 Oracle CEP Project Structure

Description of Figure 3-1 follows
Description of "Figure 3-1 Oracle CEP Project Structure"

Table 3-1 summarizes the important files in an Oracle CEP project including their use and location.

Table 3-1 Oracle CEP Project Artifacts

File Type Location Description

Java source files

Any Java source folder.

Default: src.

Events, adapters, and listeners are implemented in an Oracle CEP application with Java files. All Java files must be in a source folder in order to be compiled.

For more information, see Chapter 1, "Overview of Creating Oracle CEP Applications".

EPN assembly file

META-INF/spring

These are the main files used to wire-up an EPN and to define event types. This is a Spring context file, and is where adapters, channels, processors, and listeners are connected.

For more information, see Chapter 1, "EPN Assembly File".

Processor configuration file

META-INF/wlevs

The processor configuration file is where the Complex Event Processor (CEP) is defined. In this file you'll find processor rules (defined in the Continuous Query Language - CQL or the Event Processing Language--EPL) and other component configuration settings.

For more information, see:

MANIFEST.MF file

META-INF

The manifest file contains metadata about your application including its name, version, and dependencies, among others.

For more information, see Chapter 20, "Assembling and Deploying Oracle CEP Applications".


3.2 Creating Oracle CEP Projects

Development of an Oracle CEP application begins by creating a project to hold all source code and related files.

Projects correspond 1-to-1 with Oracle CEP applications and are the unit of work that is associated with and deployed to a server instance. In concrete terms, the output of a built project is a single OSGi bundle (JAR) containing the Oracle CEP application.

3.2.1 How to Create an Oracle CEP Project

By default new projects are set to use Java 6.0. This section describes how to create an Oracle CEP project using Java 6. For information on configuring an Oracle CEP project to use Java 6, see Section 2.4, "Configuring Eclipse".

To create an Oracle CEP project:

  1. Open the EPN Editor (see Section 5.1, "Opening the EPN Editor")

  2. Select File > New Project.

    The New Project - Select a Wizard dialog appears as shown in Figure 3-2.

    Figure 3-2 New Project - Select a Wizard Dialog

    Description of Figure 3-2 follows
    Description of "Figure 3-2 New Project - Select a Wizard Dialog"

  3. Expand Oracle CEP and select Oracle CEP Application Project.

  4. Click Next.

    The New Oracle CEP Application Project wizard appears as shown in Figure 3-3.

    Figure 3-3 New Oracle CEP Application Project Wizard: Create an Oracle CEP Application

    Description of Figure 3-3 follows
    Description of "Figure 3-3 New Oracle CEP Application Project Wizard: Create an Oracle CEP Application"

  5. Configure the Create an Oracle CEP Application dialog as shown in Table 3-2.

    Table 3-2 Create an Oracle CEP Application Dialog

    Attribute Description

    Project name

    The name of your Oracle CEP project. This name will be used as the default name of your application when it is deployed to the Oracle CEP server.

    Location

    The directory in which your project is stored.

    By default your project is located inside the Eclipse workspace directory.

    To keep your workspace and source code control directories separate, uncheck Use default location and click Browse to place the project in a directory outside of your workspace.

    Target Runtime

    The Oracle CEP server you will deploy your project to.


  6. Click Next.

    The Oracle CEP Application Content dialog appears as shown in Figure 3-4.

    Figure 3-4 New Oracle CEP Application Project Wizard: Oracle CEP Application Content

    Description of Figure 3-4 follows
    Description of "Figure 3-4 New Oracle CEP Application Project Wizard: Oracle CEP Application Content"

  7. Optionally, configure the Oracle CEP Application Content dialog as shown in Table 3-3.

    Table 3-3 Oracle CEP Application Content Dialog

    Attribute Description

    Bundle ID

    The unique ID that distinguishes this application's OSGi bundle from those deployed to the target runtime.

    Bundle Version

    The version of this instance of this OSGi bundle.

    Bundle Name

    The name of this application's OSGi bundle.

    Bundle Provider

    The name of the provider for this application's OSGi bundle (optional).


  8. Click Next.

    The Template dialog appears as shown in Figure 3-5.

    Figure 3-5 New Oracle CEP Application Project Wizard: Template Dialog

    Description of Figure 3-5 follows
    Description of "Figure 3-5 New Oracle CEP Application Project Wizard: Template Dialog"

  9. Optionally, select an Oracle CEP application template to pre-populate your project with the content that the template specifies.

  10. Click Finish.

    The Oracle CEP IDE for Eclipse creates the Oracle CEP project.

  11. Optionally, create additional EPN assembly files and component configuration files.

    By default, Oracle CEP IDE for Eclipse creates one EPN assembly file and one component configuration file for your project. Optionally, you may choose to define and configure Oracle CEP objects in multiple EPN assembly and component configuration files to improve management, concurrent development, and re-use.

    For more information, see:

3.3 Creating EPN Assembly Files

You use the Event Processing Network (EPN) assembly file to declare the components that make up your Oracle CEP application and how they are connected to each other. You also use the file to register event types of your application, as well as the Java classes that implement the adapter and POJO components of your application.

For an example of an EPN assembly file, see the "Foreign Exchange (FX) Example" in the Oracle CEP Getting Started. For additional information about Spring and OSGi, see Appendix A, "Additional Information about Spring and OSGi."

3.3.1 How to Create a New EPN Assembly File Using Oracle CEP IDE for Eclipse

The most efficient and least error-prone way to create and edit the EPN file is using the New File Wizard in the Oracle CEP IDE for Eclipse.

For more information, see:

To create a new EPN assembly file using Oracle CEP IDE for Eclipse:

  1. Create an Oracle CEP project.

    See Section 3.2, "Creating Oracle CEP Projects".

    By default, Oracle CEP IDE for Eclipse creates one EPN assembly file for your project. Optionally, you may choose to define Oracle CEP objects in multiple EPN assembly files to improve management, concurrent development, and re-use.

  2. To optionally create additional EPN assembly files:

    1. Select File > New > Other.

      The New dialog appears as Figure 3-6 shows.

    2. Expand Oracle CEP and select Oracle CEP Assembly File.

    3. Click Next.

      The New CEP Assembly File dialog appears as Figure 3-7 shows.

      Figure 3-7 New CEP Assembly File Dialog

      Description of Figure 3-7 follows
      Description of "Figure 3-7 New CEP Assembly File Dialog"

    4. Configure the New CEP Assembly File dialog as shown in Table 3-4.

      Table 3-4 New CEP Assembly File Dialog

      Attribute Description

      Enter or select the parent folder

      Enter the fully qualified path to the folder in which Oracle CEP IDE for Eclipse will create the EPN assembly file or use the file system navigation controls to select the folder.

      File name

      Enter the name of the new EPN assembly file.


    5. Click Finish.

  3. Open the EPN editor.

    See Section 5.1, "Opening the EPN Editor".

  4. If you created multiple EPN assembly files, you can select the EPN assembly file you want to work on using the EPN Editor Filter pull-down menu.

    This lets you focus on just the subset of the EPN that the selected EPN assembly file represents.

    To see the union of all components in all EPN assembly files, select Full EPN from the EPN Editor Filter pull-down menu.

    For more information, see Section 5.2.2, "Filtering".

  5. Create and connect nodes on the EPN.

    See Section 5.4, "Using the EPN Editor".

3.4 Creating Component Configuration Files

You use a component configuration file to configure the components that make up your Oracle CEP application.

For an example of a component configuration file, see the "Foreign Exchange (FX) Example" in the Oracle CEP Getting Started.

3.4.1 How to Create a New Component Configuration File Using Oracle CEP IDE for Eclipse

The most efficient and least error-prone way to create and edit a component configuration file is using the New File Wizard in the Oracle CEP IDE for Eclipse.

For more information, see:

To create a new component configuration file using Oracle CEP IDE for Eclipse:

  1. Create an Oracle CEP project.

    See Section 3.2, "Creating Oracle CEP Projects".

    By default, Oracle CEP IDE for Eclipse creates one component configuration file for your project. Optionally, you may choose to configure Oracle CEP objects in multiple component configuration files to improve management, concurrent development, and re-use.

  2. To optionally create component configuration files:

    • Select File > New > Other.

      The New dialog appears as Figure 3-8 shows.

    • Expand Oracle CEP and select Oracle CEP Application Configuration File.

    • Click Next.

      The New CEP Application Configuration File dialog appears as Figure 3-9 shows.

      Figure 3-9 New CEP Application Configuration File Dialog

      Description of Figure 3-9 follows
      Description of "Figure 3-9 New CEP Application Configuration File Dialog"

    • Configure the New CEP Assembly File dialog as shown in Table 3-4.

      Table 3-5 New CEP Configuration File Dialog

      Attribute Description

      Enter or select the parent folder

      Enter the fully qualified path to the folder in which Oracle CEP IDE for Eclipse will create the component configuration file or use the file system navigation controls to select the folder.

      File name

      Enter the name of the new component configuration file.


    • Click Finish.

  3. Open the EPN editor.

    See Section 5.1, "Opening the EPN Editor".

  4. Create and connect nodes on the EPN.

    See Section 5.4, "Using the EPN Editor".

3.5 Exporting Oracle CEP Projects

Exporting an Oracle CEP project builds the project into an OSGi bundle that can be deployed to a production Oracle CEP server.

3.5.1 How to Export an Oracle CEP Project

This section describes how to export an Oracle CEP project into an OSGi bundle.

To export an Oracle CEP project:

  1. Start the Oracle CEP IDE for Eclipse and open your Oracle CEP project.

  2. The Oracle CEP IDE for Eclipse compiles and adds Java resources to the exported JAR automatically. If your project contains other resources (such as a manifest file or images), configure your project to export them:

    1. Locate the build.properties file in the Project Explorer and double-click this file to edit it.

      The build.properties file opens as shown in Figure 3-10.

      Figure 3-10 Oracle CEP Project build.properties File

      Description of Figure 3-10 follows
      Description of "Figure 3-10 Oracle CEP Project build.properties File"

    2. In the Binary Build area, check the resources you want exported with your application.

  3. Select File > Export.

    The Export dialog appears as shown in Figure 3-11.

    Figure 3-11 Export Dialog

    Description of Figure 3-11 follows
    Description of "Figure 3-11 Export Dialog"

  4. Expand the Oracle CEP option and select Oracle CEP Applications.

  5. Click Next.

    The Oracle CEP Applications Export: Select Project dialog appears as shown in Figure 3-12.

    Figure 3-12 Oracle CEP Applications Export: Select Project Dialog

    Description of Figure 3-12 follows
    Description of "Figure 3-12 Oracle CEP Applications Export: Select Project Dialog"

  6. Configure the Oracle CEP Applications Export: Select Project dialog as shown in Table 3-6.

    Table 3-6 Oracle CEP Application Content Dialog

    Attribute Description

    Available Projects

    The list of Oracle CEP projects available for export.

    Check the project or projects you want to export.

    Each project will be exported to a JAR file with the name given in the Output File column. The name of the bundle that will be exported conforms to the OSGi bundle naming conventions, using the bundle ID and the bundle version in the JAR name.

    Directory

    The directory in which Oracle CEP project JAR files are exported.

    Click Browse to choose this directory.

    Overwrite existing files without warning

    Check this option to overwrite existing JAR files with the same name in the selected directory.


  7. Click Finish.

    Your project, its Java resources, and any binary resources you selected are exported to the project JAR file.

  8. Deploy the JAR file to your Oracle CEP server.

    1. If your JAR is an application, see Section 4.3.6, "How to Deploy an Application to an Oracle CEP Server".

    2. If your JAR is an application library, see Section 20.1.3, "Application Libraries"

  9. Deploy other dependent resources, if any, to your Oracle CEP server.

    For example:

    • Other OSGi bundles your application depends on.

      Deploy these bundles on the Oracle CEP server using the Oracle CEP Visualizer or command line deployment tools.

    • Any entries in config.xml for datasources that are referenced from within the application.

      Add these entries to the target server's config.xml file.

3.6 Upgrading Projects

When upgrading Oracle CEP from one version to another, it may be necessary to make changes to your existing Oracle CEP projects.

This section describes:

For more information, see:

3.6.1 How to Upgrade Projects from Oracle CEP 2.1 to 10.3

While project structure has stayed the same since 2.1, the data stored in Oracle CEP Projects has changed significantly. It is therefore necessary to take steps to upgrade 2.1 projects manually before continuing their development in 10.3.

The following outlines the steps necessary to upgrade 2.1 projects to 10.3

To upgrade projects from Oracle CEP 2.1 to 10.3:

  1. Open your Oracle CEP 2.1 project in Oracle CEP IDE for Eclipse.

  2. Select File > Switch Workspace > Other.

    The Workspace Launcher dialog appears as shown in Figure 3-13.

    Figure 3-13 Workspace Launcher Dialog

    Description of Figure 3-13 follows
    Description of "Figure 3-13 Workspace Launcher Dialog"

    Note:

    Do not choose to copy settings from the current workspace.
  3. Click Browse and select a new workspace directory.

    Eclipse exits and restarts using the new workspace.

  4. Select File > Import.

    The Import Dialog appears as shown in Figure 3-14.

    Figure 3-14 Import Dialog

    Description of Figure 3-14 follows
    Description of "Figure 3-14 Import Dialog"

  5. Expand the General option and select Existing Projects into Workspace.

  6. Click Next.

    The Import Projects dialog appears as shown in Figure 3-15.

    Figure 3-15 Import Projects Dialog

    Description of Figure 3-15 follows
    Description of "Figure 3-15 Import Projects Dialog"

  7. Use the Import Projects dialog to import your 2.1 projects into the new workspace. Optionally, choose to copy the project files into your new workspace.

  8. For each project, change the project facet version as follows:

    1. Right-click your project and select Properties.

      The Project Properties dialog appears as shown in Figure 3-16.

      Figure 3-16 Project Properties Dialog: Project Facets

      Surrounding text describes Figure 3-16 .
    2. Select the Project Facets option.

      The Project Facet properties are displayed as Figure 3-16 shows.

    3. Click Modify Project.

      The Modify Faceted Project dialog appears shown in Figure 3-17.

      Figure 3-17 Modify Faceted Project

      Surrounding text describes Figure 3-17 .
    4. For the Oracle CEP facet, select 10.3 from the Version pull-down menu.

    5. Click Finish.

    6. Click OK.

    7. Repeat for the next project.

  9. Create a new Oracle CEP server runtime:

    1. Select Window > Preferences.

      The Preferences dialog appears as shown in Figure 3-18.

      Figure 3-18 Preferences Dialog

      Description of Figure 3-18 follows
      Description of "Figure 3-18 Preferences Dialog"

    2. Expand the Server option and select Installed Runtimes.

    3. Add a new 10.3 Oracle CEP server runtime as Section 4.2.3, "How to Create an Oracle CEP Server Runtime" describes.

    4. Click OK.

  10. For each project, specify the new 10.3 Oracle CEP server runtime you created:

    1. Right-click your project and select Properties.

      The Project Properties dialog appears as shown in Figure 3-19.

      Figure 3-19 Project Properties Dialog: Targeted Runtimes

      Surrounding text describes Figure 3-19 .
    2. Select the Targeted Runtimes option.

      The Targeted Runtimes properties are displayed as Figure 3-19 shows.

    3. Check the new Oracle CEP 10.3 targeted runtime you created.

    4. Click OK.

    5. Repeat for the next project.

  11. For each project update the project builders:

    1. Right-click the project and select Open EPN Editor.

    2. If the EPN diagram opens without error, proceed to step 12.

    3. If the EPN diagram opens with the error shown in Figure 3-20, click the Configure Builder button.

      Figure 3-20 Builder Error

      Description of Figure 3-20 follows
      Description of "Figure 3-20 Builder Error"

      The EPN diagram is displayed.

    4. Repeat for the next project.

  12. Validate build inclusions:

    If your application bundle is using bundle localization and has substitution variables in its MANIFEST.MF file such as:

    Bundle-Name: %project.name
    

    Then your project root directory's build.properties file element bin.include must contain a reference to your bundle.properties file such as:

    bin.includes = META-INF/,\
                   bundle.properties,\
                   .
    
  13. Perform source changes, if necessary.

    For more information, see:

    After performing these steps, you should do a clean build of your project.

3.6.2 How to Upgrade Projects from Oracle CEP 10.3 to 11g Release 1 (11.1.1)

While project structure has stayed the same since 10.3, the data stored in Oracle CEP Projects has changed significantly. It is therefore necessary to take steps to upgrade 10.3 projects manually before continuing their development in 11g Release 1 (11.1.1).

The following outlines the steps necessary to upgrade 10.3 projects to 11g Release 1 (11.1.1)

To upgrade projects from Oracle CEP 10.3 to 11g Release 1 (11.1.1)

  1. Open your Oracle CEP 10.3 project in Oracle CEP IDE for Eclipse.

  2. Select File > Switch Workspace > Other.

    The Workspace Launcher dialog appears as shown in Figure 3-21.

    Figure 3-21 Workspace Launcher Dialog

    Description of Figure 3-21 follows
    Description of "Figure 3-21 Workspace Launcher Dialog"

  3. Click Browse and select a new workspace directory.

    Note:

    Do not choose to copy settings from the current workspace.

    Eclipse exits and restarts using the new workspace.

  4. Select File > Import.

    The Import Dialog appears as shown in Figure 3-14.

    Figure 3-22 Import Dialog

    Description of Figure 3-22 follows
    Description of "Figure 3-22 Import Dialog"

  5. Expand the General option and select Existing Projects into Workspace.

  6. Click Next.

    The Import Projects dialog appears as shown in Figure 3-15.

    Figure 3-23 Import Projects Dialog

    Description of Figure 3-23 follows
    Description of "Figure 3-23 Import Projects Dialog"

  7. Use the Import Projects dialog to import your 10.3 projects into the new workspace. Optionally, choose to copy the project files into your new workspace.

  8. For each project, change the project facet version as follows:

    1. Right-click your project and select Properties.

      The Project Properties dialog appears as shown in Figure 3-16.

      Figure 3-24 Project Properties Dialog: Project Facets

      Surrounding text describes Figure 3-24 .
    2. Select the Project Facets option.

      The Project Facet properties are displayed as Figure 3-16 shows.

    3. Click Modify Project.

      The Modify Faceted Project dialog appears shown in Figure 3-17.

      Figure 3-25 Modify Faceted Project

      Description of Figure 3-25 follows
      Description of "Figure 3-25 Modify Faceted Project"

    4. For the Java facet, select 6.0 from the Version pull-down menu.

    5. For the Oracle CEP facet, select 11.1 from the Version pull-down menu.

    6. Click Finish.

    7. Click OK.

    8. Repeat for the next project.

  9. Create a new Oracle CEP server runtime:

    1. Select Window > Preferences.

      The Preferences dialog appears as shown in Figure 3-18.

      Figure 3-26 Preferences Dialog

      Description of Figure 3-26 follows
      Description of "Figure 3-26 Preferences Dialog"

    2. Expand the Server option and select Installed Runtimes.

    3. Add a new 11.0 Oracle CEP server runtime as Section 4.2.3, "How to Create an Oracle CEP Server Runtime" describes.

    4. Click OK.

  10. For each project, specify the new 11.0 Oracle CEP server runtime you created:

    1. Right-click your project and select Properties.

      The Project Properties dialog appears as shown in Figure 3-19.

      Figure 3-27 Project Properties Dialog: Targeted Runtimes

      Description of Figure 3-27 follows
      Description of "Figure 3-27 Project Properties Dialog: Targeted Runtimes"

    2. Select the Targeted Runtimes option.

      The Targeted Runtimes properties are displayed as Figure 3-19 shows.

    3. Check the new Oracle CEP 11.0 targeted runtime you created.

    4. Click OK.

    5. Repeat for the next project.

  11. For each project update the project builders:

    1. Right-click the project and select Open EPN Editor.

    2. If the EPN diagram opens without error, proceed to step 12.

    3. If the EPN diagram opens with the error shown in Figure 3-20, click the Configure Builder button.

      Figure 3-28 Builder Error

      Description of Figure 3-28 follows
      Description of "Figure 3-28 Builder Error"

      The EPN diagram is displayed.

    4. Repeat for the next project.

  12. Select Window > Preferences.

    The Preferences dialog appears as shown in Figure 3-29.

    Figure 3-29 Preferences Dialog

    Description of Figure 3-29 follows
    Description of "Figure 3-29 Preferences Dialog"

  13. Select the Validaion option.

  14. Ensure that the following validation options are checked:

    • CQL Validator

    • EPN Validator

    • XML Validator

  15. Unselect all other options.

  16. Click OK.

  17. Validate build inclusions:

    If your application bundle is using bundle localization and has substitution variables in its MANIFEST.MF file such as:

    Bundle-Name: %project.name
    

    Then your project root directory's build.properties file element bin.include must contain a reference to your bundle.properties file such as:

    bin.includes = META-INF/,\
                   bundle.properties,\
                   .
    
  18. Perform source changes, if necessary.

    For more information, see:

3.7 Managing Libraries and Other Non-Class Files in Oracle CEP Projects

Many projects require the use of non-class files such as libraries or property files that were obtained from a source other than the project itself, whether that be third party libraries, internal libraries created in other projects, or otherwise.

You can add the following non-class files to an Oracle CEP project, each with its own packaging and deployment characteristics:

3.7.1 How to Add a Standard JAR File to an Oracle CEP Project

If the library you need to use is a standard JAR file, you can add it to your Oracle CEP project. Alternatively, you can add a library as an OSGi bundle (see Section 3.7.2, "How to Add an OSGi Bundle to an Oracle CEP Project").

When you add a standard JAR file to an Oracle CEP project, you can optionally expose some or all of its packages to other bundles that will depend on this bundle.

To add a standard JAR file to an Oracle CEP project:

  1. Create a folder in your Oracle CEP IDE for Eclipse project to put the JAR file in.

    Oracle recommends that you create a folder to put them in such as lib.

    To create a new folder, right-click your project folder and select New > Folder.

  2. Outside of the Oracle CEP IDE for Eclipse, copy your JAR file into the lib folder.

  3. Inside the Oracle CEP IDE for Eclipse, right-click the lib folder and select Refresh.

    The JAR file appears in the lib folder as Figure 3-30 shows.

    Figure 3-30 Oracle CEP IDE for Eclipse lib Directory

    Description of Figure 3-30 follows
    Description of "Figure 3-30 Oracle CEP IDE for Eclipse lib Directory"

  4. Expand the META-INF directory and right-click the MANIFEST.MF file and select Open With > Plug-in Manifest Editor.

    The Manifest Editor opens as Figure 3-31 shows.

    Figure 3-31 Manifest Editor: Build Tab

    Description of Figure 3-31 follows
    Description of "Figure 3-31 Manifest Editor: Build Tab"

  5. Click the Build tab.

  6. Add your JAR file to the binary build under the project root as follows:

    • In the Binary Build area, expand the lib directory.

    • Check the box next to your library as Figure 3-31 shows.

    • Press hit CTRL-SHIFT-S to save all files.

      This edits the build.properties file in your project, and tells the Oracle CEP IDE for Eclipse to add the JAR file to your bundle when you build the bundle JAR.

  7. In the Manifest Editor, click the Runtime tab.

    The Runtime tab appears as Figure 3-32 shows.

    Figure 3-32 Manifest Editor - Runtime Tab

    Description of Figure 3-32 follows
    Description of "Figure 3-32 Manifest Editor - Runtime Tab"

  8. Add the JAR file to your project's classpath as follows:

  9. Optionally, if your bundle needs to export packages from this JAR to other bundles that will depend on this bundle, then you can export these packages as Section 3.7.4, "How to Export a Package" describes.

3.7.2 How to Add an OSGi Bundle to an Oracle CEP Project

If the library you need to use is an OSGi bundle, you can add it to your Oracle CEP project. Alternatively, you can add a library as a standard JAR file (see Section 3.7.1, "How to Add a Standard JAR File to an Oracle CEP Project").

To add an OSGi bundle to an Oracle CEP project, you add the bundle to that bundle's dependencies definition.

Note:

This process only makes the referenced bundle available to your project at build time. It does not package the bundle directly with your application when it is deployed or exported. Instead, this bundle must be deployed to the Oracle CEP server manually. For more information, see Section 20.1.3, "Application Libraries".

To add an OSGi bundle to an Oracle CEP project:

  1. Place the OSGi bundle in the DOMAIN_DIR/servername/modules directory, where DOMAIN_DIR refers to the domain directory such as /oracle_cep/user_projects/domains/mydomain and servername refers to the server instance, such as myserver. For example:

    c:\oracle_cep\user_projects\domains\mydomain\myserver\modules
    
  2. Start the Oracle CEP IDE for Eclipse.

  3. Right-click the project and select Refresh Targeted Runtime.

  4. Right-click the META-INF/MANIFEST.MF file and select Open With > Plug-in Manifest Editor.

    The Manifest Editor opens as Figure 3-37 shows.

    Figure 3-37 Manifest Editor: Dependencies Tab

    Description of Figure 3-37 follows
    Description of "Figure 3-37 Manifest Editor: Dependencies Tab"

  5. Click the Dependencies tab.

  6. In the Required Plug-ins area, click Add.

    The Plug-in Selection dialog appears as shown in Figure 3-38.

    Figure 3-38 Plug-in Selection Dialog

    Description of Figure 3-38 follows
    Description of "Figure 3-38 Plug-in Selection Dialog"

  7. Select the bundle you added to the DOMAIN_DIR/servername/modules directory of your Oracle CEP server installation directory in step 1 and click OK.

    The selected bundle appears in the Require-Bundle section of the MANIFEST.MF file.

3.7.3 How to Add a Property File to an Oracle CEP Project

You can add a Java property file to an Oracle CEP project so that the property file is deployed with your application and is available at runtime.

To add a property file to an Oracle CEP project:

  1. Create a folder in your Oracle CEP IDE for Eclipse project to put the property files in.

    Oracle recommends that you create a folder to put them in such as properties.

    To create a new folder, tight-click your project folder and select New > Folder.

  2. Outside of the Oracle CEP IDE for Eclipse, copy your property file into the properties folder.

  3. Inside the Oracle CEP IDE for Eclipse, right-click the properties folder and select Refresh.

    The property file appears in the properties folder as Figure 3-39 shows.

    Figure 3-39 Oracle CEP IDE for Eclipse properties Directory

    Description of Figure 3-39 follows
    Description of "Figure 3-39 Oracle CEP IDE for Eclipse properties Directory"

  4. Expand the META-INF directory and right-click the MANIFEST.MF file and select Open With > Plug-in Manifest Editor.

    The Manifest Editor opens as Figure 3-40 shows.

    Figure 3-40 Manifest Editor: Build Tab

    Description of Figure 3-40 follows
    Description of "Figure 3-40 Manifest Editor: Build Tab"

  5. Click the Build tab.

  6. Add your property file to the binary build under the project root as follows:

    • In the Binary Build area, expand the properties directory.

    • Check the box next to your property file as Figure 3-40 shows.

    • Press hit CTRL-SHIFT-S to save all files.

      This edits the build.properties file in your project, and tells the Oracle CEP IDE for Eclipse to add the property file to your bundle when you build the bundle JAR.

  7. You can access the properties file in Java code as Example 3-1 shows:

    Example 3-1 Accessing a Properties File

    public void onInsertEvent(Object event) {
        if (event instanceof HelloWorldEvent) {
            HelloWorldEvent helloWorldEvent = (HelloWorldEvent) event;
            InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream(
                "properties/test.properties"
            );
            Properties props = new Properties();
            try {
                props.load(resourceAsStream);
            } catch (IOException e) {
                e.printStackTrace();
            }
            System.out.println("Message: " + props.get("test-key"));
        }
    }
    

3.7.4 How to Export a Package

Optionally, if your bundle needs to export a package from a JAR to other bundles that will depend on this bundle, then you can export this package. By doing so, you update the Package-Export MANIFEST entry to create an OSGi exporter for the package.

To export a package:

  1. Inside the Oracle CEP IDE for Eclipse, expand the META-INF directory as Figure 3-41 shows.

    Figure 3-41 Oracle CEP IDE for Eclipse lib Directory

    Description of Figure 3-41 follows
    Description of "Figure 3-41 Oracle CEP IDE for Eclipse lib Directory"

  2. Right-click the MANIFEST.MF file and select Open With > Plug-in Manifest Editor.

    The Manifest Editor opens as Figure 3-42 shows.

    Figure 3-42 Manifest Editor: Runtime tab

    Description of Figure 3-42 follows
    Description of "Figure 3-42 Manifest Editor: Runtime tab"

  3. Click the Runtime tab.

    The Runtime tab appears as Figure 3-42 shows.

  4. In the Exported Packages area, click the Add button.

    The Package Selection dialog appears as Figure 3-43 shows.

    Figure 3-43 Package Selection Dialog

    Description of Figure 3-43 follows
    Description of "Figure 3-43 Package Selection Dialog"

  5. Select the package you want to export.

    To find a package in the list by name, type the name into the text field.

    In this example, select the javax.jws.soap package.

  6. Click OK.

    The selected package is added to the Exported Packages area as Figure 3-44 shows.

    Figure 3-44 Manifest Editor Runtime tab After Exporting a Package

    Description of Figure 3-44 follows
    Description of "Figure 3-44 Manifest Editor Runtime tab After Exporting a Package"

  7. Press hit CTRL-SHIFT-S to save all files.

3.8 Configuring Oracle CEP IDE for Eclipse Preferences

You can configure various preferences to customize Oracle CEP IDE for Eclipse to suit your needs, including:

3.8.1 How to Configure Application Library Path Preferences

You can define the path to an Oracle CEP server domain directory that contains application libraries that extend the Oracle CEP runtime.

For more information, see Section 20.3.1, "How to Define an Application Library Directory Using Oracle CEP IDE for Eclipse".

3.8.2 How to Configure Problem Severity Preferences

You can assign a severity to the various problems that Oracle CEP IDE for Eclipse can detect in your Oracle CEP project and application.

You can configure these preferences for each project individually or you can configure these preferences the same for all the projects in a given workspace.

To configure problem severity preferences:

  1. Open the EPN Editor (see Section 5.1, "Opening the EPN Editor")

  2. Select Window > Preferences.

    The Preferences dialog appears as shown in Figure 3-45.

    Figure 3-45 Properties Dialog

    Description of Figure 3-45 follows
    Description of "Figure 3-45 Properties Dialog"

  3. Select Oracle CEP Problem Severities.

  4. Choose the configuration scope:

  5. Select a severity for each type of problem. You can select one of:

    • Error: treat the problem as an error.

    • Warning: treat the problem as a warning.

    • Ignore: ignore the problem.

    Table 3-7 describes each of the problem areas you can configure.

    Table 3-7 Oracle CEP Problem Severities

    Category Problem Description

    Cache Configuration

    Unresolved cache loaders or resolved loaders with incorrect interface declarations.

    Ensure that the assembly file contains a bean element that identifies the cache loader class for each wlevs:cache-loader element and ensure that the cache loader class implements the appropriate interfaces.

    For more information, see:

     

    Unresolved cache stores or resolved stores with incorrect interface declarations.

    Ensure that the assembly file contains a bean element that identifies the cache store class for each wlevs:cache-store element and ensure that the cache store class implements the appropriate interfaces.

    For more information, see:

    Event Processing Network

    Configuration objects without a matching assembly definition

    EPN configuration elements are linked to assembly definitions by name and ID, respectively. Validate that a configuration element has a name that exactly matches an assembly element by ID within the same application.

     

    Configuration objects with duplicate name declarations.

    Configuration elements in Oracle CEP configuration files are identified by a name. Validate that no two configuration elements in an application have the same name.

     

    Unresolved event listeners or resolved listeners with incorrect interface declarations

    An event processing network is built by defining how elements in the network pull or push to events to other elements in the application. Validate that the target of an event push, a listener declaration on an EPN assembly element, implements the interfaces required to receive pushed events.

     

    Unresolved event sources or resolved sources with incorrect interface declarations

    An event processing network is built by defining how elements in the network pull or push to events to other elements in the application. Validate that the source of an event pull, a source declaration on an EPN assembly element, implements the interfaces required to provide pulled events.

     

    Unresolved query selectors configured for channels.

    Given a channel with an upstream Oracle CQL processor that defines more than one rule, ensure that the channel component configuration file selector element contains only rule names of the rules defined in the upstream Oracle CQL processor.

    For more information, see Section D.75, "selector".

     

    References to foreign stages (stages defined in external applications).

    Ensure that references to foreign stages can be resolved.

    For more information, see Section 1.1.1.2, "Foreign Stages".

     

    Channels not associated with CQL processors missing "event-type" declaration.

    Given a channel that does not have an upstream Oracle CQL processor, ensure that the assembly file wlevs:channel element is configured with an event-type attribute.

    For more information, see Chapter 8, "Configuring Channels".

     

    Deprecated EPN elements

    Oracle CEP provides backwards compatibility with applications built for previous versions. Validate an application's use of deprecated XML elements.

    Event Type Repository

    Event property type values that are not predefined types or do not resolve to a known class.

    Event types may be defined using dynamic Spring Beans through the properties element. The property values are limited to a fixed set of supported types. Validate that the property type is one of these allowed types.

    For more information, see Section 1.1.2, "Oracle CEP Event Types".

    Query Validation

    Problems found validating CQL Statements

    Validate that the Oracle CQL statement in a processor configuration is correct given the current application. Verify property names, event types, syntax, and other assembly-to-Oracle CQL references.

     

    Problems preventing the validation of CQL statements

    Some fundamental application errors will keep a Oracle CQL statement from being validated. For example, a processor configuration must have a matching processor assembly definition before any Oracle CQL requirements can be met. Verify that the minimum requirements are met to validate a processor's Oracle CQL statements.

     

    CQL statements in disconnected processors (no upstream channels in the EPN).

    Ensure that all Oracle CQL processors are connected to an upstream stage on the EPN. Without an upstream stage, the Oracle CQL processor's rules have no event stream to operate on.


  6. Click Apply.

  7. Click OK.