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.
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.
Prerequisite
Installation and configuration of the SOA
suite and the JDeveloper are sufficient for executing this example.
Application Deployment
i.
Right click the project
ii.
Deploy->Sensor ->Deploy to Application Server
iii.
When Revision ID dialog box appears, click next (default revision
id is 1.0)
iv.
Select the connection name, which is created in previous section
and Click Next.
v.
Select the SOA server for which application has to be deployed.
Click next.
vi.
Click Finish
Project Details: -
We are getting the reference of project,
which is earlier created. The project is about, which read the file from one
location and write into the other location. Where we are using variable sensor,
which is used to monitor variable of BPEL process as described above.
Source:-
Steps:
This is our composite:
This is the structure of BPEL
Now we are going to create variable sensor in
BPEL. Click on Monitor tab in BPEL process.
Click on Sensors
Select variable sensor
Choose the target(In this example name is
target, which we assigning to sensor variable)
Choose your sensor action from Drop down.
click OK.
Now you can see the sensor with following.
Deploy Project
After project deploying successfully, open EM Console
and click on any instances which are created.
Click on Process_File BPEL Component activity
Click on Sensor Values tab
Now you can see variable sensor
(My_First_Sensor), which we created earlier with value Yash.
Note:-
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
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.
Configuring Sensors and Sensor Actions in
Oracle JDeveloper
Using Oracle BPEL Process Manager Sensors
18-3
– JMS queue
Publishes the sensor data to a JMS queue. The
XML data is posted in
accordance with the Sensor.xsd file. This
file is included with Oracle
JDeveloper in the JDEV_
HOME\jdeveloper\integration\seed\soa\shared\bpel
directory.
– JMS topic
Publishes the sensor data to a JMS topic. The
XML data is posted in
accordance with the same Sensor.xsd file used
with JMS queues.
– Custom
Publishes the data to a custom Java class.
Uses the JMS adapter to publish to remote
queues or topics and a variety of
different JMS providers. The JMS queue and
JMS topic publish types only
publish to local JMS destinations.
For more
Information visit the below URL.