5 Oracle Event Processing IDE for Eclipse Projects

This chapter describes how to use the Oracle Event Processing IDE for Eclipse to create projects with which to develop event processing networks (EPNs), including EPN assembly files and component configuration files.

This chapter includes the following sections:

5.1 Oracle Event Processing Project Overview

An Oracle Event Processing application includes the following artifacts:

  • Java source files

  • XML configuration files

  • OSGi bundle Manifest file

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

Figure 5-1 Oracle Event Processing Project Structure

Description of Figure 5-1 follows
Description of "Figure 5-1 Oracle Event Processing Project Structure"

Table 5-1 summarizes the important files in an Oracle Event Processing project including their use and location.

Table 5-1 Oracle Event Processing Project Artifacts

File Type Location Description

Java source files

Any Java source folder.

Default: src.

Events, adapters, and listeners are implemented in an Oracle Event Processing 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 Event Processing 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, "Overview of EPN Assembly Files".

Processor configuration file

META-INF/wlevs

The processor configuration file is where the Oracle Event Processing processor 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 23, "Assembling and Deploying Oracle Event Processing Applications".


5.2 Creating Oracle Event Processing Projects

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

Projects correspond 1-to-1 with Oracle Event Processing 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 Event Processing application.

5.2.1 How to Create an Oracle Event Processing Project

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

Note:

By default, the Overview view of the Eclipse manifest editor provides a link to launch the OSGi framework for testing the plugin. When you've created an Oracle Event Processing project using an application template, launching the framework is not supported.

To create an Oracle Event Processing project:

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

  2. Select File > New Project.

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

    Figure 5-2 New Project - Select a Wizard Dialog

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

  3. Expand Oracle Event Processing and select Oracle Event Processing Application Project.

  4. Click Next.

    The New Oracle Event Processing Application Project wizard appears as shown in Figure 5-3.

    Figure 5-3 New Oracle Event Processing Application Project Wizard: Create an Oracle Event Processing Application

    Description of Figure 5-3 follows
    Description of "Figure 5-3 New Oracle Event Processing Application Project Wizard: Create an Oracle Event Processing Application"

  5. Configure the Create an Oracle Event Processing Application dialog as shown in Table 5-2.

    Table 5-2 Create an Oracle Event Processing Application Dialog

    Attribute Description

    Project name

    The name of your Oracle Event Processing project. This name will be used as the default name of your application when it is deployed to the Oracle Event Processing 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, clear Use default location and click Browse to place the project in a directory outside of your workspace.

    Target Runtime

    The Oracle Event Processing server you will deploy your project to.


  6. Click Next.

    The Oracle Event Processing Application Content dialog appears as shown in Figure 5-4.

    Figure 5-4 New Oracle Event Processing Application Project Wizard: Oracle Event Processing Application Content

    Description of Figure 5-4 follows
    Description of "Figure 5-4 New Oracle Event Processing Application Project Wizard: Oracle Event Processing Application Content"

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

    Table 5-3 Oracle Event Processing 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 5-5.

    Figure 5-5 New Oracle Event Processing Application Project Wizard: Template Dialog

    Description of Figure 5-5 follows
    Description of "Figure 5-5 New Oracle Event Processing Application Project Wizard: Template Dialog"

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

  10. Click Finish.

    The Oracle Event Processing IDE for Eclipse creates the Oracle Event Processing project.

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

    By default, Oracle Event Processing 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 Event Processing objects in multiple EPN assembly and component configuration files to improve management, concurrent development, and re-use.

    For more information, see:

5.3 Creating EPN Assembly Files

You use the Event Processing Network (EPN) assembly file to declare the components that make up your Oracle Event Processing 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 Section 2.8, "Foreign Exchange (FX) Example". For additional information about Spring and OSGi, see Appendix A, "Additional Information about Spring and OSGi."

5.3.1 How to Create a New EPN Assembly File Using Oracle Event Processing 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 Event Processing IDE for Eclipse.

For more information, see:

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

  1. Create an Oracle Event Processing project.

    See Section 5.2, "Creating Oracle Event Processing Projects".

    By default, Oracle Event Processing IDE for Eclipse creates one EPN assembly file for your project. Optionally, you may choose to define Oracle Event Processing 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 5-6 shows.

    2. Expand Oracle Event Processing and select Oracle Event Processing Assembly File.

    3. Click Next.

      The New OEP Assembly File dialog appears as Figure 5-7 shows.

      Figure 5-7 New OEP Assembly File Dialog

      Description of Figure 5-7 follows
      Description of "Figure 5-7 New OEP Assembly File Dialog"

    4. Configure the New OEP Assembly File dialog as shown in Table 5-4.

      Table 5-4 New OEP Assembly File Dialog

      Attribute Description

      Enter or select the parent folder

      Enter the fully qualified path to the folder in which Oracle Event Processing 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 7.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 7.2.2, "Filtering".

  5. Create and connect nodes on the EPN.

    See Section 7.4, "Using the EPN Editor".

