In the Structure window, right-click the Sensor Actions folder. Select Create Sensor Action.

17-10 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite If you want to publish the values of LoanApplicationSensor and CreditRatingSensor to the reports schema in the database, create an additional sensor action, as shown in Figure 17–8 , and associate it with both CreditRatingSensor and LoanApplicationSensor . Figure 17–8 Creating an Additional Sensor Action A new entry is created in the bpel_process_name_sensorAction.xml file, as shown in Example 17–5 : Example 17–5 bpel_process_name_sensorAction.xml file action name=PersistingAction enabled=true publishType=BPELReportsSchema sensorNameLoanApplicationSensorsensorName sensorNameCreditRatingSensorsensorName action The data of one sensor can be published to multiple endpoints. In the two preceding code samples, the data of LoanApplicationSensor was published to a JMS queue and to the reports schema in the database. If you want to monitor loan requests for which the loan amount is greater than 100,000, you can create a sensor action with a filter, as shown in Figure 17–9 . There is no design-time validation of the filter query. You must ensure the query is correct. Figure 17–9 Creating a Sensor Action with a Filter A new entry is created in the bpel_process_name_sensorAction.xml file, as shown in Example 17–6 : Using Oracle BPEL Process Manager Sensors 17-11 Example 17–6 bpel_process_name_sensorAction.xml file action name=BigMoneyBAMAction enabled=true filter=booleans:actionDatas:payload s:variableDatas:data autoloan:loanAmount 100000 publishType=JMSQueue publishTarget=jmsbigMoneyQueue sensorNameLoanApplicationSensorsensorName property name=“JMSConnectionFactory“ weblogic.jms.ConnectionFactory property action If you have special requirements for a sensor action that cannot be accomplished by using the built-in publish types database, JMS queue, JMS topic, and JMS Adapter, then you can create a sensor action with the custom publish type, as shown in Figure 17–10 . The name in the Publish Target field denotes a fully qualified Java class name that must be implemented. For more information, see Section 17.2.5, How to Create a Custom Data Publisher. Figure 17–10 Using the Custom Publish Type

17.2.4 How to Publish to Remote Topics and Queues

The JMS queue and JMS topic publish types only publish to local JMS destinations. If you want to publish sensor data to remote topics and queues, use the JMS adapter publish type, as shown in Figure 17–11 . Notes: ■ You must specify all the namespaces that are required to configure an action filter in the bpel_process_name_ sensorAction.xml configuration file. For example, assume you have a customer XML-schema element with namespace http:myCustomer and you want to create a filter on the customer age element. Therefore, you must manually declare the namespace for http:myCustomer in the file before you can use it in your filter. Otherwise, it is not possible to create a valid query. Add xmlns:ns1=http:myCustomer in the attribute declaration part of the file. You can then use ....ns1:customerns1:age... in your query. ■ You must specify the filter as a boolean XPath expression. 17-12 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 17–11 Using the JMS Adapter Publish Type In addition to enabling you to publish sensor data to remote topics and queues, the JMS adapter supports a variety of different JMS providers, including: ■ Third-party JMS providers such as Tibco JMS, IBM WebSphere MQ JMS, and SonicMQ ■ Oracle Enterprise Messaging Service OEMS providers such as memoryfile and database If you select the JMS Adapter publish type, you must create an entry in the weblogic-ra.xml file, which is updated through editing in the Oracle WebLogic Server Administration Console. Each JMS connection factory pool entry created in this console corresponds to one JNDI entry in weblogic-ra.xml. Update the Sensor Actions dialog with the chosen JNDI name selected during the creation of the JMS connection factory pool. For more information about the JMS adapter, see Oracle Fusion Middleware Users Guide for Technology Adapters.

17.2.5 How to Create a Custom Data Publisher

To create a custom data publisher, perform the following steps: To create a custom data publisher: 1. In the Application Navigator, double-click the BPEL project. The Project Properties dialog appears.

2. Click Libraries and Classpath.

3. Browse and select the following: SOA_ORACLE_HOME \lib\java\shared\oracle.soainfra.common\11.1.1\orabpel.jar Figure 17–12 provides details. 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 .