To Configure an Activity Sensor:

Assume you are monitoring a loan flow application, and want to know the following:

  • When a scope named GetCreditRating is initiated

  • When it is completed

  • At completion, what is the credit rating for the customer

The solution is to create an activity sensor for the GetCreditRating scope in Oracle BPEL Designer, as shown in Figure 18-4.

  1. Select Change to Monitor view at the top of Oracle BPEL Designer.

  2. In the Structure window, expand the Sensors folder.

  3. Right-click Activity, and select Create.

  4. To the right of the Activity Name field, click the Browse icon to select the activity for which to create the sensor. This is a required field.

    Figure 18-4 Creating an Activity Sensor

    Description of Figure 18-4 follows
    Description of "Figure 18-4 Creating an Activity Sensor"

    Activities that have sensors associated with them are identified with a magnifying glass in Oracle BPEL Designer.

    The Evaluation Time list shown in Figure 18-4 controls the point at which the sensor is fired.

  5. Select from the following:

    • All:

      The sensor monitors during the activation, completion, fault, compensation, and retry phases.

    • Activation

      The sensor is fired just before the activity is executed.

    • Completion

      The sensor is fired just after the activity is executed.

    • Fault

      The sensor is fired if a fault occurs during the execution of the activity. Select this value only for sensors that monitor simple activities.

    • Compensation

      The sensor is fired when the associated scope activity is compensated. Select this value only for sensors that monitor scopes.

    • Retry

      The sensor is fired when the associated invoke activity is retried.

    A new entry is created in the bpel_process_name_sensor.xml file:

    <sensor sensorName="CreditRatingSensor"
    
    classname="oracle.tip.pc.services.reports.dca.agents.BpelActivitySensorAgent"
              kind="activity" 
              target="GetCreditRating">
    
      <activityConfig evalTime="all">
        <variable outputNamespace="http://www.w3.org/2001/XMLSchema"
                  outputDataType="int" 
                  target="$crOutput/payload//services:rating"/>
      </activityConfig> 
    </sensor>
    
  6. If you want to create a variable sensor on the activity, then in the Activity Variable Sensors section, click the Add icon. This is an optional field.

  7. If you want to add a sensor action on the activity, then in the Sensor Actions section, click the Add icon. For more information, see How to Configure Sensor Actions.

  8. Click OK.

    Note:

    If you did not specify any values in the Activity Variable Sensors and Sensor Actions sections, you do not receive any validation errors or warning messages in the Log window in Oracle JDeveloper or in any log files. This is the expected behavior.