5.4 Creating Component Configuration Files

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

For an example of a component configuration file, see the Section 2.8, "Foreign Exchange (FX) Example".

5.4.1 How to Create a New Component Configuration File Using Oracle Event Processing 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 Event Processing IDE for Eclipse.

For more information, see:

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

  1. Create an Oracle Event Processing project.

    See Section 5.2, "Creating Oracle Event Processing Projects".

    By default, Oracle Event Processing IDE for Eclipse creates one component configuration file for your project. Optionally, you may choose to configure Oracle Event Processing 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 5-8 shows.

    • Expand Oracle Event Processing and select Oracle Event Processing Application Configuration File.

    • Click Next.

      The New OEP Application Configuration File dialog appears as Figure 5-9 shows.

      Figure 5-9 New OEP Application Configuration File Dialog

      Description of Figure 5-9 follows
      Description of "Figure 5-9 New OEP Application Configuration File Dialog"

    • Configure the New OEP Assembly File dialog as shown in Table 5-4.

      Table 5-5 New OEP Configuration File Dialog

      Attribute Description

      Enter or select the parent folder

      Enter the fully qualified path to the folder in which Oracle Event Processing 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 7.1, "Opening the EPN Editor".

  4. Create and connect nodes on the EPN.

    See Section 7.4, "Using the EPN Editor".

5.5 Exporting Oracle Event Processing Projects

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

5.5.1 How to Export an Oracle Event Processing Project

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

To export an Oracle Event Processing project:

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

  2. The Oracle Event Processing 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 5-10.

      Figure 5-10 Oracle Event Processing Project build.properties File

      Description of Figure 5-10 follows
      Description of "Figure 5-10 Oracle Event Processing 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.

  4. Expand the Oracle Event Processing option and select Oracle Event Processing Applications.

  5. Click Next.

    The Oracle Event Processing Applications Export: Select Project dialog appears as shown in Figure 5-11.

    Figure 5-11 Oracle Event Processing Applications Export: Select Project Dialog

    Description of Figure 5-11 follows
    Description of "Figure 5-11 Oracle Event Processing Applications Export: Select Project Dialog"

  6. Configure the Oracle Event Processing Applications Export: Select Project dialog as shown in Table 5-6.

    Table 5-6 Oracle Event Processing Application Content Dialog

    Attribute Description

    Available Projects

    The list of Oracle Event Processing 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 Event Processing 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 Event Processing server.

    1. If your JAR is an application, see Section 6.3.6, "How to Deploy an Application to an Oracle Event Processing Server".

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

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

    For example:

    • Other OSGi bundles your application depends on.

      Deploy these bundles on the Oracle Event Processing server using the Oracle Event Processing 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.

5.6 Upgrading Projects

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

This section describes:

For more information, see:

5.6.1 How to Upgrade Projects from Oracle Event Processing 2.1 to 10.3

While project structure has stayed the same since 2.1, the data stored in Oracle Event Processing 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 Event Processing 2.1 to 10.3:

  1. Open your Oracle Event Processing 2.1 project in Oracle Event Processing IDE for Eclipse.

  2. Select File > Switch Workspace > Other.

    The Workspace Launcher dialog appears.

    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.

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

  6. Click Next.

    The Import Projects dialog appears.

  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 5-12.

      Figure 5-12 Project Properties Dialog: Project Facets

      Description of Figure 5-12 follows
      Description of "Figure 5-12 Project Properties Dialog: Project Facets"

    2. Select the Project Facets option.

      The Project Facet properties are displayed as Figure 5-12 shows.

    3. Click Modify Project.

      The Modify Faceted Project dialog appears shown in Figure 5-13.

      Figure 5-13 Modify Faceted Project

      Description of Figure 5-13 follows
      Description of "Figure 5-13 Modify Faceted Project"

    4. For the Oracle Event Processing 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 Event Processing server runtime:

    1. Select Window > Preferences.

      The Preferences dialog appears as shown in Figure 5-14.

      Figure 5-14 Preferences Dialog

      Description of Figure 5-14 follows
      Description of "Figure 5-14 Preferences Dialog"

    2. Expand the Server option and select Installed Runtimes.

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

    4. Click OK.

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

    1. Right-click your project and select Properties.

      The Project Properties dialog appears as shown in Figure 5-15.

      Figure 5-15 Project Properties Dialog: Targeted Runtimes

      Description of Figure 5-15 follows
      Description of "Figure 5-15 Project Properties Dialog: Targeted Runtimes"

    2. Select the Targeted Runtimes option.

      The Targeted Runtimes properties are displayed as Figure 5-15 shows.

    3. Check the new Oracle Event Processing 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 5-16, click the Configure Builder button.

      Figure 5-16 Builder Error

      Description of Figure 5-16 follows
      Description of "Figure 5-16 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.

