How to Create and Send Headers for Notifications

17 Using Oracle BPEL Process Manager Sensors 17-1 17 Using Oracle BPEL Process Manager Sensors This chapter describes how to use sensors to select BPEL activities, variables, and faults to monitor during runtime. This chapter describes how to use and set up sensors for a BPEL process. This chapter includes the following sections: ■ Section 17.1, Introduction to Sensors ■ Section 17.2, Configuring Sensors and Sensor Actions in Oracle JDeveloper ■ Section 17.3, Viewing Sensors and Sensor Action Definitions in Oracle Enterprise Manager Fusion Middleware Control For more information about sensors, see the following sections: ■ Section 50.7, Integrating BPEL Sensors Using Oracle BAM Sensor Action for how to create sensor actions in Oracle BPEL Process Manager to publish sensor data as data objects in an Oracle BAM Server ■ Appendix D, Understanding Sensor Public Views and the Sensor Actions XSD

17.1 Introduction to Sensors

Sensors are used to declare interest in specific events throughout the life cycle of a BPEL process instance. In a business process, that can be the activation and completion of a specific activity or the modification of a variable value in the business process. When a sensor is triggered, a specific sensor value is created. For example, if a sensor declares interest in the completion of a BPEL scope, the sensor value consists of the name of the BPEL scope and a time stamp value of when the activity was completed. If a sensor value declares interest in a BPEL process variable, then the sensor value consists of the value of the variable at the moment it was modified, a time stamp when the variable was modified, and the activity name and type that modified the BPEL variable. The data format for sensor values is normalized and well-defined using XML schema. A sensor action is an instruction on how to process sensor values. When a sensor is triggered by Oracle BPEL Process Manager, a new sensor value for that sensor is created. After that, all the sensor actions associated with that sensor are performed. A sensor action typically persists the sensor value in a database or sends the normalized sensor value data to a JMS queue or topic. For integration with Oracle Business Activity Monitoring, the sensor value can be sent to the BAM adapter. 17-2 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite You can define the following types of sensors, either through Oracle JDeveloper or manually by providing sensor configuration files. ■ Activity sensors Activity sensors are used to monitor the execution of activities within a BPEL process. For example, they can monitor the execution time of an invoke activity or how long it takes to complete a scope. Along with the activity sensor, you can also monitor variables of the activity. ■ Variable sensors Variable sensors are used to monitor variables or parts of a variable of a BPEL process. For example, variable sensors can monitor the input and output data of a BPEL process. ■ Fault sensors Fault sensors are used to monitor BPEL faults. You typically add or edit sensors as part of the BPEL modeling of activities, faults, and variables. These sensors are exposed through the following public SQL views: ■ BPEL_ACTIVITY_SENSOR_VALUES ■ BPEL_FAULT_SENSOR_VALUES ■ BPEL_VARIABLE_SENSOR_VALUES These views can be joined with the BPEL_PROCESS_INSTANCES view to associate the sensor value with the BPEL process instance that created the sensor values. For more information, see Appendix D, Understanding Sensor Public Views and the Sensor Actions XSD. When you model sensors in Oracle JDeveloper, two new files are created as part of the BPEL process archive: ■ bpel_process_name _sensor.xml Contains the sensor definitions of a BPEL process ■ bpel_process_name _sensorAction.xml Contains the sensor action definitions of a BPEL process See Section 17.2.2, How to Configure Sensors and Section 17.2.3, How to Configure Sensor Actions for how these files are created. After you define sensors for a BPEL process, you must configure sensor actions to publish the sensor data to a specified destination. If no sensor action is defined for a sensor, then nothing happens at runtime. The following information is required for a sensor action: ■ Name ■ Publish type The publish type specifies the destination in which the sensor data must be presented. You can publish sensor data to the following destination types. – Database Publishes the sensor data to the reports schema in the database. The sensor data can then be queried using SQL.