How to Publish to Remote Topics and Queues How to Register the Sensors and Sensor Actions in composite.xml

Using Oracle BPEL Process Manager Sensors 17-13 Figure 17–12 Project Properties Dialog 4. Create a new Java class. The package and class name must match the publish target name of the sensor action. 5. Implement the com.oracle.bpel.sensor.DataPublisher interface. This updates the source file and fills in the methods and import statements of the DataPublisher interface. 6. Using the Oracle JDeveloper editor, implement the publish method of the DataPublisher interface, as shown in the sample custom data publisher class in Figure 17–13 . 17-14 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 17–13 Custom Data Publisher Class 7. Ensure that the class compiles successfully. The next time that you deploy the BPEL process, the Java class is added to the SOA archive SAR and deployed.

17.2.6 How to Register the Sensors and Sensor Actions in composite.xml

Oracle JDeveloper automatically updates the composite.xml file to include appropriate properties for sensors and sensor actions, as shown in Example 17–7 : Example 17–7 composite.xml File composite name=JMSQFComposite applicationName=JMSQueueFilterApp revision=1.0 label=2007-04-02_14-41-31_553 mode=active state=on import namespace=http:xmlns.oracle.comJMSQueueFilter location=JMSQueueFilter.wsdl importType=wsdl service name=client interface.wsdl interface=http:xmlns.oracle.com JMSQueueFilterwsdl.interfaceJMSQueueFilter binding.ws Note: Ensure that additional Java libraries needed to implement the data publisher are in the class path. Oracle BPEL Process Manager can execute multiple process instances simultaneously, so ensure that the code in your data publisher is thread safe, or add appropriate synchronization blocks. To guarantee high throughput, do not use shared data objects that require synchronization. Using Oracle BPEL Process Manager Sensors 17-15 port=http:xmlns.oracle.comJMSQueueFilterwsdl.endpointclient JMSQueueFilter_pt service component name=JMSQueueFilter implementation.bpel src=JMSQueueFilter.bpel property name=configuration.sensorLocation type=xs:string many=falseJMSQueueFilter_sensor.xmlproperty property name=configuration.sensorActionLocation type=xs:string many=falseJMSQueueFilter_sensorAction.xmlproperty component wire source.uriclientsource.uri target.uriJMSQueueFilterclienttarget.uri wire composite You can specify additional properties with property name= ..., as shown in Example 17–7 . 17.3 Viewing Sensors and Sensor Action Definitions in Oracle Enterprise Manager Fusion Middleware Control The Oracle Enterprise Manager Fusion Middleware Control provides support for viewing the metadata of sensors, sensor actions, and the sensor data created as part of the process execution. For more information, see Oracle Fusion Middleware Administrators Guide for Oracle SOA Suite and Oracle BPM Suite. Notes: ■ For this release, BAM sensor actions are not shown in Oracle Enterprise Manager Fusion Middleware Control. ■ Only sensors with an associated database sensor action are displayed in Oracle Enterprise Manager Fusion Middleware Control. Sensors associated with a JMS queue, JMS topic, remote JMS, or custom sensor action are not displayed. 17-16 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Part III Part III Using the Oracle Mediator Service Component This part describes the components that comprise the Oracle Mediator service component. This part contains the following chapters: ■ Chapter 18, Getting Started with Oracle Mediator ■ Chapter 19, Creating Oracle Mediator Routing Rules ■ Chapter 20, Working with Multiple Part Messages in Oracle Mediator ■ Chapter 21, Using Oracle Mediator Error Handling ■ Chapter 22, Resequencing in Oracle Mediator ■ Chapter 23, Understanding Message Exchange Patterns of an Oracle Mediator 18 Getting Started with Oracle Mediator 18-1 18 Getting Started with Oracle Mediator This chapter provides an overview of Oracle Mediator and also describes how to create an Oracle Mediator service component. This chapter includes the following sections: ■ Section 18.1, Introduction to Oracle Mediator ■ Section 18.2, Introduction to the Mediator Editor Environment ■ Section 18.4, Configuring the Oracle Mediator Interface Definition ■ Section 18.5, Generating a WSDL File ■ Section 18.6, Specifying Operation or Event Subscription Properties ■ Section 18.7, Modifying an Oracle Mediator Service Component

18.1 Introduction to Oracle Mediator