5.6.2 How to Upgrade Projects from Oracle Event Processing 10.3 to 11g Release 1 (11.1.1)

While project structure has stayed the same since 10.3, the data stored in Oracle Event Processing 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 Event Processing 10.3 to 11g Release 1 (11.1.1)

  1. Open your Oracle Event Processing 10.3 project in Oracle Event Processing IDE for Eclipse.

  2. Select File > Switch Workspace > Other.

    The Workspace Launcher dialog appears.

  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.

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

  6. Click Next.

    The Import Projects dialog appears as shown in Figure 5-17.

    Figure 5-17 Import Projects Dialog

    Description of Figure 5-17 follows
    Description of "Figure 5-17 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 5-12.

      Figure 5-18 Project Properties Dialog: Project Facets

      Description of Figure 5-18 follows
      Description of "Figure 5-18 Project Properties Dialog: Project Facets"

    2. Select the Project Facets option.

      The Project Facet properties are displayed as Figure 5-12 shows.

    3. Click Modify Project.

      The Modify Faceted Project dialog appears shown in Figure 5-13.

      Figure 5-19 Modify Faceted Project

      Description of Figure 5-19 follows
      Description of "Figure 5-19 Modify Faceted Project"

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

    5. For the Oracle Event Processing 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 Event Processing server runtime:

    1. Select Window > Preferences.

      The Preferences dialog appears as shown in Figure 5-14.

      Figure 5-20 Preferences Dialog

      Description of Figure 5-20 follows
      Description of "Figure 5-20 Preferences Dialog"

    2. Expand the Server option and select Installed Runtimes.

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

    4. Click OK.

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

    1. Right-click your project and select Properties.

      The Project Properties dialog appears as shown in Figure 5-15.

      Figure 5-21 Project Properties Dialog: Targeted Runtimes

      Description of Figure 5-21 follows
      Description of "Figure 5-21 Project Properties Dialog: Targeted Runtimes"

    2. Select the Targeted Runtimes option.

      The Targeted Runtimes properties are displayed as Figure 5-15 shows.

    3. Check the new Oracle Event Processing 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 5-16, click the Configure Builder button.

      Figure 5-22 Builder Error

      Description of Figure 5-22 follows
      Description of "Figure 5-22 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 5-23.

    Figure 5-23 Preferences Dialog

    Description of Figure 5-23 follows
    Description of "Figure 5-23 Preferences Dialog"

  13. Select the Validation option.

  14. Ensure that the following validation options are checked:

    • CQL Validator

    • EPN Validator

    • XML Validator

  15. Clear 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:

5.7 Managing Libraries and Other Non-Class Files in Oracle Event Processing 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 Event Processing project, each with its own packaging and deployment characteristics:

5.7.1 How to Add a Standard JAR File to an Oracle Event Processing Project

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

When you add a standard JAR file to an Oracle Event Processing 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 Event Processing project:

  1. Create a folder in your Oracle Event Processing 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 Event Processing IDE for Eclipse, copy your JAR file into the lib folder.

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

    The JAR file appears in the lib folder as Figure 5-24 shows.

    Figure 5-24 Oracle Event Processing IDE for Eclipse lib Directory

    Description of Figure 5-24 follows
    Description of "Figure 5-24 Oracle Event Processing 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 5-25 shows.

    Figure 5-25 Manifest Editor: Build Tab

    Description of Figure 5-25 follows
    Description of "Figure 5-25 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 5-25 shows.

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

      This edits the build.properties file in your project, and tells the Oracle Event Processing 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 5-26 shows.

    Figure 5-26 Manifest Editor - Runtime Tab

    Description of Figure 5-26 follows
    Description of "Figure 5-26 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 5.7.4, "How to Export a Package" describes.

5.7.2 How to Add an OSGi Bundle to an Oracle Event Processing Project

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

To add an OSGi bundle to an Oracle Event Processing 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 Event Processing server manually. For more information, see Section 23.1.3, "Application Libraries".

To add an OSGi bundle to an Oracle Event Processing 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 Event Processing 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 5-31 shows.

    Figure 5-31 Manifest Editor: Dependencies Tab

    Description of Figure 5-31 follows
    Description of "Figure 5-31 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 5-32.

    Figure 5-32 Plug-in Selection Dialog

    Description of Figure 5-32 follows
    Description of "Figure 5-32 Plug-in Selection Dialog"

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

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

