Creating and Managing Composite Sensors During Runtime from Oracle SOA Composer

You can create, update, and delete composite sensors during runtime from Oracle SOA Composer without having to redeploy a SOA composite application. The following example describes how to create a composite sensor. Changes to composite sensors can be carried to new revisions of the composite through patching.

Ensure that you understand the issues around using duplicate names for composite sensors. For more information, see What You May Need to Know About Duplicate Composite Sensor Names.

To create and manage composite sensors during runtime from Oracle SOA Composer:

  1. Log in to Oracle SOA Composer.
    http://host:soa_server_port/soa/composer
    
  2. Expand the navigator on the left and double-click the composite in which to make changes. Figure 54-12 provides details.

    Figure 54-12 Oracle SOA Composer

    Description of Figure 54-12 follows
    Description of "Figure 54-12 Oracle SOA Composer"
  3. Click Create Session.

    The page is refreshed to display the Add, Edit, and Delete icons.

  4. Click the Add icon and select an option:
    • Create Service Sensor: Data is coming from a service binding component call.

    • Create Reference Sensor: Data is coming from a reference binding component call.

    • Create Event Sensor: Data is coming from a service component that has subscribed to a business event.

    For this example, Create Service Sensor is selected because the data is coming from a service binding component call. Figure 54-13 provides details.

    Figure 54-13 Composite Sensor Creation

    Description of Figure 54-13 follows
    Description of "Figure 54-13 Composite Sensor Creation"

    The Create Composite Sensor dialog is displayed.

  5. Click the Edit icon in the Expression section, and select an option:
    • Variables: Select to create an expression value for a variable.

    • Expression: Select to invoke the Expression Builder dialog for creating an XPath expression. This action always captures values as strings.

    • Properties: Select to create an expression value for a normalized message header property. These are the same properties that display under the Properties tab of the invoke activity, receive activity, reply activity, OnEvent branch of a scope activity (in BPEL 2.0), and OnMessage branch of a pick activity and scope activity (in BPEL 2.0).

    For this example, Expression is selected to build an XPath expression.

    Figure 54-14 provides details.

    Figure 54-14 XPath Expression Selection of Create Composite Sensor Dialog

    Description of Figure 54-14 follows
    Description of "Figure 54-14 XPath Expression Selection of Create Composite Sensor Dialog"

    The selections of variables, expressions, and header properties are the same as with the Create Composite Sensor dialog in Oracle JDeveloper, as described in Table 54-1.

    The Expression Builder dialog is displayed.

  6. Build an XPath expression and click OK. You can also select custom XPath expressions that you created.

    You are returned to the Create Composite Sensor dialog.

  7. Select the Enterprise Manager check box in Figure 54-15 to make this composite sensor a searchable, trackable field from the Flow Instances page of a SOA composite application in Oracle Enterprise Manager Fusion Middleware Control, and click OK. If you do not select this check box, the composite sensor is not searchable.

    Figure 54-15 Create Composite Sensor

    Description of Figure 54-15 follows
    Description of "Figure 54-15 Create Composite Sensor"

    The new composite sensor is displayed, including the sensor name, the type and name of the component in which the sensor is defined, any XPath expression or filter defined on the sensor, the storage location for runtime sensor data (Enterprise Manager or a JMS queue and topic), and any JMS targets. Figure 54-16 provides details.

    Figure 54-16 Composite Sensors in Oracle SOA Composer

    Description of Figure 54-16 follows
    Description of "Figure 54-16 Composite Sensors in Oracle SOA Composer"
  8. Click Save.
  9. In the upper right corner, click Publish to publish this session. Figure 54-17 provides details.
  10. Enter an optional description for the session when prompted, then click OK.

    The composite sensor is now running automatically in the deployed SOA composite application.

  11. Go to the Test Web Service page in Oracle Enterprise Manager Fusion Middleware Control to invoke a new instance. For information about the Test Web Service page, see "Initiating a SOA Composite Application Test Instance" of Administering Oracle SOA Suite and Oracle Business Process Management Suite.
  12. Create a new instance of the SOA composite application that includes the composite sensor (for this example, named loanAmount), and click Invoke.
  13. Go to the Flow Instances page of the SOA Infrastructure.
  14. In the Sensor Name field of the Flow Instance part of the Search Options section, specify the composite sensor you added. Figure 54-18 provides details.
  15. Click Search.
  16. In the Search Results table, select the instance of the SOA composite sensor and click Show Details.

    Instance details are displayed in the Faults, Composite Sensor Values, Composites, and Resequencing Groups tabs at the bottom of the page.

  17. Click the Composite Sensor Values tab.

    This tab displays the values of composite sensors detected in the selected business flow.

    • Name: Displays the composite sensor name (for this example, loanAmount).

    • Value: Displays the value assigned to the composite sensor.

    • Location: Displays the service or reference binding component or service component in which the composite sensor is defined.

    • Composite: Displays the SOA composite application in which the composite sensor is defined.

  18. If you want to edit or delete the composite sensor, return to Oracle SOA Composer, as shown in Figure 54-16, and click Create Session.

    The page is refreshed to again display the Add, Edit, and Delete icons.

  19. If you set the oracle.soacomposer.composite.showSensorXmlFiles Oracle WebLogic Server startup script system property, the Show Sensor XML button appears at the bottom of the page.
  20. Click this property to show sensor.xml and sensor-action.xml content. This helps you to test both to see that they are what you expect them to be.

    If you later import this SOA composite application in to Oracle JDeveloper, the composite sensors created during runtime in Oracle SOA Composer are displayed.