Oracle Mediator is a service component of the Oracle SOA Suite that provides mediation capabilities such as selective routing, transformation, and validation capabilities, along with various message exchange patterns, such as synchronous, asynchronous, and event publishing or subscriptions. Oracle Mediator provides a lightweight framework to mediate between various components within a composite application. Oracle Mediator converts data to facilitate communication between different interfaces exposed by different components that are wired to build a SOA composite application. For example, Oracle Mediator can accept data contained in a text file from an application or service, transform it into a format appropriate for updating a database that serves as a customer repository, and then route and deliver the data to that database. Oracle Mediator facilitates integration between events and services, where service invocations and events can be mixed and matched. You can use an Oracle Mediator service component to consume a business event or receive a service invocation. An Oracle Mediator service component can evaluate routing rules, perform transformations, validate, and either invoke another service or raise another business event. You can use an Oracle Mediator service component to handle returned responses, callbacks, faults, and timeouts. Oracle Mediator provides the following features: ■ Content-Based and Header-Based Routing Oracle Mediator provides support for setting rules based on message payload or message headers. You can select elements or attributes from the message payload or the message header and, based on the values in those elements or attributes, 18-2 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite you can specify an action. For example, Oracle Mediator receives a file from an application or service containing data about new customers. Based on the country mentioned in the customer’s address, you can route and deliver data to the database storing data for that particular country. Similarly, you can route a message based on the message header. For more information about header-based routing, see Section 19.2.2.11, How to Access Headers for Filters and Assignments. ■ Synchronous and Asynchronous Interactions Oracle Mediator provides support for synchronous and asynchronous request and response interactions. In a synchronous interaction, the client requests a service and then waits for a response to the request. In an asynchronous interaction, the client invokes the service, but does not wait for the response. You can specify a timeout period for an asynchronous interaction and you can specify an action to perform after the timeout period, such as raise an event or start a process. For more information about synchronous and asynchronous interactions, see Section 19.2.2.4, How to Configure Response Messages and Chapter 23, Understanding Message Exchange Patterns of an Oracle Mediator. ■ Sequential and Parallel Routing of Messages A routing rule can be either executed in parallel or sequentially. You can configure the execution type from the Routing Rules section of the Mediator Editor. For more information about sequential and parallel routing of messages, see Section 19.2.2.3, How to Specify Sequential or Parallel Execution. ■ Transformations Oracle Mediator supports data transformation from one XML schema to another. This feature enables data interchange among applications using different schemas. For example, you can transform a comma-delimited file to a database table structure. For more information about transformations, see Section 19.2.2.8, How to Create Transformations. ■ Validations Oracle Mediator provides support for validating the incoming message payload using a Schematron or an XSD file. You can specify Schematron files for each inbound message part and Oracle Mediator can execute Schematron file validations for those parts. For more information about validations, see Section 19.2.2.12, How to Use Semantic Validation and http:www.schematron.com . ■ Java Callouts Oracle Mediator lets you add Java callouts to the routing rules. Java callouts are a way of using of Java code with regular expressions. For more information about Java callouts, see Section 19.2.2.13, How to Use Java Callouts. ■ Event Handling An event is a message sent because an activity occurred in a business environment. Oracle Mediator supports subscribing to business events and raising business events. You can subscribe to a business event that is generated when a situation of interest occurs. For example, you can subscribe to an event that is Getting Started with Oracle Mediator 18-3 generated when a new customer is created and then use this event to start a business process, such as sending a confirmation email. Similarly, you can generate business events when a situation of interest occurs. For example, after a new customer profile is created, you can generate a customer-created event. For more information about event handling, see Chapter 38, Using Business Events and the Event Delivery Network. ■ Dynamic Routing Dynamic routing separates the control logic of a process from the execution of the process. The control logic determines the path taken by the process. You can create a dynamic routing rule from the Mediator Editor. For more information about dynamic routing, see Section 19.2.3, How to Create Dynamic Routing Rules. ■ Error Handling Oracle Mediator supports both manual error handling and error handling based on a fault policy. A fault policy consists of conditions and actions, where the conditions specify the action to be carried out for a particular error condition. For more information about error handling, see Chapter 21, Using Oracle Mediator Error Handling. ■ Echo Oracle Mediator supports echoing source messages back to the initial caller after any transformations, validations, assignments, or sequencing operations are performed. For more information about Oracle Mediator echo support, see To echo a service: of Section 19.2.2.1, How to Specify Oracle Mediator Services or Events. ■ Multiple Part Messages Oracle Mediator an process messages consisting of multiple parts. Some Remote Procedure Call RPC web services contain multiple parts in the SOAP message. For more information about multiple part message support, see Chapter 20, Working with Multiple Part Messages in Oracle Mediator.

18.2 Introduction to the Mediator Editor Environment

You can create an Oracle Mediator service component in a SOA composite application of Oracle JDeveloper and then configure it using the Mediator Editor. To display the Mediator Editor, double-click the Oracle Mediator service component in the SOA Composite Editor. For information about the SOA Composite Editor, see Chapter 2, Developing SOA Composite Applications with Oracle SOA Suite. Figure 18–1 shows the Mediator Editor along with the Application Navigator, Structure, and Messages windows. 18-4 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 18–1 Mediator Editor Window Each section of the view shown in Figure 18–1 lets you perform specific design and deployment tasks. The sections in this view include the following: ■ Application Navigator The Application Navigator, shown in the upper left section of Figure 18–1 , displays the Oracle Mediator file structure. These files appear under the SOA Content folder of the project where you created an Oracle Mediator. A SOA composite application consists of the following Oracle Mediator files: – composite.xml: This file describes the entire SOA composite application. For information about the composite.xml file, see Chapter 2, Developing SOA Composite Applications with Oracle SOA Suite. – .componentType: This file describes the services and references for a service component. – .mplan: This file contains Oracle Mediator metadata. – .wsdl: The Web Services Description Language WSDL file specifies how other services call an Oracle Mediator. A WSDL file defines the input and output messages and operations of an Oracle Mediator. ■ Mediator Editor The Mediator Editor, shown in the middle of Figure 18–1 , provides a visual view of the Oracle Mediator component. This view appears when you perform one of the following actions: – Double-click an Oracle Mediator icon in the SOA Composite Editor. – Double-click the.mplan file for the Oracle Mediator in the Application Navigator.