5.7.3 How to Add a Property File to an Oracle Event Processing Project

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

To add a property file to an Oracle Event Processing project:

  1. Create a folder in your Oracle Event Processing 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 Event Processing IDE for Eclipse, copy your property file into the properties folder.

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

    The property file appears in the properties folder.

  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 5-33 shows.

    Figure 5-33 Manifest Editor: Build Tab

    Description of Figure 5-33 follows
    Description of "Figure 5-33 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 5-33 shows.

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

      This edits the build.properties file in your project, and tells the Oracle Event Processing 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 5-1 shows:

    Example 5-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"));
            // Throw com.bea.wlevs.ede.api.EventRejectedException to have exceptions propagated
            // up to senders. Other errors will be logged and dropped.
        }
    
    }
    

5.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 Event Processing IDE for Eclipse, expand the META-INF directory as Figure 5-34 shows.

    Figure 5-34 Oracle Event Processing IDE for Eclipse lib Directory

    Description of Figure 5-34 follows
    Description of "Figure 5-34 Oracle Event Processing 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 5-35 shows.

    Figure 5-35 Manifest Editor: Runtime tab

    Description of Figure 5-35 follows
    Description of "Figure 5-35 Manifest Editor: Runtime tab"

  3. Click the Runtime tab.

    The Runtime tab appears as Figure 5-35 shows.

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

    The Package Selection dialog appears as Figure 5-36 shows.

    Figure 5-36 Package Selection Dialog

    Description of Figure 5-36 follows
    Description of "Figure 5-36 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 5-37 shows.

    Figure 5-37 Manifest Editor Runtime tab After Exporting a Package

    Description of Figure 5-37 follows
    Description of "Figure 5-37 Manifest Editor Runtime tab After Exporting a Package"

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

5.7.5 How to Import a Package

Optionally, if your bundle needs to import a package from a JAR, then you can import this package. By doing so, you update the Package-Import MANIFEST entry to create an OSGi importer for the package.

To import a package:

  1. Inside the Oracle Event Processing IDE for Eclipse, expand the META-INF directory as Figure 5-38 shows.

    Figure 5-38 Oracle Event Processing IDE for Eclipse lib Directory

    Description of Figure 5-38 follows
    Description of "Figure 5-38 Oracle Event Processing 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 5-39 shows.

    Figure 5-39 Manifest Editor: Dependencies tab

    Description of Figure 5-39 follows
    Description of "Figure 5-39 Manifest Editor: Dependencies tab"

  3. Click the Dependencies tab.

    The Dependencies tab appears as Figure 5-39 shows.

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

    The Package Selection dialog appears as Figure 5-40 shows.

    Figure 5-40 Package Selection Dialog

    Description of Figure 5-40 follows
    Description of "Figure 5-40 Package Selection Dialog"

  5. Select the package you want to import.

    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 Import Packages area as Figure 5-41 shows.

    Figure 5-41 Manifest Editor Dependencies tab After Importing a Package

    Description of Figure 5-41 follows
    Description of "Figure 5-41 Manifest Editor Dependencies tab After Importing a Package"

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

5.8 Configuring Oracle Event Processing IDE for Eclipse Preferences

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

5.8.1 How to Configure Application Library Path Preferences

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

For more information, see Section 23.3.1, "How to Define the Application Library Directory Using Oracle Event Processing IDE for Eclipse".

5.8.2 How to Configure Problem Severity Preferences

You can assign a severity to the various problems that Oracle Event Processing IDE for Eclipse can detect in your Oracle Event Processing 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 7.1, "Opening the EPN Editor")

  2. Select Window > Preferences.

    The Preferences dialog appears.

  3. Select Oracle Event Processing Problem Severities.

    The Oracle Event Processing Problem Severities dialog appears as Figure 5-42 shows.

    Figure 5-42 Oracle Event Processing Problem Severities Dialog: Workspace

    Description of Figure 5-42 follows
    Description of "Figure 5-42 Oracle Event Processing Problem Severities Dialog: Workspace"

  4. 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 5-7 describes each of the problem areas you can configure.

    Table 5-7 Oracle Event Processing 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 Event Processing 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.87, "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.4.1.2, "Referencing Foreign Stages in an EPN Assembly File".

     

    Channels not associated with Oracle 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 10, "Connecting EPN Stages Using Channels".

     

    Deprecated EPN elements

    Oracle Event Processing 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 Chapter 9, "Defining and Using 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 affected directly or indirectly by missing binding parameters.

    Parameterized queries.

     

    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.


  5. Click Apply.

  6. Click OK.