Tuesday, 15 April 2014

Oracle BPEL Variable Sensors For Monitoring

Sensors are the monitoring artifacts which can be used to monitor variable values, activity execution facts and fault details. For example using an Activity Sensor we can evaluate a scope activity start execution time, finish time and what is the value of a variable in that scope after execution completes.

There are the following type of sensors are there.

  • Variable Sensor : Used to detect value of a variable through out the bpel life cycle. We can use it for logging purpose in a BPEL process.
  • Activity Sensor : Used to monitor an activity within the BPEL process and also the variable used within the activity.
  • Fault Sensor : Used to monitor different BPEL faults during execution.
With every sensor we need to configure corresponding sensor actions like after triggered the sensor what Action it needs to perform. We can use one of the following type of Sensor Action with the sensor.
  • Database : publish the sensor data into report schema of in the database.
  • JMS Queue : publish the sensor data to a JMS queue
  • JMS Topic : publish the sensor data to a JMS Topic
  • Custom : publish the sensor data to a custom java class
  • JMS adapter : publish the data to a remote JMS queue or topic
When we use a sensor in BPEL process the Jdeveloper generates two files in it.
  • bpel_process_name_sensor.xml : It contains the sensor details.
  • bpel_process_name_sensorAction.xml : It contains the corresponding sensor Action details.
The following example describes the creation of a variable sensor and monitor its values from Report schema of the database.
  • In the BPEL process create a simple string type variable as LogMessage.
  • Assign the input value and different values to the above created variable.





















  • Go to the Monitor tab of the BPEL process in the SOA editor of Jdeveloper.





  • Go to the Structure pane of the Jdev and select variable under Sensors and click on add button.



















  • Give the sensor name to any name. Choose the sensor variable as LogMessage variable. Then give the sensor Action as Database and save all.





















  • After creating the sensor it generated two xml files in the project.

















  • Deploy the project and test the same from the Oracle Enterprise Manager.








  • Goto the launch Flow trace from EM then click on Sensor Values tab. Click on the LogMessageVarSensor and you will find the corresponding values in the Sensor Values tab.

















Please give your comment on the above post.
Happy Coding :)

No comments:

Post a Comment