Understanding Oracle CEP and Web Services How to Invoke a Web Service From an Oracle CEP Application

18 Configuring Applications With Data Cartridges 18-1 18 Configuring Applications With Data Cartridges This section describes: ■ Section 18.1, Understanding Data Cartridge Application Context ■ Section 18.2, How to Configure Oracle Spatial Application Context ■ Section 18.3, How to Configure Oracle JDBC Data Cartridge Application Context For more information on data cartridges, see Introduction to Data Cartridges in the Oracle Complex Event Processing CQL Language Reference.

18.1 Understanding Data Cartridge Application Context

Depending on the data cartridge implementation, you may be able to define an application context that the Oracle CEP server propagates to an instance of the data cartridge and the complex objects it provides. You may configure an application context for the following data cartridges: ■ Section 18.2, How to Configure Oracle Spatial Application Context ■ Section 18.3, How to Configure Oracle JDBC Data Cartridge Application Context For more information on data cartridges, see Introduction to Data Cartridges in the Oracle Complex Event Processing CQL Language Reference.

18.2 How to Configure Oracle Spatial Application Context

You define an application context for an instance of Oracle Spatial using element spatial:context in your Oracle CEP application’s Event Processing Network EPN assembly file. All constructors and methods from com.oracle.cartridge.spatial.Geometry and Oracle Spatial functions are aware of spatial:context. For example, the SRID is automatically set from the value in the Oracle Spatial application context. For more information, see: ■ SDO_SRID in the Oracle Spatial Developers Guide at http:download.oracle.comdocscdE11882_ 01appdev.112e11830sdo_objrelschema.htmSPATL492 ■ Understanding Oracle Spatial in the Oracle Complex Event Processing CQL Language Reference 18-2 Oracle Complex Event Processing Developers Guide To configure Oracle Spatial application context: 1. Open the EPN editor in the Oracle CEP IDE for Eclipse. See Section 6.1, Opening the EPN Editor . 2. Import the package com.oracle.cep.cartridge.spatial into your Oracle CEP application’s MANIFEST.MF file. For more information, see Section 4.7.5, How to Import a Package .

3. Right-click any component and select Go to Assembly Source.

4. Edit the EPN file to add the required namespace and schema location entries as Example 18–1 shows: Example 18–1 EPN Assembly File: Oracle Spatial Namespace and Schema Location ?xml version=1.0 encoding=UTF-8? beans xmlns=http:www.springframework.orgschemabeans xmlns:xsi=http:www.w3.org2001XMLSchema-instance xmlns:osgi=http:www.springframework.orgschemaosgi xmlns:wlevs=http:www.bea.comnswlevsspring xmlns:spatial=http:www.oracle.comnsocepspatial xsi:schemaLocation= http:www.springframework.orgschemabeans http:www.springframework.orgschemabeansspring-beans.xsd http:www.springframework.orgschemaosgi http:www.springframework.orgschemaosgispring-osgi.xsd http:www.bea.comnswlevsspring http:www.bea.comnswlevsspringspring-wlevs-v11_1_1_3.xsd http:www.oracle.comnsocepspatial http:www.oracle.comnsocepspatialocep-spatial.xsd 5. Edit the EPN file to add a spatial:context element as Example 18–2 shows. Example 18–2 spatial:context Element in EPN Assembly File spatial:context id=SpatialGRS80 6. Assign a value to the id attribute that is unique in this EPN. This is the name you will use to reference this application context in subsequent Oracle CQL queries. In Example 18–2 , the id is SpatialGRS80. 7. Configure the other attributes of the spatial:context element to suit your application requirements. Table 18–1 lists the attributes of the spatial:context element. Note: The id value must not equal the Oracle Spatial name spatial. For more information, see Data Cartridge Name in the Oracle Complex Event Processing CQL Language Reference. Table 18–1 spatial:context Element Attributes Attribute Description anyinteract-tolerance The default tolerance for contain or inside operator. Default: 0.0000005